EasyRPG / liblcf

Library to handle RPG Maker 2000/2003 and EasyRPG projects
https://easyrpg.org
MIT License
118 stars 55 forks source link

Move tile code to liblcf #146

Open fdelapena opened 9 years ago

fdelapena commented 9 years ago

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 maybe Game_Interpreter::DecodeMove.

Ghabry commented 4 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) {}