[Scummvm-git-logs] scummvm master -> b82c1b96e80a5509ffe592838d26339b760bc692

AndywinXp noreply at scummvm.org
Sun May 3 10:35:38 UTC 2026


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:
b82c1b96e8 LASTEXPRESS: Activate ImGui debugger with debugflag only


Commit: b82c1b96e80a5509ffe592838d26339b760bc692
    https://github.com/scummvm/scummvm/commit/b82c1b96e80a5509ffe592838d26339b760bc692
Author: AndywinXp (andywinxp at gmail.com)
Date: 2026-05-03T12:35:30+02:00

Commit Message:
LASTEXPRESS: Activate ImGui debugger with debugflag only

This is consistent with other engines using ImGui

Changed paths:
    engines/lastexpress/debug.cpp
    engines/lastexpress/debug.h
    engines/lastexpress/detection.cpp
    engines/lastexpress/lastexpress.cpp


diff --git a/engines/lastexpress/debug.cpp b/engines/lastexpress/debug.cpp
index 6d852c8ec44..6d112839b2d 100644
--- a/engines/lastexpress/debug.cpp
+++ b/engines/lastexpress/debug.cpp
@@ -71,7 +71,7 @@ void onImGuiRender() {
 	if (_state->_engine->shouldQuit() || _state->_engine->_exitFromMenuButton)
 		return;
 
-	if (!debugChannelSet(-1, kDebugConsole)) {
+	if (!debugChannelSet(-1, kDebugImGui)) {
 		ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange | ImGuiConfigFlags_NoMouse;
 		return;
 	}
diff --git a/engines/lastexpress/debug.h b/engines/lastexpress/debug.h
index c978e384282..188ca4e23ad 100644
--- a/engines/lastexpress/debug.h
+++ b/engines/lastexpress/debug.h
@@ -32,20 +32,8 @@ void onImGuiRender();
 void onImGuiCleanup();
 #endif
 
-enum {
-	kLastExpressDebugGraphics = 1,
-	kLastExpressDebugResource,
-	kLastExpressDebugCursor,
-	kLastExpressDebugSound,
-	kLastExpressDebugSubtitle,
-	kLastExpressDebugSavegame,
-	kLastExpressDebugLogic,
-	kLastExpressDebugScenes,
-	kLastExpressDebugUnknown,
-};
-
 enum LastExpressDebugChannels {
-	kDebugConsole = 0
+	kDebugImGui = 1
 };
 
 class LastExpressEngine;
diff --git a/engines/lastexpress/detection.cpp b/engines/lastexpress/detection.cpp
index 98f6f6695a9..20905a87624 100644
--- a/engines/lastexpress/detection.cpp
+++ b/engines/lastexpress/detection.cpp
@@ -31,15 +31,7 @@ static const PlainGameDescriptor lastExpressGames[] = {
 };
 
 static const DebugChannelDef debugFlagList[] = {
-	{LastExpress::kLastExpressDebugGraphics, "Graphics", "Debug graphics & animation/sequence playback"},
-	{LastExpress::kLastExpressDebugResource, "Resource", "Debug resource management"},
-	{LastExpress::kLastExpressDebugCursor, "Cursor", "Debug cursor handling"},
-	{LastExpress::kLastExpressDebugSound, "Sound", "Debug sound playback"},
-	{LastExpress::kLastExpressDebugSubtitle, "Subtitle", "Debug subtitles"},
-	{LastExpress::kLastExpressDebugSavegame, "Savegame", "Debug savegames"},
-	{LastExpress::kLastExpressDebugLogic, "Logic", "Debug logic"},
-	{LastExpress::kLastExpressDebugScenes, "Scenes", "Debug scenes & hotspots"},
-	{LastExpress::kLastExpressDebugUnknown, "Unknown", "Debug unknown data"},
+	{LastExpress::kDebugImGui, "ImGui", "Enable the ImGui debugger"},
 	DEBUG_CHANNEL_END
 };
 
diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp
index 96ac13f86f2..afb9854fba4 100644
--- a/engines/lastexpress/lastexpress.cpp
+++ b/engines/lastexpress/lastexpress.cpp
@@ -158,8 +158,6 @@ Common::Error LastExpressEngine::run() {
 	_debugger = new Debugger(this);
 	setDebugger(_debugger);
 
-	if (gDebugLevel >= 3)
-		DebugMan.enableDebugChannel(kDebugConsole);
 
 	// Graphics manager
 	_graphicsMan = new GraphicsManager(this);
@@ -208,11 +206,12 @@ Common::Error LastExpressEngine::run() {
 	getGraphicsManager()->initLuminosityValues(dataPixelFormat.rMax() << 11, dataPixelFormat.gMax() << 5, dataPixelFormat.bMax() << 0);
 
 #ifdef USE_IMGUI
-	ImGuiCallbacks callbacks;
-	callbacks.init = onImGuiInit;
-	callbacks.render = onImGuiRender;
-	callbacks.cleanup = onImGuiCleanup;
-	_system->setImGuiCallbacks(callbacks);
+	ImGuiCallbacks imGuiCallbacks;
+	bool drawImGui = debugChannelSet(-1, kDebugImGui);
+	imGuiCallbacks.init = onImGuiInit;
+	imGuiCallbacks.render = drawImGui ? onImGuiRender : nullptr;
+	imGuiCallbacks.cleanup = onImGuiCleanup;
+	_system->setImGuiCallbacks(imGuiCallbacks);
 #endif
 
 	getMessageManager()->setEventHandle(kEventChannelEngine, &LastExpressEngine::engineEventHandlerWrapper);
@@ -225,6 +224,13 @@ Common::Error LastExpressEngine::run() {
 	getMenu()->doEgg(false, kSavegameTypeIndex, 0);
 
 	while (!shouldQuit()) {
+#ifdef USE_IMGUI
+		if (debugChannelSet(-1, kDebugImGui) != drawImGui) {
+			drawImGui = !drawImGui;
+			imGuiCallbacks.render = drawImGui ? onImGuiRender : nullptr;
+			_system->setImGuiCallbacks(imGuiCallbacks);
+		}
+#endif
 		do {
 			getSoundManager()->soundThread();
 			getSubtitleManager()->subThread();
@@ -475,7 +481,7 @@ bool LastExpressEngine::handleEvents() {
 		case Common::EVENT_KEYDOWN:
 			switch (ev.kbd.keycode) {
 			case Common::KEYCODE_F4:
-				if (_navigationEngineIsRunning && gDebugLevel >= 3)
+				if (_navigationEngineIsRunning && debugChannelSet(-1, kDebugImGui))
 					getLogicManager()->doF4();
 
 				break;
@@ -564,7 +570,7 @@ bool LastExpressEngine::handleEvents() {
 
 #ifdef USE_IMGUI
 	// Allow the debugger to pick up the changes...
-	if (gDebugLevel >= 3) {
+	if (debugChannelSet(-1, kDebugImGui)) {
 		_system->updateScreen();
 	} else {
 #endif




More information about the Scummvm-git-logs mailing list