feat: Introduce Dungeon Object Emulator Preview and Object Drawing Enhancements
- Added DungeonObjectEmulatorPreview for rendering dungeon objects using the SNES emulator, allowing real-time visualization of object graphics. - Implemented ObjectDrawer class to handle drawing of various object types to background buffers, utilizing game-specific patterns. - Updated DungeonCanvasViewer to integrate object rendering and improve background layer management. - Enhanced DungeonEditorV2 to support the new emulator preview, providing a more interactive editing experience. - Improved error handling and logging for better debugging during object rendering operations.
This commit is contained in:
40
src/app/gui/widgets/dungeon_object_emulator_preview.h
Normal file
40
src/app/gui/widgets/dungeon_object_emulator_preview.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef YAZE_APP_GUI_WIDGETS_DUNGEON_OBJECT_EMULATOR_PREVIEW_H_
|
||||
#define YAZE_APP_GUI_WIDGETS_DUNGEON_OBJECT_EMULATOR_PREVIEW_H_
|
||||
|
||||
#include "app/emu/snes.h"
|
||||
#include "app/rom.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace gui {
|
||||
|
||||
class DungeonObjectEmulatorPreview {
|
||||
public:
|
||||
DungeonObjectEmulatorPreview();
|
||||
~DungeonObjectEmulatorPreview();
|
||||
|
||||
void Initialize(Rom* rom);
|
||||
void Render();
|
||||
|
||||
private:
|
||||
void RenderControls();
|
||||
void TriggerEmulatedRender();
|
||||
|
||||
Rom* rom_ = nullptr;
|
||||
std::unique_ptr<emu::Snes> snes_instance_;
|
||||
SDL_Texture* object_texture_ = nullptr;
|
||||
|
||||
int object_id_ = 0;
|
||||
int room_id_ = 0;
|
||||
int object_x_ = 16;
|
||||
int object_y_ = 16;
|
||||
bool show_window_ = true;
|
||||
|
||||
// Debug info
|
||||
int last_cycle_count_ = 0;
|
||||
std::string last_error_;
|
||||
};
|
||||
|
||||
} // namespace gui
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_GUI_WIDGETS_DUNGEON_OBJECT_EMULATOR_PREVIEW_H_
|
||||
Reference in New Issue
Block a user