Reorganize experiment flags

This commit is contained in:
scawful
2024-01-25 20:59:53 -05:00
parent 7231999cf3
commit 39709beb54
2 changed files with 68 additions and 24 deletions

View File

@@ -18,9 +18,6 @@ namespace core {
class ExperimentFlags { class ExperimentFlags {
public: public:
struct Flags { struct Flags {
// Load and render overworld sprites to the screen. Unstable.
bool kDrawOverworldSprites = false;
// Bitmap manager abstraction to manage graphics bin of ROM. // Bitmap manager abstraction to manage graphics bin of ROM.
bool kUseBitmapManager = true; bool kUseBitmapManager = true;
@@ -59,8 +56,23 @@ class ExperimentFlags {
// Log to the console. // Log to the console.
bool kLogToConsole = false; bool kLogToConsole = false;
// Save overworld map edits to the ROM. // Overworld flags
bool kSaveOverworldMaps = false; struct Overworld {
// Load and render overworld sprites to the screen. Unstable.
bool kDrawOverworldSprites = false;
// Save overworld map edits to the ROM.
bool kSaveOverworldMaps = false;
// Save overworld entrances to the ROM.
bool kSaveOverworldEntrances = false;
// Save overworld exits to the ROM.
bool kSaveOverworldExits = false;
// Save overworld properties to the ROM.
bool kSaveOverworldProperties = false;
} overworld;
}; };
ExperimentFlags() = default; ExperimentFlags() = default;

View File

@@ -325,23 +325,43 @@ void MasterEditor::DrawFileMenu() {
if (BeginMenu("Options")) { if (BeginMenu("Options")) {
MenuItem("Backup ROM", "", &backup_rom_); MenuItem("Backup ROM", "", &backup_rom_);
ImGui::Separator(); ImGui::Separator();
Text("Experiment Flags"); if (BeginMenu("Experiment Flags")) {
Checkbox("Enable console logging", &mutable_flags()->kLogToConsole); if (BeginMenu("Overworld Flags")) {
Checkbox("Enable Texture Streaming", Checkbox("Enable Overworld Sprites",
&mutable_flags()->kLoadTexturesAsStreaming); &mutable_flags()->overworld.kDrawOverworldSprites);
Checkbox("Enable Overworld Sprites", ImGui::Separator();
&mutable_flags()->kDrawOverworldSprites); Checkbox("Save Overworld Maps",
Checkbox("Use Bitmap Manager", &mutable_flags()->kUseBitmapManager); &mutable_flags()->overworld.kSaveOverworldMaps);
Checkbox("Log Instructions to Debugger", Checkbox("Save Overworld Entrances",
&mutable_flags()->kLogInstructions); &mutable_flags()->overworld.kSaveOverworldEntrances);
Checkbox("Use New ImGui Input", &mutable_flags()->kUseNewImGuiInput); Checkbox("Save Overworld Exits",
Checkbox("Save All Palettes", &mutable_flags()->kSaveAllPalettes); &mutable_flags()->overworld.kSaveOverworldExits);
Checkbox("Save With Change Queue", Checkbox("Save Overworld Properties",
&mutable_flags()->kSaveWithChangeQueue); &mutable_flags()->overworld.kSaveOverworldProperties);
Checkbox("Draw Dungeon Room Graphics", ImGui::EndMenu();
&mutable_flags()->kDrawDungeonRoomGraphics); }
Checkbox("Save Dungeon Maps", &mutable_flags()->kSaveDungeonMaps);
Checkbox("Save Overworld Maps", &mutable_flags()->kSaveOverworldMaps); if (BeginMenu("Dungeon Flags")) {
Checkbox("Draw Dungeon Room Graphics",
&mutable_flags()->kDrawDungeonRoomGraphics);
ImGui::Separator();
Checkbox("Save Dungeon Maps", &mutable_flags()->kSaveDungeonMaps);
ImGui::EndMenu();
}
Checkbox("Enable console logging", &mutable_flags()->kLogToConsole);
Checkbox("Enable Texture Streaming",
&mutable_flags()->kLoadTexturesAsStreaming);
Checkbox("Use Bitmap Manager", &mutable_flags()->kUseBitmapManager);
Checkbox("Log Instructions to Debugger",
&mutable_flags()->kLogInstructions);
Checkbox("Use New ImGui Input", &mutable_flags()->kUseNewImGuiInput);
Checkbox("Save All Palettes", &mutable_flags()->kSaveAllPalettes);
Checkbox("Save With Change Queue",
&mutable_flags()->kSaveWithChangeQueue);
ImGui::EndMenu();
}
ImGui::EndMenu(); ImGui::EndMenu();
} }
@@ -519,8 +539,20 @@ void MasterEditor::SaveRom() {
status_ = screen_editor_.SaveDungeonMaps(); status_ = screen_editor_.SaveDungeonMaps();
PRINT_IF_ERROR(status_); PRINT_IF_ERROR(status_);
} }
if (flags()->kSaveOverworldMaps) { if (flags()->overworld.kSaveOverworldMaps) {
status_ = overworld_editor_.SaveOverworldMaps(); status_ = overworld_editor_.overworld()->SaveOverworldMaps();
PRINT_IF_ERROR(status_);
}
if (flags()->overworld.kSaveOverworldEntrances) {
status_ = overworld_editor_.overworld()->SaveEntrances();
PRINT_IF_ERROR(status_);
}
if (flags()->overworld.kSaveOverworldExits) {
status_ = overworld_editor_.overworld()->SaveExits();
PRINT_IF_ERROR(status_);
}
if (flags()->overworld.kSaveOverworldProperties) {
status_ = overworld_editor_.overworld()->SaveMapProperties();
PRINT_IF_ERROR(status_); PRINT_IF_ERROR(status_);
} }