diff --git a/src/app/core/controller.h b/src/app/core/controller.h index 3a6b9f86..cca73202 100644 --- a/src/app/core/controller.h +++ b/src/app/core/controller.h @@ -11,7 +11,7 @@ #include "absl/status/status.h" #include "app/core/common.h" -#include "app/core/editor.h" +#include "app/editor/utils/editor.h" #include "app/editor/master_editor.h" #include "app/gui/icons.h" #include "app/gui/style.h" diff --git a/src/app/core/platform/app_delegate.mm b/src/app/core/platform/app_delegate.mm index 1bb56c21..fe999898 100644 --- a/src/app/core/platform/app_delegate.mm +++ b/src/app/core/platform/app_delegate.mm @@ -2,7 +2,7 @@ #import #import "app/core/controller.h" -#import "app/core/editor.h" +#import "app/editor/utils/editor.h" #import "app/core/platform/app_delegate.h" #import "app/core/platform/file_dialog.h" #import "app/rom.h" diff --git a/src/app/editor/context/gfx_context.cc b/src/app/editor/context/gfx_context.cc index 901c5ca1..8c8665e1 100644 --- a/src/app/editor/context/gfx_context.cc +++ b/src/app/editor/context/gfx_context.cc @@ -4,7 +4,7 @@ #include -#include "app/core/editor.h" +#include "app/editor/utils/editor.h" #include "app/editor/modules/palette_editor.h" #include "app/gfx/bitmap.h" #include "app/gfx/snes_palette.h" diff --git a/src/app/editor/context/gfx_context.h b/src/app/editor/context/gfx_context.h index ab203a95..f644b233 100644 --- a/src/app/editor/context/gfx_context.h +++ b/src/app/editor/context/gfx_context.h @@ -6,7 +6,7 @@ #include #include -#include "app/core/editor.h" +#include "app/editor/utils/editor.h" #include "app/editor/modules/palette_editor.h" #include "app/gfx/bitmap.h" #include "app/gfx/snes_palette.h" diff --git a/src/app/editor/dungeon_editor.h b/src/app/editor/dungeon_editor.h index 127b58be..2ec181c7 100644 --- a/src/app/editor/dungeon_editor.h +++ b/src/app/editor/dungeon_editor.h @@ -4,7 +4,7 @@ #include #include "app/core/common.h" -#include "app/core/editor.h" +#include "app/editor/utils/editor.h" #include "app/core/labeling.h" #include "app/editor/modules/gfx_group_editor.h" #include "app/editor/modules/palette_editor.h" diff --git a/src/app/editor/graphics_editor.h b/src/app/editor/graphics_editor.h index e8a675b3..58ecb23b 100644 --- a/src/app/editor/graphics_editor.h +++ b/src/app/editor/graphics_editor.h @@ -62,7 +62,7 @@ constexpr ImGuiTableFlags kGfxEditFlags = ImGuiTableFlags_Reorderable | /** * @class GraphicsEditor * @brief Allows the user to edit graphics sheets from the game or view - * prototype graphics of Link to the Past from the CGX, SCR, and OBJ formats. + * prototype graphics. * * The GraphicsEditor class is responsible for providing functionality to edit * graphics sheets from the game or view prototype graphics of Link to the Past diff --git a/src/app/editor/modules/assembly_editor.h b/src/app/editor/modules/assembly_editor.h index aefdb111..c34a0396 100644 --- a/src/app/editor/modules/assembly_editor.h +++ b/src/app/editor/modules/assembly_editor.h @@ -12,6 +12,10 @@ namespace yaze { namespace app { namespace editor { +/** + * @class AssemblyEditor + * @brief Text editor for modifying assembly code. + */ class AssemblyEditor { public: AssemblyEditor(); diff --git a/src/app/editor/modules/gfx_group_editor.cc b/src/app/editor/modules/gfx_group_editor.cc index 0ef738eb..da286a82 100644 --- a/src/app/editor/modules/gfx_group_editor.cc +++ b/src/app/editor/modules/gfx_group_editor.cc @@ -6,7 +6,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "app/core/editor.h" +#include "app/editor/utils/editor.h" #include "app/editor/modules/palette_editor.h" #include "app/gfx/bitmap.h" #include "app/gfx/snes_palette.h" diff --git a/src/app/editor/modules/gfx_group_editor.h b/src/app/editor/modules/gfx_group_editor.h index ab1a3db6..4f45be28 100644 --- a/src/app/editor/modules/gfx_group_editor.h +++ b/src/app/editor/modules/gfx_group_editor.h @@ -7,7 +7,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "app/core/editor.h" +#include "app/editor/utils/editor.h" #include "app/editor/modules/palette_editor.h" #include "app/gfx/bitmap.h" #include "app/gfx/snes_palette.h" @@ -23,6 +23,10 @@ namespace yaze { namespace app { namespace editor { +/** + * @class GfxGroupEditor + * @brief Manage graphics group configurations in a ROM. + */ class GfxGroupEditor : public SharedROM { public: absl::Status Update(); diff --git a/src/app/editor/modules/music_editor.h b/src/app/editor/modules/music_editor.h index f860bfda..97799b0d 100644 --- a/src/app/editor/modules/music_editor.h +++ b/src/app/editor/modules/music_editor.h @@ -54,6 +54,11 @@ static const char* kGameSongs[] = {"Title", static constexpr absl::string_view kSongNotes[] = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B", "C"}; + +/** + * @class MusicEditor + * @brief A class for editing music data in a ROM. + */ class MusicEditor : public SharedROM { public: void Update(); diff --git a/src/app/editor/modules/palette_editor.h b/src/app/editor/modules/palette_editor.h index 8dcfb689..c823476c 100644 --- a/src/app/editor/modules/palette_editor.h +++ b/src/app/editor/modules/palette_editor.h @@ -77,6 +77,10 @@ class PaletteEditorHistory { }; } // namespace palette_internal +/** + * @class PaletteEditor + * @brief Allows the user to view and edit in game palettes. + */ class PaletteEditor : public SharedROM { public: absl::Status Update(); diff --git a/src/app/editor/modules/tile16_editor.cc b/src/app/editor/modules/tile16_editor.cc index a0c87c12..5d3818e8 100644 --- a/src/app/editor/modules/tile16_editor.cc +++ b/src/app/editor/modules/tile16_editor.cc @@ -6,7 +6,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "app/core/editor.h" +#include "app/editor/utils/editor.h" #include "app/editor/modules/palette_editor.h" #include "app/gfx/bitmap.h" #include "app/gfx/snes_palette.h" diff --git a/src/app/editor/modules/tile16_editor.h b/src/app/editor/modules/tile16_editor.h index 5a2d27c8..8b91a51d 100644 --- a/src/app/editor/modules/tile16_editor.h +++ b/src/app/editor/modules/tile16_editor.h @@ -7,7 +7,7 @@ #include "absl/status/status.h" #include "absl/status/statusor.h" -#include "app/core/editor.h" +#include "app/editor/utils/editor.h" #include "app/editor/context/gfx_context.h" #include "app/editor/modules/palette_editor.h" #include "app/gfx/bitmap.h" diff --git a/src/app/editor/overworld_editor.cc b/src/app/editor/overworld_editor.cc index 917ca588..5b66f3bf 100644 --- a/src/app/editor/overworld_editor.cc +++ b/src/app/editor/overworld_editor.cc @@ -697,8 +697,6 @@ void OverworldEditor::CheckForMousePan() { } } -// Overworld Editor canvas -// Allows the user to make changes to the overworld map. void OverworldEditor::DrawOverworldCanvas() { if (all_gfx_loaded_) { DrawOverworldMapSettings(); diff --git a/src/app/editor/overworld_editor.h b/src/app/editor/overworld_editor.h index 9cb190c5..c9e54a97 100644 --- a/src/app/editor/overworld_editor.h +++ b/src/app/editor/overworld_editor.h @@ -12,7 +12,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_format.h" #include "app/core/common.h" -#include "app/core/editor.h" +#include "app/editor/utils/editor.h" #include "app/editor/context/entrance_context.h" #include "app/editor/context/gfx_context.h" #include "app/editor/modules/gfx_group_editor.h" @@ -88,6 +88,9 @@ class OverworldEditor : public Editor, auto overworld() { return &overworld_; } + /** + * @brief + */ int jump_to_tab() { return jump_to_tab_; } int jump_to_tab_ = -1; @@ -139,6 +142,10 @@ class OverworldEditor : public Editor, void CheckForSelectRectangle(); absl::Status CheckForCurrentMap(); void CheckForMousePan(); + + /** + * @brief Allows the user to make changes to the overworld map. + */ void DrawOverworldCanvas(); absl::Status DrawTile16Selector(); diff --git a/src/app/core/editor.h b/src/app/editor/utils/editor.h similarity index 54% rename from src/app/core/editor.h rename to src/app/editor/utils/editor.h index 2aa5b88d..330d8716 100644 --- a/src/app/core/editor.h +++ b/src/app/editor/utils/editor.h @@ -3,6 +3,21 @@ #include "absl/status/status.h" +namespace yaze { +namespace app { + +/** + * @namespace editor + * @brief Editors are the view controllers for the application. + */ +namespace editor { + +/** + * @class Editor + * @brief Interface for editor classes. + * + * Provides basic editing operations that each editor should implement. + */ class Editor { public: Editor() = default; @@ -18,4 +33,8 @@ class Editor { virtual absl::Status Update() = 0; }; +} // namespace editor +} // namespace app +} // namespace yaze + #endif // YAZE_APP_CORE_EDITOR_H \ No newline at end of file diff --git a/src/app/zelda3/overworld.cc b/src/app/zelda3/overworld.cc index 08c91541..9b7a3a22 100644 --- a/src/app/zelda3/overworld.cc +++ b/src/app/zelda3/overworld.cc @@ -311,11 +311,11 @@ absl::Status Overworld::LoadOverworldMaps() { } else if (i >= 0x80) { world_type = 2; } - futures.emplace_back( - std::async(std::launch::async, [this, i, size, world_type]() { - return overworld_maps_[i].BuildMap(size, game_state_, world_type, - GetMapTiles(world_type)); - })); + auto task_function = [this, i, size, world_type]() { + return overworld_maps_[i].BuildMap(size, game_state_, world_type, + GetMapTiles(world_type)); + }; + futures.emplace_back(std::async(std::launch::async, task_function)); } // Wait for all tasks to complete and check their results diff --git a/test/zelda3/room_object_test.cc b/test/zelda3/room_object_test.cc index 8a283106..d9416d26 100644 --- a/test/zelda3/room_object_test.cc +++ b/test/zelda3/room_object_test.cc @@ -13,12 +13,15 @@ namespace yaze_test { namespace zelda3_test { +using yaze::app::ROM; +using yaze::app::zelda3::dungeon::DungeonObjectRenderer; + TEST(DungeonObjectTest, RenderObjectsAsBitmaps) { - app::ROM rom; + ROM rom; // rom.LoadFromFile("/Users/scawful/Code/yaze/build/bin/zelda3.sfc")); // EXPECT_EQ(rom_status, absl::Status::ok()); - app::zelda3::dungeon::DungeonObjectRenderer renderer; + DungeonObjectRenderer renderer; } } // namespace zelda3_test