initialize blank editor set in EditorManager; update overworld initialization to use Rom pointers; add Clear and CleanupUnusedTextures methods in OverworldEditor.
This commit is contained in:
@@ -136,8 +136,6 @@ if (YAZE_BUILD_LIB)
|
||||
incl/yaze.h
|
||||
incl/zelda.h
|
||||
incl/snes.h
|
||||
incl/overworld.h
|
||||
incl/dungeon.h
|
||||
DESTINATION
|
||||
include
|
||||
)
|
||||
|
||||
@@ -73,6 +73,11 @@ void DrawRomSelector(EditorManager &editor_manager) {
|
||||
} // namespace
|
||||
|
||||
void EditorManager::Initialize(const std::string &filename) {
|
||||
// Create a blank editor set
|
||||
auto blank_editor_set = std::make_unique<EditorSet>();
|
||||
editor_sets_[nullptr] = std::move(blank_editor_set);
|
||||
current_editor_set_ = editor_sets_[nullptr].get();
|
||||
|
||||
if (!filename.empty()) {
|
||||
PRINT_IF_ERROR(OpenRomOrProject(filename));
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ class GraphicsEditor : public Editor {
|
||||
|
||||
Rom temp_rom_;
|
||||
Rom tilemap_rom_;
|
||||
zelda3::Overworld overworld_{temp_rom_};
|
||||
zelda3::Overworld overworld_{&temp_rom_};
|
||||
MemoryEditor cgx_memory_editor_;
|
||||
MemoryEditor col_memory_editor_;
|
||||
PaletteEditor palette_editor_;
|
||||
|
||||
@@ -86,7 +86,10 @@ class OverworldEditor : public Editor, public gfx::GfxContext {
|
||||
absl::Status Paste() override { return absl::UnimplementedError("Paste"); }
|
||||
absl::Status Find() override { return absl::UnimplementedError("Find"); }
|
||||
absl::Status Save() override;
|
||||
absl::Status Clear() override;
|
||||
|
||||
void CleanupUnusedTextures(uint64_t current_time, uint64_t timeout) override;
|
||||
|
||||
int jump_to_tab() { return jump_to_tab_; }
|
||||
int jump_to_tab_ = -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user