Refactor ROM handling and remove SharedRom singleton for improved architecture

- Eliminated the SharedRom class to enhance modularity and reduce global state management.
- Updated various classes to directly manage ROM instances, improving clarity and encapsulation.
- Added new functions for loading messages and colors from ROM, enhancing functionality.
- Refactored Canvas and Editor classes to utilize direct ROM references, streamlining interactions.
- Improved documentation and comments for better code understanding and maintainability.
This commit is contained in:
scawful
2025-08-03 17:52:02 -04:00
parent a9a9cc888b
commit fdda77c172
17 changed files with 256 additions and 236 deletions

View File

@@ -13,7 +13,7 @@ namespace editor {
* @class GfxGroupEditor
* @brief Manage graphics group configurations in a Rom.
*/
class GfxGroupEditor : public SharedRom {
class GfxGroupEditor {
public:
absl::Status Update();
@@ -27,6 +27,8 @@ class GfxGroupEditor : public SharedRom {
void SetSelectedSpriteset(uint8_t spriteset) {
selected_spriteset_ = spriteset;
}
void set_rom(Rom* rom) { rom_ = rom; }
Rom* rom() const { return rom_; }
private:
uint8_t selected_blockset_ = 0;
@@ -39,6 +41,7 @@ class GfxGroupEditor : public SharedRom {
gui::Canvas spriteset_canvas_;
gfx::SnesPalette palette_;
Rom* rom_ = nullptr;
};
} // namespace editor