[Scummvm-git-logs] scummvm master -> 82efafc98462655ac954209a3b3d9915247acc49

AndywinXp noreply at scummvm.org
Fri Jun 27 08:06:52 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
82efafc984 LASTEXPRESS: DEBUGGER: Add Global Variables viewer


Commit: 82efafc98462655ac954209a3b3d9915247acc49
    https://github.com/scummvm/scummvm/commit/82efafc98462655ac954209a3b3d9915247acc49
Author: AndywinXp (andywinxp at gmail.com)
Date: 2025-06-27T10:06:46+02:00

Commit Message:
LASTEXPRESS: DEBUGGER: Add Global Variables viewer

Changed paths:
    engines/lastexpress/debug.cpp
    engines/lastexpress/game/logic.h


diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp
index 722d6d2b220..7d1ad74cef8 100644
--- a/engines/lastexpress/debug.cpp
+++ b/engines/lastexpress/debug.cpp
@@ -54,6 +54,7 @@ typedef struct ImGuiState {
 	float _rightTopPanelHeight = 0.0f;
 	int _ticksToAdvance = 0;
 	ImTextureID _textureID = nullptr;
+	int _selectedGlobalVarRow = -1;
 } ImGuiState;
 
 ImGuiState *_state = nullptr;
@@ -177,6 +178,11 @@ void onImGuiRender() {
 					ImGui::EndTabItem();
 				}
 
+				if (ImGui::BeginTabItem("Global Vars")) {
+					_state->_currentTab = 4;
+					ImGui::EndTabItem();
+				}
+
 				ImGui::EndTabBar();
 			}
 
@@ -203,6 +209,9 @@ void onImGuiRender() {
 			case 3: // Current Scene
 				_state->_engine->getLogicManager()->renderCurrentSceneDebugger();
 				break;
+			case 4: // Global Vars
+				_state->_engine->getLogicManager()->renderGlobalVars();
+				break;
 			default:
 				break;
 			}
@@ -668,6 +677,102 @@ void LogicManager::renderCurrentSceneDebugger() {
 	}
 }
 
+void LogicManager::renderGlobalVars() {
+	_state->_selectedGlobalVarRow = -1;
+
+	if (ImGui::BeginTable("GlobalVars", 3, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_Resizable)) {
+		ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_WidthFixed, 40.0f);
+		ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed, 400.0f);
+		ImGui::TableSetupColumn("Value", ImGuiTableColumnFlags_WidthStretch);
+		ImGui::TableHeadersRow();
+
+		const char *globalNames[58] = {
+			"",
+			"Jacket",
+			"CorpseMovedFromFloor",
+			"ReadLetterInAugustSuitcase",
+			"FoundCorpse",
+			"CharacterSearchingForCath",
+			"PhaseOfTheNight",
+			"CathIcon",
+			"CorpseHasBeenThrown",
+			"FrancoisHasSeenCorpseThrown",
+			"AnnaIsEating",
+			"Chapter",
+			"DoneSavePointAfterLeftCompWithNewJacket",
+			"MetAugust",
+			"IsDayTime",
+			"PoliceHasBoardedAndGone",
+			"ConcertIsHappening",
+			"KahinaKillTimeoutActive",
+			"MaxHasToStayInBaggage",
+			"UnknownDebugFlag",
+			"TrainIsRunning",
+			"AnnaIsInBaggageCar",
+			"DoneSavePointAfterLeavingSuitcaseInCathComp",
+			"TatianaFoundOutEggStolen",
+			"OverheardAugustInterruptingAnnaAtDinner",
+			"MetTatianaAndVassili",
+			"OverheardTatianaAndAlexeiAtBreakfast",
+			"KnowAboutAugust",
+			"KnowAboutKronos",
+			"EggIsOpen",
+			"CanPlayKronosSuitcaseLeftInCompMusic",
+			"CanPlayEggSuitcaseMusic",
+			"CanPlayEggUnderSinkMusic",
+			"CathInSpecialState",
+			"OverheardAlexeiTellingTatianaAboutBomb",
+			"OverheardAlexeiTellingTatianaAboutWantingToKillVassili",
+			"OverheardTatianaAndAlexeiPlayingChess",
+			"OverheardMilosAndVesnaConspiring",
+			"OverheardVesnaAndMilosDebatingAboutCath",
+			"FrancoisSawABlackBeetle",
+			"OverheardMadameAndFrancoisTalkingAboutWhistle",
+			"MadameDemandedMaxInBaggage",
+			"MadameComplainedAboutMax",
+			"MetMadame",
+			"KnowAboutRebeccaDiary",
+			"OverheardSophieTalkingAboutCath",
+			"MetSophieAndRebecca",
+			"KnowAboutRebeccaAndSophieRelationship",
+			"RegisteredTimeAtWhichCathGaveFirebirdToKronos",
+			"MetMahmud",
+			"AlmostFallActionIsAvailable",
+			"MetMilos",
+			"MetMonsieur",
+			"MetHadija",
+			"MetYasmin",
+			"MetAlouan",
+			"MetFatima",
+			"TatianaScheduledToVisitCath"
+		};
+
+		for (int i = 1; i < 58; i++) {
+			ImGui::TableNextRow();
+
+			// Make the entire row selectable, so I don't have to buy new glasses to see the name of the variable...
+			ImGui::TableSetColumnIndex(0);
+			bool isSelected = (_state->_selectedGlobalVarRow == i);
+			if (ImGui::Selectable(("##row" + Common::String(i)).c_str(), isSelected, ImGuiSelectableFlags_SpanAllColumns)) {
+				_state->_selectedGlobalVarRow = i;
+			}
+
+			ImGui::SameLine();
+
+			ImGui::TableSetColumnIndex(0);
+			ImGui::Text("%d", i);
+
+			ImGui::TableSetColumnIndex(1);
+			ImGui::Text("%s", globalNames[i]);	
+
+			ImGui::TableSetColumnIndex(2);
+			ImGui::Text("%d", _globals[i]);
+		}
+
+		ImGui::EndTable();
+	}
+}
+
 Common::StringArray LogicManager::getCharacterFunctionNames(int character) {
 	return _engine->isDemo() ? _demoFuncNames[character] : _funcNames[character];
 }
diff --git a/engines/lastexpress/game/logic.h b/engines/lastexpress/game/logic.h
index dd17aad2763..91bbab234a8 100644
--- a/engines/lastexpress/game/logic.h
+++ b/engines/lastexpress/game/logic.h
@@ -215,6 +215,7 @@ public:
 	void renderCharacterGrid(bool onlyPinned, int &selectedCharacter);
 	void renderCharacterList(int &selectedCharacter);
 	void renderCurrentSceneDebugger();
+	void renderGlobalVars();
 
 	Common::StringArray getCharacterFunctionNames(int character);
 




More information about the Scummvm-git-logs mailing list