Enhance Dungeon Editor with Object Rendering and Layout Management
- Introduced new object rendering features in DungeonEditor, allowing for improved visualization of dungeon objects with options to show outlines, render objects, and display object information. - Implemented a caching mechanism for rendered objects to optimize performance. - Added functionality to load and manage room layouts, including walls, floors, and other structural elements, enhancing the overall editing experience. - Refactored object handling in Room and RoomObject classes to support new rendering logic and ensure compatibility with the updated layout system. - Introduced ObjectParser for efficient parsing of object data directly from ROM, improving reliability and performance in object rendering.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "app/rom.h"
|
||||
#include "app/zelda3/dungeon/room_object.h"
|
||||
#include "app/zelda3/dungeon/room_layout.h"
|
||||
#include "app/zelda3/sprite/sprite.h"
|
||||
|
||||
namespace yaze {
|
||||
@@ -200,15 +201,22 @@ enum TagKey {
|
||||
class Room {
|
||||
public:
|
||||
Room() = default;
|
||||
Room(int room_id, Rom *rom) : room_id_(room_id), rom_(rom) {}
|
||||
Room(int room_id, Rom *rom) : room_id_(room_id), rom_(rom), layout_(rom) {}
|
||||
|
||||
void LoadRoomGraphics(uint8_t entrance_blockset = 0xFF);
|
||||
void CopyRoomGraphicsToBuffer();
|
||||
void RenderRoomGraphics();
|
||||
void RenderObjectsToBackground();
|
||||
void LoadAnimatedGraphics();
|
||||
void LoadObjects();
|
||||
void LoadSprites();
|
||||
void LoadChests();
|
||||
void LoadRoomLayout();
|
||||
void LoadDoors();
|
||||
void LoadTorches();
|
||||
void LoadBlocks();
|
||||
void LoadPits();
|
||||
const RoomLayout& GetLayout() const { return layout_; }
|
||||
|
||||
auto blocks() const { return blocks_; }
|
||||
auto &mutable_blocks() { return blocks_; }
|
||||
@@ -251,9 +259,13 @@ class Room {
|
||||
std::array<chest, 16> chest_list_;
|
||||
|
||||
std::vector<RoomObject> tile_objects_;
|
||||
// TODO: add separate door objects list when door section (F0 FF) is parsed
|
||||
std::vector<zelda3::Sprite> sprites_;
|
||||
std::vector<staircase> z3_staircases_;
|
||||
std::vector<chest_data> chests_in_room_;
|
||||
|
||||
// Room layout system for walls, floors, and structural elements
|
||||
RoomLayout layout_;
|
||||
|
||||
LayerMergeType layer_merging_;
|
||||
CollisionKey collision_;
|
||||
|
||||
Reference in New Issue
Block a user