refactor(app): reorganize application structure and update includes

- Moved core components such as `Controller` and `Window` from `src/app/core/` to `src/app/` and `src/app/platform/`, respectively, to improve modularity and clarity.
- Updated include paths across the codebase to reflect the new locations of these components.
- Introduced a new foundational core library in `src/core/` for project management and ROM patching logic, enhancing the separation of concerns.
- Adjusted CMake configurations to ensure proper compilation of the new core library and updated dependencies in various modules.

Benefits:
- Streamlines the application structure, making it easier to navigate and maintain.
- Enhances code organization by clearly delineating core functionalities from application-specific logic.
- Improves overall architecture by promoting a clearer separation of concerns between different components.
This commit is contained in:
scawful
2025-10-15 20:10:04 -04:00
parent 066ffa46e2
commit d45f7819e1
88 changed files with 393 additions and 290 deletions

View File

@@ -1,12 +1,12 @@
#define IMGUI_DEFINE_MATH_OPERATORS
#include "e2e/canvas_selection_test.h"
#include "app/core/controller.h"
#include "app/controller.h"
#include "test_utils.h"
void E2ETest_CanvasSelectionTest(ImGuiTestContext* ctx)
{
yaze::test::gui::LoadRomInTest(ctx, "zelda3.sfc");
yaze::core::Controller* controller = (yaze::core::Controller*)ctx->Test->UserData;
yaze::Controller* controller = (yaze::Controller*)ctx->Test->UserData;
yaze::zelda3::Overworld* overworld = controller->overworld();
// 1. Open the Overworld Editor

View File

@@ -1,6 +1,6 @@
#include "e2e/dungeon_editor_smoke_test.h"
#include "test_utils.h"
#include "app/core/controller.h"
#include "app/controller.h"
#include "imgui_test_engine/imgui_te_context.h"
/**

View File

@@ -56,8 +56,8 @@
#include "imgui_test_engine/imgui_te_engine.h"
#include "imgui_test_engine/imgui_te_ui.h"
#include "app/core/controller.h"
#include "app/core/window.h"
#include "app/controller.h"
#include "app/platform/window.h"
#include "app/editor/dungeon/dungeon_editor_v2.h"
#include "app/rom.h"
#include "zelda3/dungeon/room.h"

View File

@@ -6,7 +6,7 @@
#include "cli/service/ai/gemini_ai_service.h"
#ifdef YAZE_WITH_GRPC
#include "app/core/service/screenshot_utils.h"
#include "app/service/screenshot_utils.h"
#endif
namespace yaze {

View File

@@ -4,7 +4,7 @@
#include <SDL.h>
#include "app/core/window.h"
#include "app/platform/window.h"
#include "app/gui/core/style.h"
#include "imgui/backends/imgui_impl_sdl2.h"
#include "imgui/backends/imgui_impl_sdlrenderer2.h"

View File

@@ -6,8 +6,8 @@
#include "imgui/imgui.h"
#include "app/editor/editor.h"
#include "app/rom.h"
#include "app/core/controller.h"
#include "app/core/window.h"
#include "app/controller.h"
#include "app/platform/window.h"
#include "app/gfx/backend/sdl2_renderer.h"
#ifdef YAZE_ENABLE_IMGUI_TEST_ENGINE
@@ -75,7 +75,7 @@ class EditorIntegrationTest {
absl::Status TestEditorClear(editor::Editor* editor);
private:
core::Controller controller_;
Controller controller_;
#ifdef YAZE_ENABLE_IMGUI_TEST_ENGINE
ImGuiTestEngine* engine_;
bool show_demo_window_;

View File

@@ -11,7 +11,7 @@
#include "app/gfx/core/bitmap.h"
#include "app/gfx/render/tilemap.h"
#include "zelda3/overworld/overworld.h"
#include "app/core/window.h"
#include "app/platform/window.h"
namespace yaze {
namespace editor {

View File

@@ -2,8 +2,8 @@
#include <SDL.h>
#include "app/core/controller.h"
#include "app/core/window.h"
#include "app/controller.h"
#include "app/platform/window.h"
#include "app/gfx/backend/sdl2_renderer.h"
#include "app/gui/core/style.h"
#include "imgui/backends/imgui_impl_sdl2.h"
@@ -55,7 +55,7 @@ void TestEditor::RegisterTests(ImGuiTestEngine* engine) {
// TODO: Fix the window/controller management
int RunIntegrationTest() {
yaze::core::Controller controller;
yaze::Controller controller;
yaze::core::Window window;
// Create renderer for test
auto test_renderer = std::make_unique<yaze::gfx::SDL2Renderer>();

View File

@@ -1,12 +1,12 @@
#include "test_utils.h"
#include "app/core/controller.h"
#include "app/controller.h"
namespace yaze {
namespace test {
namespace gui {
void LoadRomInTest(ImGuiTestContext* ctx, const std::string& rom_path) {
yaze::core::Controller* controller = (yaze::core::Controller*)ctx->Test->UserData;
yaze::Controller* controller = (yaze::Controller*)ctx->Test->UserData;
controller->OnEntry(rom_path);
}

View File

@@ -20,8 +20,8 @@
#include "imgui_test_engine/imgui_te_context.h"
#include "imgui_test_engine/imgui_te_engine.h"
#include "imgui_test_engine/imgui_te_ui.h"
#include "app/core/window.h"
#include "app/core/controller.h"
#include "app/platform/window.h"
#include "app/controller.h"
#include "app/gfx/backend/sdl2_renderer.h"
#include "e2e/canvas_selection_test.h"
#include "e2e/framework_smoke_test.h"
@@ -296,7 +296,7 @@ int main(int argc, char* argv[]) {
ImGui_ImplSDL2_InitForSDLRenderer(window.window_.get(), sdl_renderer);
ImGui_ImplSDLRenderer2_Init(sdl_renderer);
yaze::core::Controller controller;
yaze::Controller controller;
// Setup test engine
ImGuiTestEngine* engine = ImGuiTestEngine_CreateContext();