Open fdelapena opened 9 years ago
Tile rendering in liblcf would be suuuper useful. Especially for tools that don't need high performance code (Player). Though there is no image reading code in liblcf, so it could be a callback-based API where liblcf tells the caller for each tile which part of the tilemap shall be drawn.
lcf could e.g. go tile-by-tile (x, then y) and invoke some callback. iirc an auto tile consists of up to 4 sub-tiles? In that case there would be 4 callbacks per tile.
callback(const lcf::Context<lcf::rpg::Map>& ctx, int tile_x, int tile_y, int layer, const lcf::rpg::rect& pos) {}
Map editor and tools (lmu2png) need to parse tile map data, which is complex (waters, autotiles...). To prevent code duplicates this part could be moved to liblcf.
Additionally, there are some useful functions which may be also shared, e.g.:
Game_Interpreter::DecodeInt
,Game_Interpreter::DecodeString
and even maybeGame_Interpreter::DecodeMove
.