- 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.
41 lines
855 B
C++
41 lines
855 B
C++
#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_
|