[Scummvm-git-logs] scummvm branch-2-9 -> 1820c978ea6e851277682460fee57798bba1886a

lephilousophe noreply at scummvm.org
Sat Dec 28 12:59:05 UTC 2024


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

Summary:
3d09d21ae0 BACKENDS: SDL: Call ImGui callback functions when changing them
7ce3ca007e DIRECTOR: Cleanup ImGui callbacks after running
44db6fde27 QDENGINE: Cleanup ImGui callbacks after running
01dba600e3 TWINE: Cleanup ImGui callbacks after running
1820c978ea TWP: Cleanup ImGui callbacks after running


Commit: 3d09d21ae0c43214bbbc324ee02e3b74dfd11bcd
    https://github.com/scummvm/scummvm/commit/3d09d21ae0c43214bbbc324ee02e3b74dfd11bcd
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-12-28T13:58:03+01:00

Commit Message:
BACKENDS: SDL: Call ImGui callback functions when changing them

This ensures a good cleanup and init when switching.

Changed paths:
    backends/graphics/sdl/sdl-graphics.cpp
    backends/graphics/sdl/sdl-graphics.h


diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 8de597a29e4..e2fd1e9342a 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -552,6 +552,26 @@ Common::Keymap *SdlGraphicsManager::getKeymap() {
 }
 
 #if defined(USE_IMGUI) && SDL_VERSION_ATLEAST(2, 0, 0)
+void SdlGraphicsManager::setImGuiCallbacks(const ImGuiCallbacks &callbacks) {
+	if (_imGuiInited) {
+		if (_imGuiCallbacks.cleanup) {
+			_imGuiCallbacks.cleanup();
+		}
+		_imGuiInited = false;
+	}
+
+	_imGuiCallbacks = callbacks;
+
+	if (!_imGuiReady) {
+		return;
+	}
+
+	if (_imGuiCallbacks.init) {
+		_imGuiCallbacks.init();
+	}
+	_imGuiInited = true;
+}
+
 void SdlGraphicsManager::initImGui(SDL_Renderer *renderer, void *glContext) {
 	assert(!_imGuiReady);
 	_imGuiInited = false;
@@ -613,8 +633,8 @@ void SdlGraphicsManager::initImGui(SDL_Renderer *renderer, void *glContext) {
 
 	if (_imGuiCallbacks.init) {
 		_imGuiCallbacks.init();
-		_imGuiInited = true;
 	}
+	_imGuiInited = true;
 }
 
 void SdlGraphicsManager::renderImGui() {
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index 17a3bfde115..af5d76514f6 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -210,7 +210,7 @@ private:
 
 #if defined(USE_IMGUI) && SDL_VERSION_ATLEAST(2, 0, 0)
 public:
-	void setImGuiCallbacks(const ImGuiCallbacks &callbacks) override { _imGuiCallbacks = callbacks; }
+	void setImGuiCallbacks(const ImGuiCallbacks &callbacks) override;
 
 protected:
 	ImGuiCallbacks _imGuiCallbacks;


Commit: 7ce3ca007ee556630c1b9082edc8ef1f31a56dfe
    https://github.com/scummvm/scummvm/commit/7ce3ca007ee556630c1b9082edc8ef1f31a56dfe
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-12-28T13:58:03+01:00

Commit Message:
DIRECTOR: Cleanup ImGui callbacks after running

Changed paths:
    engines/director/director.cpp


diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index 97ed9d5fe27..ef49735a1bb 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -332,6 +332,10 @@ Common::Error DirectorEngine::run() {
 #endif
 	}
 
+#ifdef USE_IMGUI
+	_system->setImGuiCallbacks(ImGuiCallbacks());
+#endif
+
 	return Common::kNoError;
 }
 


Commit: 44db6fde2742bc8a4bfd9ba7fb118e83fb08a00d
    https://github.com/scummvm/scummvm/commit/44db6fde2742bc8a4bfd9ba7fb118e83fb08a00d
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-12-28T13:58:03+01:00

Commit Message:
QDENGINE: Cleanup ImGui callbacks after running

Changed paths:
    engines/qdengine/qdengine.cpp


diff --git a/engines/qdengine/qdengine.cpp b/engines/qdengine/qdengine.cpp
index 80ea714be15..02e9b69dab3 100644
--- a/engines/qdengine/qdengine.cpp
+++ b/engines/qdengine/qdengine.cpp
@@ -324,6 +324,10 @@ Common::Error QDEngineEngine::run() {
 		g_system->delayMillis(10);
 	}
 
+#ifdef USE_IMGUI
+	_system->setImGuiCallbacks(ImGuiCallbacks());
+#endif
+
 	delete _gameD;
 
 	grDispatcher::instance()->finit();


Commit: 01dba600e36a324240134d57dac96b62eb64b5b3
    https://github.com/scummvm/scummvm/commit/01dba600e36a324240134d57dac96b62eb64b5b3
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-12-28T13:58:03+01:00

Commit Message:
TWINE: Cleanup ImGui callbacks after running

Changed paths:
    engines/twine/twine.cpp


diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 03c27e1c83d..78912b5e46c 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -337,6 +337,10 @@ Common::Error TwinEEngine::run() {
 		if (saveSlot >= 0 && saveSlot <= 999) {
 			Common::Error state = loadGameState(saveSlot);
 			if (state.getCode() != Common::kNoError) {
+#ifdef USE_IMGUI
+				_system->setImGuiCallbacks(ImGuiCallbacks());
+#endif
+
 				return state;
 			}
 		}
@@ -415,6 +419,11 @@ Common::Error TwinEEngine::run() {
 
 	_sound->stopSamples();
 	_music->stopMusic();
+
+#ifdef USE_IMGUI
+	_system->setImGuiCallbacks(ImGuiCallbacks());
+#endif
+
 	return Common::kNoError;
 }
 


Commit: 1820c978ea6e851277682460fee57798bba1886a
    https://github.com/scummvm/scummvm/commit/1820c978ea6e851277682460fee57798bba1886a
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-12-28T13:58:03+01:00

Commit Message:
TWP: Cleanup ImGui callbacks after running

Changed paths:
    engines/twp/twp.cpp


diff --git a/engines/twp/twp.cpp b/engines/twp/twp.cpp
index 3d6740fa760..cb53ec314f7 100644
--- a/engines/twp/twp.cpp
+++ b/engines/twp/twp.cpp
@@ -1324,6 +1324,10 @@ Common::Error TwpEngine::run() {
 		}
 	}
 
+#ifdef USE_IMGUI
+	_system->setImGuiCallbacks(ImGuiCallbacks());
+#endif
+
 	return Common::kNoError;
 }
 




More information about the Scummvm-git-logs mailing list