From 68eb3a657c4ebcc5a71792c06d321ab72877d39b Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 27 Apr 2025 14:01:06 -0400 Subject: [PATCH] Refactor OverworldEditor to improve map index calculation; streamline current_map_ assignment and maintain clarity in highlighted map logic. --- src/app/editor/overworld/overworld_editor.cc | 2 +- src/app/editor/sprite/sprite_editor.cc | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app/editor/overworld/overworld_editor.cc b/src/app/editor/overworld/overworld_editor.cc index dd9f2a47..2b0bdc4c 100644 --- a/src/app/editor/overworld/overworld_editor.cc +++ b/src/app/editor/overworld/overworld_editor.cc @@ -578,12 +578,12 @@ absl::Status OverworldEditor::CheckForCurrentMap() { // Calculate the index of the map in the `maps_bmp_` vector current_map_ = map_x + map_y * 8; - const int current_highlighted_map = current_map_; if (current_world_ == 1) { current_map_ += 0x40; } else if (current_world_ == 2) { current_map_ += 0x80; } + const int current_highlighted_map = current_map_; current_parent_ = overworld_.overworld_map(current_map_)->parent(); diff --git a/src/app/editor/sprite/sprite_editor.cc b/src/app/editor/sprite/sprite_editor.cc index 071303d1..953db68e 100644 --- a/src/app/editor/sprite/sprite_editor.cc +++ b/src/app/editor/sprite/sprite_editor.cc @@ -23,9 +23,7 @@ using ImGui::Text; void SpriteEditor::Initialize() {} -absl::Status SpriteEditor::Load() { - return absl::OkStatus(); -} +absl::Status SpriteEditor::Load() { return absl::OkStatus(); } absl::Status SpriteEditor::Update() { if (rom()->is_loaded() && !sheets_loaded_) { @@ -188,8 +186,8 @@ void SpriteEditor::DrawCurrentSheets() { } graphics_sheet_canvas_.DrawGrid(); graphics_sheet_canvas_.DrawOverlay(); - ImGui::EndChild(); } + ImGui::EndChild(); } void SpriteEditor::DrawSpritesList() {