[Scummvm-git-logs] scummvm master -> 0ea1b5aef6ec3ac35dcf6c40887c706dc2660e52

lephilousophe noreply at scummvm.org
Sun Nov 26 15:13:12 UTC 2023


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

Summary:
0ea1b5aef6 GRAPHICS3D: Clear screen while hiding overlay


Commit: 0ea1b5aef6ec3ac35dcf6c40887c706dc2660e52
    https://github.com/scummvm/scummvm/commit/0ea1b5aef6ec3ac35dcf6c40887c706dc2660e52
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-11-26T16:12:14+01:00

Commit Message:
GRAPHICS3D: Clear screen while hiding overlay

Changed paths:
    backends/graphics3d/ios/ios-graphics3d.cpp
    backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp


diff --git a/backends/graphics3d/ios/ios-graphics3d.cpp b/backends/graphics3d/ios/ios-graphics3d.cpp
index 0bcab86afd8..d35219a18e0 100644
--- a/backends/graphics3d/ios/ios-graphics3d.cpp
+++ b/backends/graphics3d/ios/ios-graphics3d.cpp
@@ -470,6 +470,17 @@ void iOSGraphics3dManager::hideOverlay() {
 
 	delete _overlayBackground;
 	_overlayBackground = nullptr;
+
+	if (_surfaceRenderer) {
+		_surfaceRenderer->prepareState();
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+		_surfaceRenderer->restorePreviousState();
+		updateScreen();
+		_surfaceRenderer->prepareState();
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+		_surfaceRenderer->restorePreviousState();
+		updateScreen();
+	}
 }
 
 bool iOSGraphics3dManager::showMouse(bool visible) {
diff --git a/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp b/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp
index 75b1af9c754..81c53b3cf4b 100644
--- a/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp
+++ b/backends/graphics3d/openglsdl/openglsdl-graphics3d.cpp
@@ -714,6 +714,18 @@ void OpenGLSdlGraphics3dManager::hideOverlay() {
 
 	delete _overlayBackground;
 	_overlayBackground = nullptr;
+
+	if (_surfaceRenderer) {
+		// If there is double buffering we need to redraw twice
+		_surfaceRenderer->prepareState();
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+		_surfaceRenderer->restorePreviousState();
+		updateScreen();
+		_surfaceRenderer->prepareState();
+		glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
+		_surfaceRenderer->restorePreviousState();
+		updateScreen();
+	}
 }
 
 void OpenGLSdlGraphics3dManager::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {




More information about the Scummvm-git-logs mailing list