Add LogToConsole experiment flag

This commit is contained in:
scawful
2024-01-22 21:17:41 -05:00
parent 499818836a
commit 9b3977191d
3 changed files with 17 additions and 9 deletions

View File

@@ -6,6 +6,7 @@
#include <chrono> #include <chrono>
#include <cstdint> #include <cstdint>
#include <functional> #include <functional>
#include <iostream>
#include <memory> #include <memory>
#include <stack> #include <stack>
#include <string> #include <string>
@@ -54,6 +55,9 @@ class ExperimentFlags {
// Save dungeon map edits to the ROM. // Save dungeon map edits to the ROM.
bool kSaveDungeonMaps = false; bool kSaveDungeonMaps = false;
// Log to the console.
bool kLogToConsole = false;
}; };
ExperimentFlags() = default; ExperimentFlags() = default;

View File

@@ -326,6 +326,7 @@ void MasterEditor::DrawFileMenu() {
MenuItem("Backup ROM", "", &backup_rom_); MenuItem("Backup ROM", "", &backup_rom_);
ImGui::Separator(); ImGui::Separator();
Text("Experiment Flags"); Text("Experiment Flags");
Checkbox("Enable console logging", &mutable_flags()->kLogToConsole);
Checkbox("Enable Texture Streaming", Checkbox("Enable Texture Streaming",
&mutable_flags()->kLoadTexturesAsStreaming); &mutable_flags()->kLoadTexturesAsStreaming);
Checkbox("Enable Overworld Sprites", Checkbox("Enable Overworld Sprites",

View File

@@ -986,15 +986,18 @@ void Overworld::LoadExits() {
exit_scroll_mod_y, exit_scroll_mod_x, exit_door_type_1, exit_scroll_mod_y, exit_scroll_mod_x, exit_door_type_1,
exit_door_type_2); exit_door_type_2);
std::cout << "Exit: " << i << " RoomID: " << exit_room_id if (rom()->flags()->kLogToConsole) {
<< " MapID: " << exit_map_id << " VRAM: " << exit_vram std::cout << "Exit: " << i << " RoomID: " << exit_room_id
<< " YScroll: " << exit_y_scroll << " XScroll: " << exit_x_scroll << " MapID: " << exit_map_id << " VRAM: " << exit_vram
<< " YPlayer: " << py << " XPlayer: " << px << " YScroll: " << exit_y_scroll
<< " YCamera: " << exit_y_camera << " XCamera: " << exit_x_camera << " XScroll: " << exit_x_scroll << " YPlayer: " << py
<< " ScrollModY: " << exit_scroll_mod_y << " XPlayer: " << px << " YCamera: " << exit_y_camera
<< " ScrollModX: " << exit_scroll_mod_x << " XCamera: " << exit_x_camera
<< " DoorType1: " << exit_door_type_1 << " ScrollModY: " << exit_scroll_mod_y
<< " DoorType2: " << exit_door_type_2 << std::endl; << " ScrollModX: " << exit_scroll_mod_x
<< " DoorType1: " << exit_door_type_1
<< " DoorType2: " << exit_door_type_2 << std::endl;
}
if (px == 0xFFFF && py == 0xFFFF) { if (px == 0xFFFF && py == 0xFFFF) {
exit.deleted = true; exit.deleted = true;