Files
yaze/src/app/core/features.h
scawful 6374da6194 refactor(gfx): reorganize graphics includes and introduce new types
- Updated include paths for various graphics-related headers to improve organization and clarity.
- Introduced new types for SNES color, palette, and tile management, enhancing the structure of the graphics subsystem.
- Refactored existing code to utilize the new types, ensuring consistency across the codebase.

Benefits:
- Improves maintainability and readability of the graphics code.
- Facilitates future enhancements and optimizations within the graphics subsystem.
2025-10-13 00:09:34 -04:00

126 lines
4.3 KiB
C++

#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