From 92a3ddded21408cbd25cd2eb529059899ec02dfd Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 5 Oct 2025 00:35:47 -0400 Subject: [PATCH] refactor: Update CMake presets and improve MusicEditor initialization - Added binary directory paths to CMake presets for better build organization. - Enhanced the macOS AI preset description to include networking capabilities. - Refactored MusicEditor constructor to remove ROM dependency, simplifying initialization. - Cleaned up unused ROM pointer methods in MusicEditor for improved clarity. --- CMakePresets.json | 8 ++++++-- src/app/core/platform/app_delegate.mm | 2 +- src/app/editor/editor_manager.h | 2 +- src/app/editor/music/music_editor.h | 9 ++------- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 2a633afe..9d709ecc 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -26,6 +26,7 @@ "hidden": true, "description": "Unix/macOS/Linux base with Makefiles", "generator": "Unix Makefiles", + "binaryDir": "${sourceDir}/build", "condition": { "type": "notEquals", "lhs": "${hostSystemName}", @@ -144,14 +145,17 @@ { "name": "mac-ai", "displayName": "macOS AI", - "description": "macOS with AI agent (z3ed + JSON + gRPC)", + "description": "macOS with AI agent (z3ed + JSON + gRPC + networking)", "inherits": "mac-dev", + "binaryDir": "${sourceDir}/build_ai", "cacheVariables": { "Z3ED_AI": "ON", "YAZE_WITH_JSON": "ON", "YAZE_WITH_GRPC": "ON", "YAZE_BUILD_Z3ED": "ON", - "YAZE_BUILD_EMU": "ON" + "YAZE_BUILD_EMU": "ON", + "YAZE_BUILD_TESTS": "ON", + "CMAKE_BUILD_TYPE": "Debug" } }, { diff --git a/src/app/core/platform/app_delegate.mm b/src/app/core/platform/app_delegate.mm index 4a2940b6..8b3b51bc 100644 --- a/src/app/core/platform/app_delegate.mm +++ b/src/app/core/platform/app_delegate.mm @@ -1,7 +1,7 @@ // AppDelegate.mm #import "app/core/platform/app_delegate.h" #import "app/core/controller.h" -#import "app/core/platform/file_dialog.h" +#import "util/file_util.h" #import "app/editor/editor.h" #import "app/rom.h" diff --git a/src/app/editor/editor_manager.h b/src/app/editor/editor_manager.h index 10d3adbd..ecd983aa 100644 --- a/src/app/editor/editor_manager.h +++ b/src/app/editor/editor_manager.h @@ -48,7 +48,7 @@ class EditorSet { : assembly_editor_(rom), dungeon_editor_(rom), graphics_editor_(rom), - music_editor_(rom), + music_editor_(), overworld_editor_(rom), palette_editor_(rom), screen_editor_(rom), diff --git a/src/app/editor/music/music_editor.h b/src/app/editor/music/music_editor.h index 3fba19f1..8b9aac86 100644 --- a/src/app/editor/music/music_editor.h +++ b/src/app/editor/music/music_editor.h @@ -57,7 +57,8 @@ const ImGuiTableFlags music_editor_flags_ = ImGuiTableFlags_SizingFixedFit | */ class MusicEditor : public Editor { public: - MusicEditor(Rom* rom) : Editor(rom), assembly_editor_(rom), apu_(rom->memory_impl()) {} + MusicEditor() : Editor(EditorType::kMusic) {} + void Initialize() override; absl::Status Load() override; absl::Status Save() override { return absl::UnimplementedError("Save"); } @@ -68,12 +69,6 @@ class MusicEditor : public Editor { absl::Status Undo() override { return absl::UnimplementedError("Undo"); } absl::Status Redo() override { return absl::UnimplementedError("Redo"); } absl::Status Find() override { return absl::UnimplementedError("Find"); } - - // Set the ROM pointer - void set_rom(Rom* rom) { rom_ = rom; } - - // Get the ROM pointer - Rom* rom() const { return rom_; } private: // UI Drawing Methods