feat(editor): enhance screen editor with on-demand tilemap caching
- Implemented a new tilemap system for 8x8 tiles in the ScreenEditor, allowing for on-demand texture creation and caching of tiles. - Combined multiple sheets into a single tilemap, improving memory efficiency and rendering performance. - Updated tile drawing logic to extract and cache tiles from the atlas, ensuring textures are created only when needed. Benefits: - Enhances performance by reducing unnecessary texture creation. - Improves user experience with faster tile rendering and management in the editor.
This commit is contained in:
@@ -97,12 +97,12 @@ class ScreenEditor : public Editor {
|
||||
bool copy_button_pressed = false;
|
||||
bool paste_button_pressed = false;
|
||||
|
||||
std::vector<gfx::Bitmap> tile8_individual_;
|
||||
zelda3::DungeonMapLabels dungeon_map_labels_;
|
||||
|
||||
gfx::SnesPalette palette_;
|
||||
gfx::BitmapTable sheets_;
|
||||
gfx::Tilemap tile16_blockset_;
|
||||
gfx::Tilemap tile8_tilemap_; // Tilemap for 8x8 tiles with on-demand caching
|
||||
std::array<gfx::TileInfo, 4> current_tile16_info;
|
||||
|
||||
gui::Canvas current_tile_canvas_{"##CurrentTileCanvas", ImVec2(32, 32),
|
||||
|
||||
Reference in New Issue
Block a user