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:
@@ -5,8 +5,8 @@
|
||||
#include <string>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/timing.h"
|
||||
#include "app/core/window.h"
|
||||
#include "app/platform/timing.h"
|
||||
#include "app/platform/window.h"
|
||||
#include "app/editor/editor_manager.h"
|
||||
#include "app/gui/core/background_renderer.h"
|
||||
#include "app/gfx/resource/arena.h" // Add include for Arena
|
||||
@@ -18,7 +18,6 @@
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace core {
|
||||
|
||||
absl::Status Controller::OnEntry(std::string filename) {
|
||||
// Create renderer FIRST
|
||||
@@ -125,5 +124,4 @@ void Controller::OnExit() {
|
||||
PRINT_IF_ERROR(ShutdownWindow(window_));
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
} // namespace yaze
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/window.h"
|
||||
#include "app/platform/window.h"
|
||||
#include "app/rom.h"
|
||||
#include "app/editor/editor_manager.h"
|
||||
#include "app/gfx/backend/irenderer.h"
|
||||
@@ -14,7 +14,6 @@
|
||||
int main(int argc, char** argv);
|
||||
|
||||
namespace yaze {
|
||||
namespace core {
|
||||
|
||||
/**
|
||||
* @brief Main controller for the application.
|
||||
@@ -52,7 +51,6 @@ class Controller {
|
||||
std::unique_ptr<gfx::IRenderer> renderer_;
|
||||
};
|
||||
|
||||
} // namespace core
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_CORE_CONTROLLER_H
|
||||
@@ -1,11 +1,27 @@
|
||||
# ==============================================================================
|
||||
# Application Core Library (Platform, Controller, Services)
|
||||
# ==============================================================================
|
||||
# This file defines the application-level core components that were moved
|
||||
# from the monolithic app/core structure. This is distinct from the foundational
|
||||
# yaze_core_lib in src/core/ which handles project management and asar.
|
||||
#
|
||||
# Components:
|
||||
# - ROM management (app/rom.cc)
|
||||
# - Application controller (app/controller.cc)
|
||||
# - Window/platform management (app/platform/)
|
||||
# - gRPC services for AI automation (app/service/)
|
||||
# - Test harness (app/test/)
|
||||
#
|
||||
# Dependencies: yaze_core_lib (foundational), yaze_util, yaze_gfx, SDL2, ImGui
|
||||
# ==============================================================================
|
||||
|
||||
set(
|
||||
YAZE_APP_CORE_SRC
|
||||
core/asar_wrapper.cc
|
||||
app/core/controller.cc
|
||||
app/core/project.cc
|
||||
app/core/window.cc
|
||||
app/controller.cc
|
||||
app/platform/window.cc
|
||||
)
|
||||
|
||||
# Platform-specific sources
|
||||
if (WIN32 OR MINGW OR (UNIX AND NOT APPLE))
|
||||
list(APPEND YAZE_APP_CORE_SRC
|
||||
app/platform/font_loader.cc
|
||||
@@ -26,26 +42,23 @@ if(APPLE)
|
||||
app/platform/font_loader.mm
|
||||
)
|
||||
|
||||
add_library(yaze_core_objcxx OBJECT ${YAZE_APPLE_OBJCXX_SRC})
|
||||
set_target_properties(yaze_core_objcxx PROPERTIES
|
||||
add_library(yaze_app_objcxx OBJECT ${YAZE_APPLE_OBJCXX_SRC})
|
||||
set_target_properties(yaze_app_objcxx PROPERTIES
|
||||
OBJCXX_STANDARD 20
|
||||
OBJCXX_STANDARD_REQUIRED ON
|
||||
)
|
||||
|
||||
target_include_directories(yaze_core_objcxx PUBLIC
|
||||
target_include_directories(yaze_app_objcxx PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/src/app
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${CMAKE_SOURCE_DIR}/src/lib/imgui
|
||||
${CMAKE_SOURCE_DIR}/src/lib/asar/src
|
||||
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar
|
||||
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar-dll-bindings/c
|
||||
${CMAKE_SOURCE_DIR}/incl
|
||||
${SDL2_INCLUDE_DIR}
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
target_link_libraries(yaze_core_objcxx PUBLIC ${ABSL_TARGETS} yaze_util)
|
||||
target_compile_definitions(yaze_core_objcxx PUBLIC MACOS)
|
||||
target_link_libraries(yaze_app_objcxx PUBLIC ${ABSL_TARGETS} yaze_util)
|
||||
target_compile_definitions(yaze_app_objcxx PUBLIC MACOS)
|
||||
|
||||
find_library(COCOA_LIBRARY Cocoa)
|
||||
if(NOT COCOA_LIBRARY)
|
||||
@@ -55,50 +68,39 @@ if(APPLE)
|
||||
endif()
|
||||
|
||||
# ==============================================================================
|
||||
# Yaze Core Library
|
||||
# Application Core Library
|
||||
# ==============================================================================
|
||||
# This library contains core application functionality:
|
||||
# - ROM management
|
||||
# - Project management
|
||||
# - Controller/Window management
|
||||
# - Asar wrapper for assembly
|
||||
# - Platform-specific utilities (file dialogs, fonts, clipboard)
|
||||
# - Widget state capture for testing
|
||||
# - Emulator interface
|
||||
#
|
||||
# Dependencies: yaze_util, yaze_gfx, asar, SDL2
|
||||
# Renamed from old yaze_core_lib to yaze_app_core_lib to distinguish from
|
||||
# the foundational yaze_core_lib in src/core/
|
||||
# ==============================================================================
|
||||
|
||||
add_library(yaze_core_lib STATIC
|
||||
add_library(yaze_app_core_lib STATIC
|
||||
app/rom.cc
|
||||
${YAZE_APP_CORE_SRC}
|
||||
$<$<BOOL:${APPLE}>:$<TARGET_OBJECTS:yaze_core_objcxx>>
|
||||
$<$<BOOL:${APPLE}>:$<TARGET_OBJECTS:yaze_app_objcxx>>
|
||||
)
|
||||
|
||||
target_precompile_headers(yaze_core_lib PRIVATE
|
||||
target_precompile_headers(yaze_app_core_lib PRIVATE
|
||||
"$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/src/yaze_pch.h>"
|
||||
)
|
||||
|
||||
target_include_directories(yaze_core_lib PUBLIC
|
||||
target_include_directories(yaze_app_core_lib PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src
|
||||
${CMAKE_SOURCE_DIR}/src/app
|
||||
${CMAKE_SOURCE_DIR}/src/lib
|
||||
${CMAKE_SOURCE_DIR}/src/lib/imgui
|
||||
${CMAKE_SOURCE_DIR}/src/lib/asar/src
|
||||
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar
|
||||
${CMAKE_SOURCE_DIR}/src/lib/asar/src/asar-dll-bindings/c
|
||||
${CMAKE_SOURCE_DIR}/incl
|
||||
${SDL2_INCLUDE_DIR}
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
|
||||
target_link_libraries(yaze_core_lib PUBLIC
|
||||
target_link_libraries(yaze_app_core_lib PUBLIC
|
||||
yaze_core_lib # NEW foundational core library with project management
|
||||
yaze_util
|
||||
yaze_gfx
|
||||
yaze_zelda3 # Needed for Zelda3Labels in project.cc
|
||||
yaze_zelda3
|
||||
yaze_common
|
||||
ImGui
|
||||
asar-static
|
||||
${ABSL_TARGETS}
|
||||
${SDL_TARGETS}
|
||||
${CMAKE_DL_LIBS}
|
||||
@@ -107,49 +109,53 @@ target_link_libraries(yaze_core_lib PUBLIC
|
||||
# Link nativefiledialog-extended for Windows/Linux file dialogs
|
||||
if(WIN32 OR (UNIX AND NOT APPLE))
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/src/lib/nativefiledialog-extended ${CMAKE_BINARY_DIR}/nfd EXCLUDE_FROM_ALL)
|
||||
target_link_libraries(yaze_core_lib PUBLIC nfd)
|
||||
target_include_directories(yaze_core_lib PUBLIC ${CMAKE_SOURCE_DIR}/src/lib/nativefiledialog-extended/src/include)
|
||||
target_link_libraries(yaze_app_core_lib PUBLIC nfd)
|
||||
target_include_directories(yaze_app_core_lib PUBLIC ${CMAKE_SOURCE_DIR}/src/lib/nativefiledialog-extended/src/include)
|
||||
endif()
|
||||
|
||||
# ==============================================================================
|
||||
# gRPC Services and Test Harness (Optional)
|
||||
# ==============================================================================
|
||||
|
||||
if(YAZE_WITH_GRPC)
|
||||
target_include_directories(yaze_core_lib PRIVATE
|
||||
target_include_directories(yaze_app_core_lib PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/third_party/json/include)
|
||||
target_compile_definitions(yaze_core_lib PRIVATE YAZE_WITH_JSON)
|
||||
target_compile_definitions(yaze_app_core_lib PRIVATE YAZE_WITH_JSON)
|
||||
|
||||
# Add proto definitions for test harness, ROM service, and canvas automation
|
||||
target_add_protobuf(yaze_core_lib
|
||||
target_add_protobuf(yaze_app_core_lib
|
||||
${PROJECT_SOURCE_DIR}/src/protos/imgui_test_harness.proto)
|
||||
target_add_protobuf(yaze_core_lib
|
||||
target_add_protobuf(yaze_app_core_lib
|
||||
${PROJECT_SOURCE_DIR}/src/protos/rom_service.proto)
|
||||
target_add_protobuf(yaze_core_lib
|
||||
target_add_protobuf(yaze_app_core_lib
|
||||
${PROJECT_SOURCE_DIR}/src/protos/canvas_automation.proto)
|
||||
|
||||
# Add test harness implementation
|
||||
target_sources(yaze_core_lib PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/service/imgui_test_harness_service.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/service/imgui_test_harness_service.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/service/screenshot_utils.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/service/screenshot_utils.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/service/widget_discovery_service.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/service/widget_discovery_service.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/testing/test_recorder.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/testing/test_recorder.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/testing/test_script_parser.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/testing/test_script_parser.h
|
||||
# Add service and testing implementation (now in app/service/ and app/test/)
|
||||
target_sources(yaze_app_core_lib PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/imgui_test_harness_service.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/imgui_test_harness_service.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/screenshot_utils.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/screenshot_utils.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/widget_discovery_service.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/widget_discovery_service.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/test/test_recorder.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/test/test_recorder.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/test/test_script_parser.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/test/test_script_parser.h
|
||||
# Add unified gRPC server
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/service/unified_grpc_server.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/core/service/unified_grpc_server.h
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/unified_grpc_server.cc
|
||||
${CMAKE_SOURCE_DIR}/src/app/service/unified_grpc_server.h
|
||||
)
|
||||
|
||||
target_link_libraries(yaze_core_lib PUBLIC
|
||||
target_link_libraries(yaze_app_core_lib PUBLIC
|
||||
grpc++
|
||||
grpc++_reflection
|
||||
)
|
||||
if(YAZE_PROTOBUF_TARGETS)
|
||||
target_link_libraries(yaze_core_lib PUBLIC ${YAZE_PROTOBUF_TARGETS})
|
||||
target_link_libraries(yaze_app_core_lib PUBLIC ${YAZE_PROTOBUF_TARGETS})
|
||||
if(MSVC AND YAZE_PROTOBUF_WHOLEARCHIVE_TARGETS)
|
||||
foreach(_yaze_proto_target IN LISTS YAZE_PROTOBUF_WHOLEARCHIVE_TARGETS)
|
||||
target_link_options(yaze_core_lib PUBLIC /WHOLEARCHIVE:$<TARGET_FILE:${_yaze_proto_target}>)
|
||||
target_link_options(yaze_app_core_lib PUBLIC /WHOLEARCHIVE:$<TARGET_FILE:${_yaze_proto_target}>)
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
@@ -159,10 +165,10 @@ endif()
|
||||
|
||||
# Platform-specific libraries
|
||||
if(APPLE)
|
||||
target_link_libraries(yaze_core_lib PUBLIC ${COCOA_LIBRARY})
|
||||
target_link_libraries(yaze_app_core_lib PUBLIC ${COCOA_LIBRARY})
|
||||
endif()
|
||||
|
||||
set_target_properties(yaze_core_lib PROPERTIES
|
||||
set_target_properties(yaze_app_core_lib PROPERTIES
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
||||
@@ -170,11 +176,11 @@ set_target_properties(yaze_core_lib PROPERTIES
|
||||
|
||||
# Platform-specific compile definitions
|
||||
if(UNIX AND NOT APPLE)
|
||||
target_compile_definitions(yaze_core_lib PRIVATE linux stricmp=strcasecmp)
|
||||
target_compile_definitions(yaze_app_core_lib PRIVATE linux stricmp=strcasecmp)
|
||||
elseif(APPLE)
|
||||
target_compile_definitions(yaze_core_lib PRIVATE MACOS)
|
||||
target_compile_definitions(yaze_app_core_lib PRIVATE MACOS)
|
||||
elseif(WIN32)
|
||||
target_compile_definitions(yaze_core_lib PRIVATE WINDOWS)
|
||||
target_compile_definitions(yaze_app_core_lib PRIVATE WINDOWS)
|
||||
endif()
|
||||
|
||||
message(STATUS "✓ yaze_core_lib library configured")
|
||||
message(STATUS "✓ yaze_app_core_lib library configured (application layer)")
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
#ifndef YAZE_APP_CORE_FEATURES_H
|
||||
#define YAZE_APP_CORE_FEATURES_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace yaze {
|
||||
namespace core {
|
||||
|
||||
/**
|
||||
* @class FeatureFlags
|
||||
* @brief A class to manage experimental feature flags.
|
||||
*/
|
||||
class FeatureFlags {
|
||||
public:
|
||||
struct Flags {
|
||||
// REMOVED: kLogInstructions - DisassemblyViewer is now always enabled
|
||||
// It uses sparse address-map recording (Mesen-style) with zero performance impact
|
||||
// Recording can be disabled per-viewer via UI if needed
|
||||
|
||||
// Flag to enable the saving of all palettes to the Rom.
|
||||
bool kSaveAllPalettes = false;
|
||||
|
||||
// Flag to enable the saving of gfx groups to the rom.
|
||||
bool kSaveGfxGroups = false;
|
||||
|
||||
// Flag to enable the change queue, which could have any anonymous
|
||||
// save routine for the Rom. In practice, just the overworld tilemap
|
||||
// and tile32 save.
|
||||
bool kSaveWithChangeQueue = false;
|
||||
|
||||
// Save dungeon map edits to the Rom.
|
||||
bool kSaveDungeonMaps = false;
|
||||
|
||||
// Save graphics sheet to the Rom.
|
||||
bool kSaveGraphicsSheet = false;
|
||||
|
||||
// Log to the console.
|
||||
bool kLogToConsole = false;
|
||||
|
||||
// Enable performance monitoring and timing.
|
||||
bool kEnablePerformanceMonitoring = true;
|
||||
|
||||
// Enable the new tiered graphics architecture.
|
||||
bool kEnableTieredGfxArchitecture = true;
|
||||
|
||||
// Use NFD (Native File Dialog) instead of bespoke file dialog implementation.
|
||||
#if defined(YAZE_ENABLE_NFD) && YAZE_ENABLE_NFD
|
||||
bool kUseNativeFileDialog = true;
|
||||
#else
|
||||
bool kUseNativeFileDialog = false;
|
||||
#endif
|
||||
|
||||
// Overworld flags
|
||||
struct Overworld {
|
||||
// Load and render overworld sprites to the screen. Unstable.
|
||||
bool kDrawOverworldSprites = false;
|
||||
|
||||
// Save overworld map edits to the Rom.
|
||||
bool kSaveOverworldMaps = true;
|
||||
|
||||
// Save overworld entrances to the Rom.
|
||||
bool kSaveOverworldEntrances = true;
|
||||
|
||||
// Save overworld exits to the Rom.
|
||||
bool kSaveOverworldExits = true;
|
||||
|
||||
// Save overworld items to the Rom.
|
||||
bool kSaveOverworldItems = true;
|
||||
|
||||
// Save overworld properties to the Rom.
|
||||
bool kSaveOverworldProperties = true;
|
||||
|
||||
// Enable custom overworld features for vanilla ROMs or override detection.
|
||||
// If ZSCustomOverworld ASM is already applied, features are auto-enabled.
|
||||
bool kLoadCustomOverworld = false;
|
||||
|
||||
// Apply ZSCustomOverworld ASM patches when upgrading ROM versions.
|
||||
bool kApplyZSCustomOverworldASM = false;
|
||||
} overworld;
|
||||
};
|
||||
|
||||
static Flags &get() {
|
||||
static Flags instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
std::string Serialize() const {
|
||||
std::string result;
|
||||
// REMOVED: kLogInstructions (deprecated)
|
||||
result +=
|
||||
"kSaveAllPalettes: " + std::to_string(get().kSaveAllPalettes) + "\n";
|
||||
result += "kSaveGfxGroups: " + std::to_string(get().kSaveGfxGroups) + "\n";
|
||||
result +=
|
||||
"kSaveWithChangeQueue: " + std::to_string(get().kSaveWithChangeQueue) +
|
||||
"\n";
|
||||
result +=
|
||||
"kSaveDungeonMaps: " + std::to_string(get().kSaveDungeonMaps) + "\n";
|
||||
result += "kLogToConsole: " + std::to_string(get().kLogToConsole) + "\n";
|
||||
result += "kDrawOverworldSprites: " +
|
||||
std::to_string(get().overworld.kDrawOverworldSprites) + "\n";
|
||||
result += "kSaveOverworldMaps: " +
|
||||
std::to_string(get().overworld.kSaveOverworldMaps) + "\n";
|
||||
result += "kSaveOverworldEntrances: " +
|
||||
std::to_string(get().overworld.kSaveOverworldEntrances) + "\n";
|
||||
result += "kSaveOverworldExits: " +
|
||||
std::to_string(get().overworld.kSaveOverworldExits) + "\n";
|
||||
result += "kSaveOverworldItems: " +
|
||||
std::to_string(get().overworld.kSaveOverworldItems) + "\n";
|
||||
result += "kSaveOverworldProperties: " +
|
||||
std::to_string(get().overworld.kSaveOverworldProperties) + "\n";
|
||||
result += "kLoadCustomOverworld: " +
|
||||
std::to_string(get().overworld.kLoadCustomOverworld) + "\n";
|
||||
result += "kApplyZSCustomOverworldASM: " +
|
||||
std::to_string(get().overworld.kApplyZSCustomOverworldASM) + "\n";
|
||||
result += "kUseNativeFileDialog: " +
|
||||
std::to_string(get().kUseNativeFileDialog) + "\n";
|
||||
result += "kEnableTieredGfxArchitecture: " +
|
||||
std::to_string(get().kEnableTieredGfxArchitecture) + "\n";
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace core
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_CORE_FEATURES_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,293 +0,0 @@
|
||||
#ifndef YAZE_APP_CORE_PROJECT_H
|
||||
#define YAZE_APP_CORE_PROJECT_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
#include "app/core/features.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace core {
|
||||
|
||||
/**
|
||||
* @enum ProjectFormat
|
||||
* @brief Supported project file formats
|
||||
*/
|
||||
enum class ProjectFormat {
|
||||
kYazeNative, // .yaze - YAZE native format
|
||||
kZScreamCompat // .zsproj - ZScream compatibility format
|
||||
};
|
||||
|
||||
/**
|
||||
* @struct ProjectMetadata
|
||||
* @brief Enhanced metadata for project tracking
|
||||
*/
|
||||
struct ProjectMetadata {
|
||||
std::string version = "2.0";
|
||||
std::string created_by = "YAZE";
|
||||
std::string created_date;
|
||||
std::string last_modified;
|
||||
std::string yaze_version;
|
||||
std::string description;
|
||||
std::vector<std::string> tags;
|
||||
std::string author;
|
||||
std::string license;
|
||||
|
||||
// ZScream compatibility
|
||||
bool zscream_compatible = false;
|
||||
std::string zscream_version;
|
||||
};
|
||||
|
||||
/**
|
||||
* @struct WorkspaceSettings
|
||||
* @brief Consolidated workspace and UI settings
|
||||
*/
|
||||
struct WorkspaceSettings {
|
||||
// Display settings
|
||||
float font_global_scale = 1.0f;
|
||||
bool dark_mode = true;
|
||||
std::string ui_theme = "default";
|
||||
|
||||
// Layout settings
|
||||
std::string last_layout_preset;
|
||||
std::vector<std::string> saved_layouts;
|
||||
std::string window_layout_data; // ImGui .ini data
|
||||
|
||||
// Editor preferences
|
||||
bool autosave_enabled = true;
|
||||
float autosave_interval_secs = 300.0f; // 5 minutes
|
||||
bool backup_on_save = true;
|
||||
bool show_grid = true;
|
||||
bool show_collision = false;
|
||||
|
||||
// Advanced settings
|
||||
std::map<std::string, std::string> custom_keybindings;
|
||||
std::vector<std::string> recent_files;
|
||||
std::map<std::string, bool> editor_visibility;
|
||||
};
|
||||
|
||||
/**
|
||||
* @struct YazeProject
|
||||
* @brief Modern project structure with comprehensive settings consolidation
|
||||
*/
|
||||
struct YazeProject {
|
||||
// Basic project info
|
||||
ProjectMetadata metadata;
|
||||
std::string name;
|
||||
std::string filepath;
|
||||
ProjectFormat format = ProjectFormat::kYazeNative;
|
||||
|
||||
// ROM and resources
|
||||
std::string rom_filename;
|
||||
std::string rom_backup_folder;
|
||||
std::vector<std::string> additional_roms; // For multi-ROM projects
|
||||
|
||||
// Code and assets
|
||||
std::string code_folder;
|
||||
std::string assets_folder;
|
||||
std::string patches_folder;
|
||||
std::string labels_filename;
|
||||
std::string symbols_filename;
|
||||
|
||||
// Consolidated settings (previously scattered across multiple files)
|
||||
FeatureFlags::Flags feature_flags;
|
||||
WorkspaceSettings workspace_settings;
|
||||
std::unordered_map<std::string, std::unordered_map<std::string, std::string>> resource_labels;
|
||||
|
||||
// Embedded labels flag - when true, resource_labels contains all default Zelda3 labels
|
||||
bool use_embedded_labels = true;
|
||||
|
||||
// Build and deployment
|
||||
std::string build_script;
|
||||
std::string output_folder;
|
||||
std::vector<std::string> build_configurations;
|
||||
|
||||
// Version control integration
|
||||
std::string git_repository;
|
||||
bool track_changes = true;
|
||||
|
||||
// AI Agent Settings
|
||||
struct AgentSettings {
|
||||
std::string ai_provider = "auto"; // auto, gemini, ollama, mock
|
||||
std::string ai_model; // e.g., "gemini-2.5-flash", "llama3:latest"
|
||||
std::string ollama_host = "http://localhost:11434";
|
||||
std::string gemini_api_key; // Optional, can use env var
|
||||
std::string custom_system_prompt; // Path to custom prompt (relative to project)
|
||||
bool use_custom_prompt = false;
|
||||
bool show_reasoning = true;
|
||||
bool verbose = false;
|
||||
int max_tool_iterations = 4;
|
||||
int max_retry_attempts = 3;
|
||||
} agent_settings;
|
||||
|
||||
// ZScream compatibility (for importing existing projects)
|
||||
std::string zscream_project_file; // Path to original .zsproj if importing
|
||||
std::map<std::string, std::string> zscream_mappings; // Field mappings
|
||||
|
||||
// Methods
|
||||
absl::Status Create(const std::string& project_name, const std::string& base_path);
|
||||
absl::Status Open(const std::string& project_path);
|
||||
absl::Status Save();
|
||||
absl::Status SaveAs(const std::string& new_path);
|
||||
absl::Status ImportZScreamProject(const std::string& zscream_project_path);
|
||||
absl::Status ExportForZScream(const std::string& target_path);
|
||||
|
||||
// Settings management
|
||||
absl::Status LoadAllSettings();
|
||||
absl::Status SaveAllSettings();
|
||||
absl::Status ResetToDefaults();
|
||||
|
||||
// Labels management
|
||||
absl::Status InitializeEmbeddedLabels(); // Load all default Zelda3 labels
|
||||
std::string GetLabel(const std::string& resource_type, int id,
|
||||
const std::string& default_value = "") const;
|
||||
|
||||
// Validation and integrity
|
||||
absl::Status Validate() const;
|
||||
std::vector<std::string> GetMissingFiles() const;
|
||||
absl::Status RepairProject();
|
||||
|
||||
// Utilities
|
||||
std::string GetDisplayName() const;
|
||||
std::string GetRelativePath(const std::string& absolute_path) const;
|
||||
std::string GetAbsolutePath(const std::string& relative_path) const;
|
||||
bool IsEmpty() const;
|
||||
|
||||
// Project state
|
||||
bool project_opened() const { return !name.empty() && !filepath.empty(); }
|
||||
|
||||
private:
|
||||
absl::Status LoadFromYazeFormat(const std::string& project_path);
|
||||
absl::Status SaveToYazeFormat();
|
||||
absl::Status ImportFromZScreamFormat(const std::string& project_path);
|
||||
|
||||
#ifdef YAZE_ENABLE_JSON_PROJECT_FORMAT
|
||||
absl::Status LoadFromJsonFormat(const std::string& project_path);
|
||||
absl::Status SaveToJsonFormat();
|
||||
#endif
|
||||
|
||||
void InitializeDefaults();
|
||||
std::string GenerateProjectId() const;
|
||||
};
|
||||
|
||||
/**
|
||||
* @class ProjectManager
|
||||
* @brief Enhanced project management with templates and validation
|
||||
*/
|
||||
class ProjectManager {
|
||||
public:
|
||||
// Project templates
|
||||
struct ProjectTemplate {
|
||||
std::string name;
|
||||
std::string description;
|
||||
std::string icon;
|
||||
YazeProject template_project;
|
||||
};
|
||||
|
||||
static std::vector<ProjectTemplate> GetProjectTemplates();
|
||||
static absl::StatusOr<YazeProject> CreateFromTemplate(
|
||||
const std::string& template_name,
|
||||
const std::string& project_name,
|
||||
const std::string& base_path);
|
||||
|
||||
// Project discovery and management
|
||||
static std::vector<std::string> FindProjectsInDirectory(const std::string& directory);
|
||||
static absl::Status BackupProject(const YazeProject& project);
|
||||
static absl::Status RestoreProject(const std::string& backup_path);
|
||||
|
||||
// Format conversion utilities
|
||||
static absl::Status ConvertProject(const std::string& source_path,
|
||||
const std::string& target_path,
|
||||
ProjectFormat target_format);
|
||||
|
||||
// Validation and repair
|
||||
static absl::Status ValidateProjectStructure(const YazeProject& project);
|
||||
static std::vector<std::string> GetRecommendedFixesForProject(const YazeProject& project);
|
||||
};
|
||||
|
||||
// Compatibility - ResourceLabelManager (still used by ROM class)
|
||||
struct ResourceLabelManager {
|
||||
bool LoadLabels(const std::string& filename);
|
||||
bool SaveLabels();
|
||||
void DisplayLabels(bool* p_open);
|
||||
void EditLabel(const std::string& type, const std::string& key,
|
||||
const std::string& newValue);
|
||||
void SelectableLabelWithNameEdit(bool selected, const std::string& type,
|
||||
const std::string& key,
|
||||
const std::string& defaultValue);
|
||||
std::string GetLabel(const std::string& type, const std::string& key);
|
||||
std::string CreateOrGetLabel(const std::string& type, const std::string& key,
|
||||
const std::string& defaultValue);
|
||||
|
||||
bool labels_loaded_ = false;
|
||||
std::string filename_;
|
||||
struct ResourceType {
|
||||
std::string key_name;
|
||||
std::string display_description;
|
||||
};
|
||||
|
||||
std::unordered_map<std::string, std::unordered_map<std::string, std::string>>
|
||||
labels_;
|
||||
};
|
||||
|
||||
// Compatibility - RecentFilesManager
|
||||
const std::string kRecentFilesFilename = "recent_files.txt";
|
||||
|
||||
class RecentFilesManager {
|
||||
public:
|
||||
// Singleton pattern - get the global instance
|
||||
static RecentFilesManager& GetInstance() {
|
||||
static RecentFilesManager instance;
|
||||
return instance;
|
||||
}
|
||||
|
||||
// Delete copy constructor and assignment operator
|
||||
RecentFilesManager(const RecentFilesManager&) = delete;
|
||||
RecentFilesManager& operator=(const RecentFilesManager&) = delete;
|
||||
|
||||
void AddFile(const std::string& file_path) {
|
||||
// Add a file to the list, avoiding duplicates
|
||||
// Move to front if already exists (MRU - Most Recently Used)
|
||||
auto it = std::find(recent_files_.begin(), recent_files_.end(), file_path);
|
||||
if (it != recent_files_.end()) {
|
||||
recent_files_.erase(it);
|
||||
}
|
||||
recent_files_.insert(recent_files_.begin(), file_path);
|
||||
|
||||
// Limit to 20 most recent files
|
||||
if (recent_files_.size() > 20) {
|
||||
recent_files_.resize(20);
|
||||
}
|
||||
}
|
||||
|
||||
void Save();
|
||||
|
||||
void Load();
|
||||
|
||||
const std::vector<std::string>& GetRecentFiles() const {
|
||||
return recent_files_;
|
||||
}
|
||||
|
||||
void Clear() {
|
||||
recent_files_.clear();
|
||||
}
|
||||
|
||||
private:
|
||||
RecentFilesManager() {
|
||||
Load(); // Load on construction
|
||||
}
|
||||
|
||||
std::string GetFilePath() const;
|
||||
|
||||
std::vector<std::string> recent_files_;
|
||||
};
|
||||
|
||||
} // namespace core
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_CORE_PROJECT_H
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "absl/strings/str_join.h"
|
||||
#include "absl/time/clock.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
#include "app/editor/agent/agent_chat_history_codec.h"
|
||||
#include "app/editor/agent/agent_ui_theme.h"
|
||||
#include "app/editor/agent/agent_chat_history_popup.h"
|
||||
@@ -136,7 +136,7 @@ void AgentChatWidget::SetRomContext(Rom* rom) {
|
||||
|
||||
// Only initialize labels ONCE per ROM instance
|
||||
if (rom && rom->is_loaded() && rom->resource_label() && last_rom_initialized != rom) {
|
||||
core::YazeProject project;
|
||||
project::YazeProject project;
|
||||
project.use_embedded_labels = true;
|
||||
|
||||
auto labels_status = project.InitializeEmbeddedLabels();
|
||||
@@ -2757,7 +2757,7 @@ void AgentChatWidget::CreateNewFileInEditor(const std::string& filename) {
|
||||
}
|
||||
|
||||
void AgentChatWidget::LoadAgentSettingsFromProject(
|
||||
const core::YazeProject& project) {
|
||||
const project::YazeProject& project) {
|
||||
// Load AI provider settings from project
|
||||
agent_config_.ai_provider = project.agent_settings.ai_provider;
|
||||
agent_config_.ai_model = project.agent_settings.ai_model;
|
||||
@@ -2816,7 +2816,7 @@ void AgentChatWidget::LoadAgentSettingsFromProject(
|
||||
}
|
||||
}
|
||||
|
||||
void AgentChatWidget::SaveAgentSettingsToProject(core::YazeProject& project) {
|
||||
void AgentChatWidget::SaveAgentSettingsToProject(project::YazeProject& project) {
|
||||
// Save AI provider settings to project
|
||||
project.agent_settings.ai_provider = agent_config_.ai_provider;
|
||||
project.agent_settings.ai_model = agent_config_.ai_model;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "cli/service/agent/advanced_routing.h"
|
||||
#include "cli/service/agent/agent_pretraining.h"
|
||||
#include "cli/service/agent/prompt_manager.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
|
||||
namespace yaze {
|
||||
|
||||
@@ -254,8 +254,8 @@ public:
|
||||
void UpdateAgentConfig(const AgentConfigState& config);
|
||||
|
||||
// Load agent settings from project
|
||||
void LoadAgentSettingsFromProject(const core::YazeProject& project);
|
||||
void SaveAgentSettingsToProject(core::YazeProject& project);
|
||||
void LoadAgentSettingsFromProject(const project::YazeProject& project);
|
||||
void SaveAgentSettingsToProject(project::YazeProject& project);
|
||||
|
||||
// Collaboration history management (public so EditorManager can call them)
|
||||
void SwitchToSharedHistory(const std::string& session_id);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "absl/strings/match.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "absl/strings/str_split.h"
|
||||
#include "core/project.h"
|
||||
#include "util/file_util.h"
|
||||
#include "app/editor/system/toast_manager.h"
|
||||
#include "app/gui/core/icons.h"
|
||||
@@ -170,7 +171,7 @@ absl::Status ProjectFileEditor::SaveFileAs(const std::string& filepath) {
|
||||
modified_ = false;
|
||||
|
||||
// Add to recent files
|
||||
auto& recent_mgr = core::RecentFilesManager::GetInstance();
|
||||
auto& recent_mgr = project::RecentFilesManager::GetInstance();
|
||||
recent_mgr.AddFile(filepath_);
|
||||
recent_mgr.Save();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
#include "app/gui/widgets/text_editor.h"
|
||||
|
||||
namespace yaze {
|
||||
@@ -20,7 +20,7 @@ class ToastManager;
|
||||
* - Syntax highlighting for INI-style format
|
||||
* - Real-time validation
|
||||
* - Auto-save capability
|
||||
* - Integration with core::YazeProject
|
||||
* - Integration with project::YazeProject
|
||||
*/
|
||||
class ProjectFileEditor {
|
||||
public:
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <iterator>
|
||||
#include <cstring>
|
||||
|
||||
#include "app/core/window.h"
|
||||
#include "app/platform/window.h"
|
||||
#include "app/gfx/resource/arena.h"
|
||||
#include "app/gfx/types/snes_palette.h"
|
||||
#include "app/gui/canvas/canvas.h"
|
||||
|
||||
@@ -83,7 +83,7 @@ endif()
|
||||
# - System editors (settings, commands, extensions)
|
||||
# - Testing infrastructure
|
||||
#
|
||||
# Dependencies: yaze_core_lib, yaze_gfx, yaze_gui, yaze_zelda3, ImGui
|
||||
# Dependencies: yaze_app_core_lib, yaze_gfx, yaze_gui, yaze_zelda3, ImGui
|
||||
# ==============================================================================
|
||||
|
||||
add_library(yaze_editor STATIC ${YAZE_APP_EDITOR_SRC})
|
||||
@@ -103,7 +103,7 @@ target_include_directories(yaze_editor PUBLIC
|
||||
)
|
||||
|
||||
target_link_libraries(yaze_editor PUBLIC
|
||||
yaze_core_lib
|
||||
yaze_app_core_lib
|
||||
yaze_gfx
|
||||
yaze_gui
|
||||
yaze_zelda3
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
#include "absl/strings/match.h"
|
||||
#include "absl/strings/str_cat.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/features.h"
|
||||
#include "app/core/project.h"
|
||||
#include "app/core/timing.h"
|
||||
#include "core/features.h"
|
||||
#include "core/project.h"
|
||||
#include "app/platform/timing.h"
|
||||
#include "app/editor/session_types.h"
|
||||
#include "app/editor/code/assembly_editor.h"
|
||||
#include "app/editor/dungeon/dungeon_editor_v2.h"
|
||||
@@ -65,7 +65,7 @@
|
||||
#include "app/gfx/debug/performance/performance_dashboard.h"
|
||||
|
||||
#ifdef YAZE_WITH_GRPC
|
||||
#include "app/core/service/screenshot_utils.h"
|
||||
#include "app/service/screenshot_utils.h"
|
||||
#include "app/editor/agent/agent_chat_widget.h"
|
||||
#include "app/test/z3ed_test_suite.h"
|
||||
#include "cli/service/agent/agent_control_server.h"
|
||||
@@ -650,7 +650,7 @@ absl::Status EditorManager::Update() {
|
||||
|
||||
// Update timing manager for accurate delta time across the application
|
||||
// This fixes animation timing issues that occur when mouse isn't moving
|
||||
core::TimingManager::Get().Update();
|
||||
TimingManager::Get().Update();
|
||||
|
||||
// Delegate to PopupManager for modal dialog rendering
|
||||
popup_manager_->DrawPopups();
|
||||
@@ -1131,7 +1131,7 @@ absl::Status EditorManager::LoadRom() {
|
||||
test::TestManager::Get().SetCurrentRom(GetCurrentRom());
|
||||
#endif
|
||||
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
manager.AddFile(file_name);
|
||||
manager.Save();
|
||||
|
||||
@@ -1257,7 +1257,7 @@ absl::Status EditorManager::SaveRomAs(const std::string& filename) {
|
||||
sessions_[current_session_idx].filepath = filename;
|
||||
}
|
||||
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
manager.AddFile(filename);
|
||||
manager.Save();
|
||||
}
|
||||
@@ -1327,7 +1327,7 @@ absl::Status EditorManager::OpenProject() {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
core::YazeProject new_project;
|
||||
project::YazeProject new_project;
|
||||
RETURN_IF_ERROR(new_project.Open(file_path));
|
||||
|
||||
// Validate project
|
||||
@@ -1391,7 +1391,7 @@ absl::Status EditorManager::OpenProject() {
|
||||
ImGui::GetIO().FontGlobalScale = user_settings_.prefs().font_global_scale;
|
||||
|
||||
// Add to recent files
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
manager.AddFile(current_project_.filepath);
|
||||
manager.Save();
|
||||
|
||||
@@ -1422,7 +1422,7 @@ absl::Status EditorManager::SaveProject() {
|
||||
user_settings_.prefs().autosave_interval;
|
||||
|
||||
// Save recent files
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
current_project_.workspace_settings.recent_files.clear();
|
||||
for (const auto& file : manager.GetRecentFiles()) {
|
||||
current_project_.workspace_settings.recent_files.push_back(file);
|
||||
@@ -1456,7 +1456,7 @@ absl::Status EditorManager::SaveProjectAs() {
|
||||
auto save_status = current_project_.Save();
|
||||
if (save_status.ok()) {
|
||||
// Add to recent files
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
manager.AddFile(file_path);
|
||||
manager.Save();
|
||||
|
||||
@@ -1474,7 +1474,7 @@ absl::Status EditorManager::SaveProjectAs() {
|
||||
}
|
||||
|
||||
absl::Status EditorManager::ImportProject(const std::string& project_path) {
|
||||
core::YazeProject imported_project;
|
||||
project::YazeProject imported_project;
|
||||
|
||||
if (project_path.ends_with(".zsproj")) {
|
||||
RETURN_IF_ERROR(imported_project.ImportZScreamProject(project_path));
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
#include "app/editor/agent/agent_chat_history_popup.h"
|
||||
#include "app/editor/code/project_file_editor.h"
|
||||
#include "app/editor/system/editor_card_registry.h"
|
||||
@@ -302,7 +302,7 @@ class EditorManager {
|
||||
|
||||
gfx::IRenderer* renderer_ = nullptr;
|
||||
|
||||
core::YazeProject current_project_;
|
||||
project::YazeProject current_project_;
|
||||
EditorDependencies::SharedClipboard shared_clipboard_;
|
||||
std::unique_ptr<PopupManager> popup_manager_;
|
||||
ToastManager toast_manager_;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "absl/strings/str_cat.h"
|
||||
#include "app/gui/core/ui_helpers.h"
|
||||
#include "util/file_util.h"
|
||||
#include "app/core/window.h"
|
||||
#include "app/platform/window.h"
|
||||
#include "app/gfx/resource/arena.h"
|
||||
#include "app/gfx/core/bitmap.h"
|
||||
#include "app/gfx/util/compression.h"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "core/asar_wrapper.h"
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "app/editor/overworld/map_properties.h"
|
||||
#include "app/editor/overworld/entity.h"
|
||||
#include "app/editor/overworld/tile16_editor.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "overworld_entity_renderer.h"
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "app/editor/overworld/entity.h"
|
||||
#include "app/gui/canvas/canvas.h"
|
||||
#include "zelda3/common.h"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "core/asar_wrapper.h"
|
||||
#include "app/gfx/debug/performance/performance_profiler.h"
|
||||
#include "app/core/window.h"
|
||||
#include "app/platform/window.h"
|
||||
#include "app/editor/overworld/entity.h"
|
||||
#include "app/editor/overworld/map_properties.h"
|
||||
#include "app/editor/overworld/tile16_editor.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef YAZE_APP_EDITOR_SESSION_TYPES_H_
|
||||
#define YAZE_APP_EDITOR_SESSION_TYPES_H_
|
||||
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "app/editor/code/assembly_editor.h"
|
||||
#include "app/editor/code/memory_editor.h"
|
||||
#include "app/editor/dungeon/dungeon_editor_v2.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "menu_orchestrator.h"
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "app/editor/editor.h"
|
||||
#include "app/editor/editor_manager.h"
|
||||
#include "app/editor/system/editor_registry.h"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/editor/system/toast_manager.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace editor {
|
||||
@@ -17,7 +17,7 @@ ProjectManager::ProjectManager(ToastManager* toast_manager)
|
||||
absl::Status ProjectManager::CreateNewProject(const std::string& template_name) {
|
||||
if (template_name.empty()) {
|
||||
// Create default project
|
||||
current_project_ = core::YazeProject();
|
||||
current_project_ = project::YazeProject();
|
||||
current_project_.name = "New Project";
|
||||
current_project_.filepath = GenerateProjectFilename("New Project");
|
||||
|
||||
@@ -49,7 +49,7 @@ absl::Status ProjectManager::LoadProjectFromFile(const std::string& filename) {
|
||||
// TODO: Implement actual project loading from JSON/YAML
|
||||
// For now, create a basic project structure
|
||||
|
||||
current_project_ = core::YazeProject();
|
||||
current_project_ = project::YazeProject();
|
||||
current_project_.filepath = filename;
|
||||
current_project_.name = std::filesystem::path(filename).stem().string();
|
||||
|
||||
@@ -223,7 +223,7 @@ absl::Status ProjectManager::CreateFromTemplate(const std::string& template_name
|
||||
// TODO: Implement template-based project creation
|
||||
// This would copy template files and customize them
|
||||
|
||||
current_project_ = core::YazeProject();
|
||||
current_project_ = project::YazeProject();
|
||||
current_project_.name = project_name;
|
||||
current_project_.filepath = GenerateProjectFilename(project_name);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
|
||||
namespace yaze {
|
||||
namespace editor {
|
||||
@@ -41,8 +41,8 @@ class ProjectManager {
|
||||
absl::Status ValidateProject();
|
||||
|
||||
// Project information
|
||||
core::YazeProject& GetCurrentProject() { return current_project_; }
|
||||
const core::YazeProject& GetCurrentProject() const { return current_project_; }
|
||||
project::YazeProject& GetCurrentProject() { return current_project_; }
|
||||
const project::YazeProject& GetCurrentProject() const { return current_project_; }
|
||||
bool HasActiveProject() const { return !current_project_.filepath.empty(); }
|
||||
std::string GetProjectName() const;
|
||||
std::string GetProjectPath() const;
|
||||
@@ -53,7 +53,7 @@ class ProjectManager {
|
||||
const std::string& project_name);
|
||||
|
||||
private:
|
||||
core::YazeProject current_project_;
|
||||
project::YazeProject current_project_;
|
||||
ToastManager* toast_manager_ = nullptr;
|
||||
|
||||
// Helper methods
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "app/editor/ui/ui_coordinator.h"
|
||||
#include "app/editor/ui/workspace_manager.h"
|
||||
#include "app/editor/system/popup_manager.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
|
||||
namespace yaze::editor {
|
||||
|
||||
@@ -164,7 +164,7 @@ void ConfigureEditorShortcuts(const ShortcutDependencies& deps,
|
||||
RegisterIfValid(shortcut_manager, "Load Last ROM",
|
||||
{ImGuiMod_Ctrl, ImGuiKey_R},
|
||||
[editor_manager]() {
|
||||
auto& recent = core::RecentFilesManager::GetInstance();
|
||||
auto& recent = project::RecentFilesManager::GetInstance();
|
||||
if (!recent.GetRecentFiles().empty() && editor_manager) {
|
||||
editor_manager->OpenRomOrProject(
|
||||
recent.GetRecentFiles().front());
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
#include "app/editor/editor.h"
|
||||
#include "app/editor/editor_manager.h"
|
||||
#include "app/editor/system/editor_registry.h"
|
||||
@@ -706,7 +706,7 @@ void UICoordinator::DrawGlobalSearch() {
|
||||
// Recent Files Tab
|
||||
if (ImGui::BeginTabItem(
|
||||
absl::StrFormat("%s Recent Files", ICON_MD_HISTORY).c_str())) {
|
||||
auto& manager = core::RecentFilesManager::GetInstance();
|
||||
auto& manager = project::RecentFilesManager::GetInstance();
|
||||
auto recent_files = manager.GetRecentFiles();
|
||||
|
||||
if (ImGui::BeginTable("RecentFilesTable", 3,
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "absl/time/clock.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "app/core/project.h"
|
||||
#include "app/core/timing.h"
|
||||
#include "core/project.h"
|
||||
#include "app/platform/timing.h"
|
||||
#include "app/gui/core/icons.h"
|
||||
#include "app/gui/core/theme_manager.h"
|
||||
#include "imgui/imgui.h"
|
||||
@@ -255,7 +255,7 @@ bool WelcomeScreen::Show(bool* p_open) {
|
||||
|
||||
// Smooth interpolation to target position (faster response)
|
||||
// Use TimingManager for accurate delta time
|
||||
float lerp_speed = 8.0f * yaze::core::TimingManager::Get().GetDeltaTime();
|
||||
float lerp_speed = 8.0f * yaze::TimingManager::Get().GetDeltaTime();
|
||||
triforce_positions_[i].x += (target_pos.x - triforce_positions_[i].x) * lerp_speed;
|
||||
triforce_positions_[i].y += (target_pos.y - triforce_positions_[i].y) * lerp_speed;
|
||||
|
||||
@@ -424,7 +424,7 @@ void WelcomeScreen::RefreshRecentProjects() {
|
||||
recent_projects_.clear();
|
||||
|
||||
// Use the ProjectManager singleton to get recent files
|
||||
auto& recent_files = core::RecentFilesManager::GetInstance().GetRecentFiles();
|
||||
auto& recent_files = project::RecentFilesManager::GetInstance().GetRecentFiles();
|
||||
|
||||
for (const auto& filepath : recent_files) {
|
||||
if (recent_projects_.size() >= kMaxRecentProjects) break;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "util/log.h"
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
|
||||
#include "app/emu/audio/internal/opcodes.h"
|
||||
#include "app/emu/audio/internal/spc700_accurate_cycles.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "app/emu/cpu/internal/opcodes.h"
|
||||
#include "app/emu/debug/disassembly_viewer.h"
|
||||
#include "util/log.h"
|
||||
|
||||
@@ -29,7 +29,7 @@ target_include_directories(yaze_emulator PUBLIC
|
||||
target_link_libraries(yaze_emulator PUBLIC
|
||||
yaze_util
|
||||
yaze_common
|
||||
yaze_core_lib
|
||||
yaze_app_core_lib
|
||||
${ABSL_TARGETS}
|
||||
${SDL_TARGETS}
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
|
||||
#include "app/core/window.h"
|
||||
#include "app/platform/window.h"
|
||||
#include "app/editor/system/editor_card_registry.h"
|
||||
#include "util/log.h"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef YAZE_APP_GUI_FEATURE_FLAGS_MENU_H
|
||||
#define YAZE_APP_GUI_FEATURE_FLAGS_MENU_H
|
||||
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
namespace yaze {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
|
||||
#include "app/core/timing.h"
|
||||
#include "app/platform/timing.h"
|
||||
#include "app/gui/core/theme_manager.h"
|
||||
#include "imgui/imgui.h"
|
||||
|
||||
@@ -24,7 +24,7 @@ void BackgroundRenderer::RenderDockingBackground(ImDrawList* draw_list, const Im
|
||||
const ImVec2& window_size, const Color& theme_color) {
|
||||
if (!draw_list) return;
|
||||
|
||||
UpdateAnimation(core::TimingManager::Get().GetDeltaTime());
|
||||
UpdateAnimation(TimingManager::Get().GetDeltaTime());
|
||||
|
||||
// Get current theme colors
|
||||
auto& theme_manager = ThemeManager::Get();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "zelda3/dungeon/room.h"
|
||||
#include "zelda3/dungeon/room_object.h"
|
||||
#include "app/gui/automation/widget_auto_register.h"
|
||||
#include "app/core/window.h"
|
||||
#include "app/platform/window.h"
|
||||
#include <cstdio>
|
||||
|
||||
namespace yaze {
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#include "absl/debugging/failure_signal_handler.h"
|
||||
#include "absl/debugging/symbolize.h"
|
||||
#include "app/core/controller.h"
|
||||
#include "app/core/features.h"
|
||||
#include "app/controller.h"
|
||||
#include "core/features.h"
|
||||
#include "util/flag.h"
|
||||
#include "util/log.h"
|
||||
|
||||
#ifdef YAZE_WITH_GRPC
|
||||
#include "app/core/service/imgui_test_harness_service.h"
|
||||
#include "app/service/imgui_test_harness_service.h"
|
||||
#include "app/test/test_manager.h"
|
||||
#endif
|
||||
|
||||
@@ -129,7 +129,7 @@ int main(int argc, char **argv) {
|
||||
SDL_SetMainReady();
|
||||
#endif
|
||||
|
||||
auto controller = std::make_unique<core::Controller>();
|
||||
auto controller = std::make_unique<Controller>();
|
||||
EXIT_IF_ERROR(controller->OnEntry(rom_filename))
|
||||
|
||||
// Set startup editor and cards from flags (after OnEntry initializes editor manager)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#endif
|
||||
|
||||
#import "app/platform/app_delegate.h"
|
||||
#import "app/core/controller.h"
|
||||
#import "app/controller.h"
|
||||
#import "util/file_util.h"
|
||||
#import "app/editor/editor.h"
|
||||
#import "app/rom.h"
|
||||
@@ -253,7 +253,7 @@ extern "C" void yaze_initialize_cococa() {
|
||||
|
||||
extern "C" int yaze_run_cocoa_app_delegate(const char *filename) {
|
||||
yaze_initialize_cococa();
|
||||
auto controller = std::make_unique<yaze::core::Controller>();
|
||||
auto controller = std::make_unique<yaze::Controller>();
|
||||
EXIT_IF_ERROR(controller->OnEntry(filename));
|
||||
while (controller->IsActive()) {
|
||||
@autoreleasepool {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
|
||||
#if defined(YAZE_ENABLE_NFD) && YAZE_ENABLE_NFD
|
||||
#include <nfd.h>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include <cstdint>
|
||||
|
||||
namespace yaze {
|
||||
namespace core {
|
||||
|
||||
/**
|
||||
* @class TimingManager
|
||||
@@ -112,7 +111,6 @@ class TimingManager {
|
||||
TimingManager& operator=(const TimingManager&) = delete;
|
||||
};
|
||||
|
||||
} // namespace core
|
||||
} // namespace yaze
|
||||
|
||||
#endif // YAZE_APP_CORE_TIMING_H
|
||||
@@ -7,13 +7,13 @@
|
||||
#if TARGET_OS_OSX
|
||||
#ifdef __OBJC__
|
||||
@interface AppViewController : NSViewController <NSWindowDelegate>
|
||||
@property(nonatomic) yaze::core::Controller *controller;
|
||||
@property(nonatomic) yaze::Controller *controller;
|
||||
@end
|
||||
#endif
|
||||
#else
|
||||
#ifdef __OBJC__
|
||||
@interface AppViewController : UIViewController <MTKViewDelegate>
|
||||
@property(nonatomic) yaze::core::Controller *controller;
|
||||
@property(nonatomic) yaze::Controller *controller;
|
||||
@property(nonatomic) UIHoverGestureRecognizer *hoverGestureRecognizer;
|
||||
@property(nonatomic) UIPinchGestureRecognizer *pinchRecognizer;
|
||||
@property(nonatomic) UISwipeGestureRecognizer *swipeRecognizer;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "app/core/window.h"
|
||||
#include "app/platform/window.h"
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "absl/strings/str_cat.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "app/gfx/util/compression.h"
|
||||
#include "app/gfx/types/snes_color.h"
|
||||
#include "app/gfx/types/snes_palette.h"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "absl/status/statusor.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "app/core/project.h"
|
||||
#include "core/project.h"
|
||||
#include "app/gfx/core/bitmap.h"
|
||||
#include "app/gfx/types/snes_color.h"
|
||||
#include "app/gfx/types/snes_palette.h"
|
||||
@@ -220,7 +220,7 @@ class Rom {
|
||||
return palette_groups_.dungeon_main.mutable_palette(i);
|
||||
}
|
||||
|
||||
core::ResourceLabelManager* resource_label() { return &resource_label_manager_; }
|
||||
project::ResourceLabelManager* resource_label() { return &resource_label_manager_; }
|
||||
zelda3_version_pointers version_constants() const {
|
||||
return kVersionConstantsMap.at(version_);
|
||||
}
|
||||
@@ -250,7 +250,7 @@ class Rom {
|
||||
std::vector<uint8_t> graphics_buffer_;
|
||||
|
||||
// Label manager for unique resource names.
|
||||
core::ResourceLabelManager resource_label_manager_;
|
||||
project::ResourceLabelManager resource_label_manager_;
|
||||
|
||||
// All palette groups in the game
|
||||
gfx::PaletteGroupMap palette_groups_;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "app/core/service/canvas_automation_service.h"
|
||||
#include "app/service/canvas_automation_service.h"
|
||||
|
||||
#ifdef YAZE_WITH_GRPC
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "app/core/service/imgui_test_harness_service.h"
|
||||
#include "app/service/imgui_test_harness_service.h"
|
||||
|
||||
#ifdef YAZE_WITH_GRPC
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
#include "absl/time/time.h"
|
||||
#include "protos/imgui_test_harness.grpc.pb.h"
|
||||
#include "protos/imgui_test_harness.pb.h"
|
||||
#include "app/core/service/screenshot_utils.h"
|
||||
#include "app/core/testing/test_script_parser.h"
|
||||
#include "app/service/screenshot_utils.h"
|
||||
#include "app/test/test_script_parser.h"
|
||||
#include "app/test/test_manager.h"
|
||||
#include "yaze.h" // For YAZE_VERSION_STRING
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
#include "absl/status/status.h"
|
||||
#include "absl/status/statusor.h"
|
||||
#include "app/core/service/widget_discovery_service.h"
|
||||
#include "app/core/testing/test_recorder.h"
|
||||
#include "app/service/widget_discovery_service.h"
|
||||
#include "app/test/test_recorder.h"
|
||||
|
||||
// Undefine Windows macros that conflict with protobuf generated code
|
||||
#ifdef _WIN32
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "app/core/service/screenshot_utils.h"
|
||||
#include "app/service/screenshot_utils.h"
|
||||
|
||||
#ifdef YAZE_WITH_GRPC
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "app/core/service/unified_grpc_server.h"
|
||||
#include "app/service/unified_grpc_server.h"
|
||||
|
||||
#ifdef YAZE_WITH_GRPC
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include <thread>
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/core/service/imgui_test_harness_service.h"
|
||||
#include "app/core/service/canvas_automation_service.h"
|
||||
#include "app/service/imgui_test_harness_service.h"
|
||||
#include "app/service/canvas_automation_service.h"
|
||||
#include "app/net/rom_service_impl.h"
|
||||
#include "app/rom.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "app/core/service/widget_discovery_service.h"
|
||||
#include "app/service/widget_discovery_service.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdint>
|
||||
@@ -13,9 +13,9 @@
|
||||
#include "absl/synchronization/mutex.h"
|
||||
#include "absl/time/clock.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "app/core/service/screenshot_utils.h"
|
||||
#include "app/service/screenshot_utils.h"
|
||||
#include "app/gui/automation/widget_state_capture.h"
|
||||
#include "app/core/features.h"
|
||||
#include "core/features.h"
|
||||
#include "util/file_util.h"
|
||||
#include "app/gfx/resource/arena.h"
|
||||
#include "app/gui/core/icons.h"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "app/core/testing/test_recorder.h"
|
||||
#include "app/test/test_recorder.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "absl/time/clock.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "app/core/testing/test_script_parser.h"
|
||||
#include "app/test/test_script_parser.h"
|
||||
#include "app/test/test_manager.h"
|
||||
|
||||
namespace yaze {
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "app/core/testing/test_script_parser.h"
|
||||
#include "app/test/test_script_parser.h"
|
||||
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
Reference in New Issue
Block a user