From f9e0ed17bf1ffb6df2b1e7ba36604c7f66b31535 Mon Sep 17 00:00:00 2001 From: Justin Scofield Date: Mon, 20 Jun 2022 14:00:59 -0400 Subject: [PATCH] namespace housekeeping continued again --- src/CMakeLists.txt | 16 ++++++++-------- src/{application => app}/core/constants.h | 8 ++++---- src/{application => app}/core/controller.cc | 4 ++-- src/{application => app}/core/controller.h | 10 +++++----- src/{application => app}/core/entry_point.h | 8 ++++---- src/{application => app}/gfx/bitmap.cc | 4 ++-- src/{application => app}/gfx/bitmap.h | 8 ++++---- src/{application => app}/gfx/palette.cc | 4 ++-- src/{application => app}/gfx/palette.h | 10 +++++----- src/{application => app}/gfx/tile.cc | 4 ++-- src/{application => app}/gfx/tile.h | 8 ++++---- src/{application => app}/rom.cc | 4 ++-- src/{application => app}/rom.h | 8 ++++---- src/{application => app}/zelda3/overworld.cc | 4 ++-- src/{application => app}/zelda3/overworld.h | 8 ++++---- src/{application => app}/zelda3/overworld_map.cc | 4 ++-- src/{application => app}/zelda3/overworld_map.h | 4 ++-- src/gui/editor/editor.cc | 4 ++-- src/gui/editor/editor.h | 10 +++++----- src/gui/editor/overworld_editor.cc | 4 ++-- src/gui/editor/overworld_editor.h | 8 ++++---- src/gui/icons.h | 2 +- src/gui/input.h | 4 ++-- src/gui/style.h | 4 ++-- src/yaze.h | 4 ++-- test/CMakeLists.txt | 8 ++++---- 26 files changed, 82 insertions(+), 82 deletions(-) rename src/{application => app}/core/constants.h (99%) rename src/{application => app}/core/controller.cc (99%) rename src/{application => app}/core/controller.h (85%) rename src/{application => app}/core/entry_point.h (55%) rename src/{application => app}/gfx/bitmap.cc (96%) rename src/{application => app}/gfx/bitmap.h (79%) rename src/{application => app}/gfx/palette.cc (94%) rename src/{application => app}/gfx/palette.h (80%) rename src/{application => app}/gfx/tile.cc (95%) rename src/{application => app}/gfx/tile.h (90%) rename src/{application => app}/rom.cc (99%) rename src/{application => app}/rom.h (93%) rename src/{application => app}/zelda3/overworld.cc (99%) rename src/{application => app}/zelda3/overworld.h (91%) rename src/{application => app}/zelda3/overworld_map.cc (96%) rename src/{application => app}/zelda3/overworld_map.h (94%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b524999c..c91b5cfb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,13 +36,13 @@ add_executable( gui/style.cc gui/editor/editor.cc gui/editor/overworld_editor.cc - application/rom.cc - application/core/controller.cc - application/zelda3/overworld.cc - application/zelda3/overworld_map.cc - application/gfx/bitmap.cc - application/gfx/tile.cc - application/gfx/palette.cc + app/rom.cc + app/core/controller.cc + app/zelda3/overworld.cc + app/zelda3/overworld_map.cc + app/gfx/bitmap.cc + app/gfx/tile.cc + app/gfx/palette.cc # GUI libraries ${IMGUI_PATH}/imgui.cpp ${IMGUI_PATH}/imgui_demo.cpp @@ -66,7 +66,7 @@ target_include_directories( yaze PUBLIC / Library/ - application/ + app/ "C:/msys64/mingw64/include/libpng16" "C:/msys64/mingw64/include/SDL2" "C:/msys64/mingw64/include" diff --git a/src/application/core/constants.h b/src/app/core/constants.h similarity index 99% rename from src/application/core/constants.h rename to src/app/core/constants.h index 27f32ea3..94f7cd24 100644 --- a/src/application/core/constants.h +++ b/src/app/core/constants.h @@ -1,5 +1,5 @@ -#ifndef YAZE_APPLICATION_CORE_CONSTANTS_H -#define YAZE_APPLICATION_CORE_CONSTANTS_H +#ifndef YAZE_APP_CORE_CONSTANTS_H +#define YAZE_APP_CORE_CONSTANTS_H #include #include @@ -21,7 +21,7 @@ using uint = unsigned int; using uchar = unsigned char; namespace yaze { -namespace application { +namespace app { namespace core { namespace Constants { @@ -1226,7 +1226,7 @@ static const std::string TileTypeNames[] = { } // namespace Constants } // namespace Core -} // namespace application +} // namespace app } // namespace yaze #endif \ No newline at end of file diff --git a/src/application/core/controller.cc b/src/app/core/controller.cc similarity index 99% rename from src/application/core/controller.cc rename to src/app/core/controller.cc index ec424176..0943f013 100644 --- a/src/application/core/controller.cc +++ b/src/app/core/controller.cc @@ -11,7 +11,7 @@ #include "gui/editor/editor.h" namespace yaze { -namespace application { +namespace app { namespace core { bool Controller::isActive() const { return active_; } @@ -181,5 +181,5 @@ void Controller::CreateGuiContext() { } } // namespace core -} // namespace application +} // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/application/core/controller.h b/src/app/core/controller.h similarity index 85% rename from src/application/core/controller.h rename to src/app/core/controller.h index c7cccb2c..73a9b31b 100644 --- a/src/application/core/controller.h +++ b/src/app/core/controller.h @@ -1,5 +1,5 @@ -#ifndef YAZE_APPLICATION_CORE_CONTROLLER_H -#define YAZE_APPLICATION_CORE_CONTROLLER_H +#ifndef YAZE_APP_CORE_CONTROLLER_H +#define YAZE_APP_CORE_CONTROLLER_H #define SDL_MAIN_HANDLED #include @@ -15,7 +15,7 @@ int main(int argc, char **argv); namespace yaze { -namespace application { +namespace app { namespace core { class Controller { @@ -49,7 +49,7 @@ class Controller { }; } // namespace core -} // namespace application +} // namespace app } // namespace yaze -#endif // YAZE_APPLICATION_CORE_CONTROLLER_H \ No newline at end of file +#endif // YAZE_APP_CORE_CONTROLLER_H \ No newline at end of file diff --git a/src/application/core/entry_point.h b/src/app/core/entry_point.h similarity index 55% rename from src/application/core/entry_point.h rename to src/app/core/entry_point.h index 7ed3ed2f..3d16d6f3 100644 --- a/src/application/core/entry_point.h +++ b/src/app/core/entry_point.h @@ -1,10 +1,10 @@ -#ifndef YAZE_APPLICATION_CONTROLLER_ENTRYPOINT_H -#define YAZE_APPLICATION_CONTROLLER_ENTRYPOINT_H +#ifndef YAZE_APP_CONTROLLER_ENTRYPOINT_H +#define YAZE_APP_CONTROLLER_ENTRYPOINT_H #include "controller.h" int main(int argc, char** argv) { - yaze::application::core::Controller controller; + yaze::app::core::Controller controller; controller.onEntry(); while (controller.isActive()) { controller.onInput(); @@ -15,4 +15,4 @@ int main(int argc, char** argv) { return EXIT_SUCCESS; } -#endif // YAZE_APPLICATION_CONTROLLER_ENTRYPOINT_H \ No newline at end of file +#endif // YAZE_APP_CONTROLLER_ENTRYPOINT_H \ No newline at end of file diff --git a/src/application/gfx/bitmap.cc b/src/app/gfx/bitmap.cc similarity index 96% rename from src/application/gfx/bitmap.cc rename to src/app/gfx/bitmap.cc index bbb82bdb..21ebf19a 100644 --- a/src/application/gfx/bitmap.cc +++ b/src/app/gfx/bitmap.cc @@ -5,7 +5,7 @@ #include "rom.h" namespace yaze { -namespace application { +namespace app { namespace gfx { int GetPCGfxAddress(char *romData, char id) { @@ -174,5 +174,5 @@ void CreateAllGfxData(char *romData, char *allgfx16Ptr) { } } // namespace gfx -} // namespace application +} // namespace app } // namespace yaze diff --git a/src/application/gfx/bitmap.h b/src/app/gfx/bitmap.h similarity index 79% rename from src/application/gfx/bitmap.h rename to src/app/gfx/bitmap.h index b7132580..04bb47ff 100644 --- a/src/application/gfx/bitmap.h +++ b/src/app/gfx/bitmap.h @@ -1,12 +1,12 @@ -#ifndef YAZE_APPLICATION_UTILS_BITMAP_H -#define YAZE_APPLICATION_UTILS_BITMAP_H +#ifndef YAZE_APP_UTILS_BITMAP_H +#define YAZE_APP_UTILS_BITMAP_H #include #include "Core/constants.h" namespace yaze { -namespace application { +namespace app { namespace gfx { class Bitmap { @@ -31,7 +31,7 @@ char *CreateAllGfxDataRaw(char *romData); void CreateAllGfxData(char *romData, char *allgfx16Ptr); } // namespace gfx -} // namespace application +} // namespace app } // namespace yaze #endif \ No newline at end of file diff --git a/src/application/gfx/palette.cc b/src/app/gfx/palette.cc similarity index 94% rename from src/application/gfx/palette.cc rename to src/app/gfx/palette.cc index ce5ad82c..d3196479 100644 --- a/src/application/gfx/palette.cc +++ b/src/app/gfx/palette.cc @@ -4,7 +4,7 @@ #include namespace yaze { -namespace application { +namespace app { namespace gfx { SNESColor::SNESColor() : rgb(ImVec4(0.f, 0.f, 0.f, 0.f)) {} @@ -109,5 +109,5 @@ SDL_Palette* SNESPalette::GetSDL_Palette() { } } // namespace gfx -} // namespace application +} // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/application/gfx/palette.h b/src/app/gfx/palette.h similarity index 80% rename from src/application/gfx/palette.h rename to src/app/gfx/palette.h index 16a40a6e..4b077e13 100644 --- a/src/application/gfx/palette.h +++ b/src/app/gfx/palette.h @@ -1,5 +1,5 @@ -#ifndef YAZE_APPLICATION_gfx_PALETTE_H -#define YAZE_APPLICATION_gfx_PALETTE_H +#ifndef YAZE_APP_gfx_PALETTE_H +#define YAZE_APP_gfx_PALETTE_H #include #include @@ -12,7 +12,7 @@ #include namespace yaze { -namespace application { +namespace app { namespace gfx { struct SNESColor { @@ -44,7 +44,7 @@ class SNESPalette { }; } // namespace gfx -} // namespace application +} // namespace app } // namespace yaze -#endif // YAZE_APPLICATION_gfx_PALETTE_H \ No newline at end of file +#endif // YAZE_APP_gfx_PALETTE_H \ No newline at end of file diff --git a/src/application/gfx/tile.cc b/src/app/gfx/tile.cc similarity index 95% rename from src/application/gfx/tile.cc rename to src/app/gfx/tile.cc index 038e68eb..a9619e2f 100644 --- a/src/application/gfx/tile.cc +++ b/src/app/gfx/tile.cc @@ -9,7 +9,7 @@ #include namespace yaze { -namespace application { +namespace app { namespace gfx { TilesPattern::TilesPattern() { @@ -109,5 +109,5 @@ std::vector > TilesPattern::transform( } } // namespace gfx -} // namespace application +} // namespace app } // namespace yaze diff --git a/src/application/gfx/tile.h b/src/app/gfx/tile.h similarity index 90% rename from src/application/gfx/tile.h rename to src/app/gfx/tile.h index e1734cca..a82ee790 100644 --- a/src/application/gfx/tile.h +++ b/src/app/gfx/tile.h @@ -1,5 +1,5 @@ -#ifndef YAZE_APPLICATION_DATA_TILE_H -#define YAZE_APPLICATION_DATA_TILE_H +#ifndef YAZE_APP_DATA_TILE_H +#define YAZE_APP_DATA_TILE_H #include @@ -12,7 +12,7 @@ #include "gfx/palette.h" namespace yaze { -namespace application { +namespace app { namespace gfx { // vhopppcc cccccccc @@ -97,7 +97,7 @@ class TilePreset { }; } // namespace gfx -} // namespace application +} // namespace app } // namespace yaze #endif \ No newline at end of file diff --git a/src/application/rom.cc b/src/app/rom.cc similarity index 99% rename from src/application/rom.cc rename to src/app/rom.cc index 2fb2d8d3..f4ad9dd2 100644 --- a/src/application/rom.cc +++ b/src/app/rom.cc @@ -5,7 +5,7 @@ #include "Core/constants.h" namespace yaze { -namespace application { +namespace app { namespace Data { ROM::~ROM() { @@ -292,5 +292,5 @@ int AddressFromBytes(uchar addr1, uchar addr2, uchar addr3) { } } // namespace Data -} // namespace application +} // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/application/rom.h b/src/app/rom.h similarity index 93% rename from src/application/rom.h rename to src/app/rom.h index bdf705f0..cf0dda8e 100644 --- a/src/application/rom.h +++ b/src/app/rom.h @@ -1,5 +1,5 @@ -#ifndef YAZE_APPLICATION_UTILS_ROM_H -#define YAZE_APPLICATION_UTILS_ROM_H +#ifndef YAZE_APP_UTILS_ROM_H +#define YAZE_APP_UTILS_ROM_H #include #include @@ -17,7 +17,7 @@ #include "gfx/tile.h" namespace yaze { -namespace application { +namespace app { namespace Data { int AddressFromBytes(uchar addr1, uchar addr2, uchar addr3); @@ -69,7 +69,7 @@ class ROM { }; } // namespace Data -} // namespace application +} // namespace app } // namespace yaze #endif \ No newline at end of file diff --git a/src/application/zelda3/overworld.cc b/src/app/zelda3/overworld.cc similarity index 99% rename from src/application/zelda3/overworld.cc rename to src/app/zelda3/overworld.cc index 557ac6f7..97332b8b 100644 --- a/src/application/zelda3/overworld.cc +++ b/src/app/zelda3/overworld.cc @@ -4,7 +4,7 @@ #include "rom.h" namespace yaze { -namespace application { +namespace app { namespace Data { using namespace core; @@ -344,5 +344,5 @@ void Overworld::LoadOverworldMap() { } } // namespace Data -} // namespace application +} // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/application/zelda3/overworld.h b/src/app/zelda3/overworld.h similarity index 91% rename from src/application/zelda3/overworld.h rename to src/app/zelda3/overworld.h index 68cb7831..827111dc 100644 --- a/src/application/zelda3/overworld.h +++ b/src/app/zelda3/overworld.h @@ -1,5 +1,5 @@ -#ifndef YAZE_APPLICATION_DATA_OVERWORLD_H -#define YAZE_APPLICATION_DATA_OVERWORLD_H +#ifndef YAZE_APP_DATA_OVERWORLD_H +#define YAZE_APP_DATA_OVERWORLD_H #include @@ -13,7 +13,7 @@ #include "rom.h" namespace yaze { -namespace application { +namespace app { namespace Data { class Overworld { @@ -68,7 +68,7 @@ class Overworld { }; } // namespace Data -} // namespace application +} // namespace app } // namespace yaze #endif \ No newline at end of file diff --git a/src/application/zelda3/overworld_map.cc b/src/app/zelda3/overworld_map.cc similarity index 96% rename from src/application/zelda3/overworld_map.cc rename to src/app/zelda3/overworld_map.cc index 6f01c273..f5032cd7 100644 --- a/src/application/zelda3/overworld_map.cc +++ b/src/app/zelda3/overworld_map.cc @@ -4,7 +4,7 @@ #include "gfx/tile.h" namespace yaze { -namespace application { +namespace app { namespace Data { using namespace core; @@ -355,5 +355,5 @@ void OverworldMap::BuildTileset(int gameState) { } } // namespace Data -} // namespace application +} // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/application/zelda3/overworld_map.h b/src/app/zelda3/overworld_map.h similarity index 94% rename from src/application/zelda3/overworld_map.h rename to src/app/zelda3/overworld_map.h index 8eac04c2..d363ccc2 100644 --- a/src/application/zelda3/overworld_map.h +++ b/src/app/zelda3/overworld_map.h @@ -8,7 +8,7 @@ #include "gfx/tile.h" namespace yaze { -namespace application { +namespace app { namespace Data { using ushort = unsigned short; @@ -73,5 +73,5 @@ class OverworldMap { }; } // namespace Data -} // namespace application +} // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/gui/editor/editor.cc b/src/gui/editor/editor.cc index 2235d105..0344a832 100644 --- a/src/gui/editor/editor.cc +++ b/src/gui/editor/editor.cc @@ -15,7 +15,7 @@ #include "rom.h" namespace yaze { -namespace application { +namespace app { namespace Editor { using namespace core; @@ -521,5 +521,5 @@ void Editor::DrawHUDEditor() { } } // namespace Editor -} // namespace application +} // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/gui/editor/editor.h b/src/gui/editor/editor.h index 749966bc..ebcaeab0 100644 --- a/src/gui/editor/editor.h +++ b/src/gui/editor/editor.h @@ -1,5 +1,5 @@ -#ifndef YAZE_APPLICATION_VIEW_EDITOR_H -#define YAZE_APPLICATION_VIEW_EDITOR_H +#ifndef YAZE_APP_VIEW_EDITOR_H +#define YAZE_APP_VIEW_EDITOR_H #include #include @@ -15,7 +15,7 @@ #include "rom.h" namespace yaze { -namespace application { +namespace app { namespace Editor { class Editor { @@ -68,7 +68,7 @@ class Editor { }; } // namespace Editor -} // namespace application +} // namespace app } // namespace yaze -#endif // YAZE_APPLICATION_VIEW_EDITOR_H \ No newline at end of file +#endif // YAZE_APP_VIEW_EDITOR_H \ No newline at end of file diff --git a/src/gui/editor/overworld_editor.cc b/src/gui/editor/overworld_editor.cc index 57c417de..f3ad427b 100644 --- a/src/gui/editor/overworld_editor.cc +++ b/src/gui/editor/overworld_editor.cc @@ -28,7 +28,7 @@ // have an overworld map viewer, in less than few hours if are able to // understand the data quickly namespace yaze { -namespace application { +namespace app { namespace Editor { void OverworldEditor::SetupROM(Data::ROM &rom) { rom_ = rom; } @@ -378,5 +378,5 @@ void OverworldEditor::Loadgfx() { } } // namespace Editor -} // namespace application +} // namespace app } // namespace yaze \ No newline at end of file diff --git a/src/gui/editor/overworld_editor.h b/src/gui/editor/overworld_editor.h index 6f52b647..85bfab94 100644 --- a/src/gui/editor/overworld_editor.h +++ b/src/gui/editor/overworld_editor.h @@ -1,5 +1,5 @@ -#ifndef YAZE_APPLICATION_EDITOR_OVERWORLDEDITOR_H -#define YAZE_APPLICATION_EDITOR_OVERWORLDEDITOR_H +#ifndef YAZE_APP_EDITOR_OVERWORLDEDITOR_H +#define YAZE_APP_EDITOR_OVERWORLDEDITOR_H #include @@ -10,7 +10,7 @@ namespace yaze { -namespace application { +namespace app { namespace Editor { static constexpr unsigned int k4BPP = 4; @@ -73,7 +73,7 @@ class OverworldEditor { ImGuiTableFlags_SizingStretchSame; }; } // namespace Editor -} // namespace application +} // namespace app } // namespace yaze #endif \ No newline at end of file diff --git a/src/gui/icons.h b/src/gui/icons.h index 82e1f5c3..11748e17 100644 --- a/src/gui/icons.h +++ b/src/gui/icons.h @@ -1696,7 +1696,7 @@ #define ICON_MD_SET_MEAL "\xef\x87\xaa" // U+f1ea #define ICON_MD_SETTINGS "\xee\xa2\xb8" // U+e8b8 #define ICON_MD_SETTINGS_ACCESSIBILITY "\xef\x81\x9d" // U+f05d -#define ICON_MD_SETTINGS_applicationS "\xee\xa2\xb9" // U+e8b9 +#define ICON_MD_SETTINGS_APPLICATIONS "\xee\xa2\xb9" // U+e8b9 #define ICON_MD_SETTINGS_BACKUP_RESTORE "\xee\xa2\xba" // U+e8ba #define ICON_MD_SETTINGS_BLUETOOTH "\xee\xa2\xbb" // U+e8bb #define ICON_MD_SETTINGS_BRIGHTNESS "\xee\xa2\xbd" // U+e8bd diff --git a/src/gui/input.h b/src/gui/input.h index 356f3816..f99c2884 100644 --- a/src/gui/input.h +++ b/src/gui/input.h @@ -1,5 +1,5 @@ -#ifndef YAZE_APPLICATION_CORE_INPUT_H -#define YAZE_APPLICATION_CORE_INPUT_H +#ifndef YAZE_APP_CORE_INPUT_H +#define YAZE_APP_CORE_INPUT_H #include #include diff --git a/src/gui/style.h b/src/gui/style.h index 2a56a196..7f64b582 100644 --- a/src/gui/style.h +++ b/src/gui/style.h @@ -1,5 +1,5 @@ -#ifndef YAZE_APPLICATION_CORE_STYLE_H -#define YAZE_APPLICATION_CORE_STYLE_H +#ifndef YAZE_APP_CORE_STYLE_H +#define YAZE_APP_CORE_STYLE_H #include #include diff --git a/src/yaze.h b/src/yaze.h index d7298d9d..163d5021 100644 --- a/src/yaze.h +++ b/src/yaze.h @@ -1,7 +1,7 @@ #ifndef YAZE_YAZE_H #define YAZE_YAZE_H -#include "application/Core/controller.h" -#include "application/Core/entry_point.h" +#include "app/Core/controller.h" +#include "app/Core/entry_point.h" #endif // YAZE_YAZE_H \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bdce6c02..03e946c8 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,10 +16,10 @@ set(SNESHACKING_PATH "../src/Library/sneshacking/src") add_executable( yaze_test yaze_test.cc - ../src/application/rom.cc - ../src/application/gfx/tile.cc - ../src/application/gfx/tile.cc - ../src/application/gfx/palette.cc + ../src/app/rom.cc + ../src/app/gfx/tile.cc + ../src/app/gfx/tile.cc + ../src/app/gfx/palette.cc ${SNESHACKING_PATH}/compressions/alttpcompression.c ${SNESHACKING_PATH}/compressions/stdnintendo.c ${SNESHACKING_PATH}/tile.c