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

lephilousophe noreply at scummvm.org
Sat Nov 15 11:55:52 UTC 2025


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

Summary:
dda0222ad0 BACKENDS: Fix _overlayInGUI improper usages
0f45959d0f HYPNO: Fix subtitles


Commit: dda0222ad06977ffab386b70435b2b83000d72a6
    https://github.com/scummvm/scummvm/commit/dda0222ad06977ffab386b70435b2b83000d72a6
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-11-15T11:16:03+01:00

Commit Message:
BACKENDS: Fix _overlayInGUI improper usages

Aspect ratio correction doesn't depend on if we are in GUI or not but if
the overlay is shown.
The overlay is never A/R corrected.

Changed paths:
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp


diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index c46ca6e5285..e8a173fa5c2 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -1242,7 +1242,7 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
 			blackrect.x = ((_videoMode.screenWidth + _gameScreenShakeXOffset) * _videoMode.scaleFactor);
 		}
 
-		if (_videoMode.aspectRatioCorrection && !_overlayInGUI) {
+		if (_videoMode.aspectRatioCorrection && !_overlayVisible) {
 			blackrect.h = real2Aspect(blackrect.h - 1) + 1;
 		}
 
@@ -1263,7 +1263,7 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
 			blackrect.y = ((_videoMode.screenHeight + _gameScreenShakeYOffset) * _videoMode.scaleFactor);
 		}
 
-		if (_videoMode.aspectRatioCorrection && !_overlayInGUI) {
+		if (_videoMode.aspectRatioCorrection && !_overlayVisible) {
 			blackrect.y = real2Aspect(blackrect.y);
 			blackrect.h = real2Aspect(blackrect.h + blackrect.y - 1) - blackrect.y + 1;
 		}
@@ -1450,7 +1450,7 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
 				dst_x *= scale1;
 				dst_y *= scale1;
 
-				if (_videoMode.aspectRatioCorrection && !_overlayInGUI)
+				if (_videoMode.aspectRatioCorrection && !_overlayVisible)
 					dst_y = real2Aspect(dst_y);
 
 				_scaler->scale((byte *)srcSurf->pixels + (src_x + _maxExtraPixels) * bpp + (src_y + _maxExtraPixels) * srcPitch, srcPitch,
@@ -1462,7 +1462,7 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
 				r->h = dst_h * scale1;
 
 #ifdef USE_ASPECT
-				if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayInGUI)
+				if (_videoMode.aspectRatioCorrection && orig_dst_y < height && !_overlayVisible)
 					r->h = stretch200To240((uint8 *) _hwScreen->pixels, dstPitch, r->w, r->h, r->x, r->y, orig_dst_y * scale1, _videoMode.filtering, 	convertSDLPixelFormat(_hwScreen->format));
 #endif
 			}
@@ -1487,7 +1487,7 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
 
 #ifdef USE_SDL_DEBUG_FOCUSRECT
 		// We draw the focus rectangle on top of everything, to assure it's easily visible.
-		// Of course when the overlay is visible we do not show it, since it is only for game
+		// Of course when the GUI overlay is visible we do not show it, since it is only for game
 		// specific focus.
 		if (_enableFocusRect && !_overlayInGUI) {
 			int x = _focusRect.left + _currentShakeXOffset;
@@ -1507,7 +1507,7 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() {
 				w *= scale1;
 				h *= scale1;
 
-				if (_videoMode.aspectRatioCorrection && !_overlayInGUI)
+				if (_videoMode.aspectRatioCorrection && !_overlayVisible)
 					y = real2Aspect(y);
 
 				if (h > 0 && w > 0) {
@@ -1852,7 +1852,7 @@ void SurfaceSdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool in
 	}
 
 #ifdef USE_ASPECT
-	if (_videoMode.aspectRatioCorrection && !_overlayInGUI && !realCoordinates)
+	if (_videoMode.aspectRatioCorrection && !inOverlay && !realCoordinates)
 		makeRectStretchable(x, y, w, h, _videoMode.filtering);
 #endif
 
@@ -1962,7 +1962,7 @@ void SurfaceSdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
 
 	// We just fake this as a dirty rect for now, to easily force a screen update whenever
 	// the rect changes.
-	addDirtyRect(_focusRect.left, _focusRect.top, _focusRect.width(), _focusRect.height(), _overlayVisible);
+	addDirtyRect(_focusRect.left, _focusRect.top, _focusRect.width(), _focusRect.height(), false);
 #endif
 }
 
@@ -1976,7 +1976,7 @@ void SurfaceSdlGraphicsManager::clearFocusRectangle() {
 
 	// We just fake this as a dirty rect for now, to easily force a screen update whenever
 	// the rect changes.
-	addDirtyRect(_focusRect.left, _focusRect.top, _focusRect.width(), _focusRect.height(), _overlayVisible);
+	addDirtyRect(_focusRect.left, _focusRect.top, _focusRect.width(), _focusRect.height(), false);
 #endif
 }
 


Commit: 0f45959d0f586c53bb5fe2aa67975940b3345e61
    https://github.com/scummvm/scummvm/commit/0f45959d0f586c53bb5fe2aa67975940b3345e61
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-11-15T11:16:03+01:00

Commit Message:
HYPNO: Fix subtitles

Support subtitle_dev setting and hide the overlay when subtitles are
done.

Changed paths:
    engines/hypno/hypno.cpp


diff --git a/engines/hypno/hypno.cpp b/engines/hypno/hypno.cpp
index b1e52e168e4..fb3984e9556 100644
--- a/engines/hypno/hypno.cpp
+++ b/engines/hypno/hypno.cpp
@@ -322,7 +322,7 @@ void HypnoEngine::runIntro(MVideo &video) {
 
 	delete _subtitles;
 	_subtitles = nullptr;
-	g_system->clearOverlay();
+	g_system->hideOverlay();
 }
 
 void HypnoEngine::runCode(Code *code) { error("Function \"%s\" not implemented", __FUNCTION__); }
@@ -612,16 +612,24 @@ void HypnoEngine::loadSubtitles(const Common::Path &path) {
 	subPath = subPath.appendComponent(language);
 	subPath = subPath.appendComponent(subPathStr);
 	debugC(1, kHypnoDebugMedia, "Loading subtitles from %s", subPath.toString().c_str());
-	if (Common::File::exists(subPath)) {
-		_subtitles = new Video::Subtitles();
-		_subtitles->loadSRTFile(subPath);
-		g_system->showOverlay(false);
-		adjustSubtitleSize();
-	} else {
+
+	if (_subtitles != nullptr) {
 		delete _subtitles;
 		_subtitles = nullptr;
-		g_system->clearOverlay();
+		g_system->hideOverlay();
 	}
+
+	_subtitles = new Video::Subtitles();
+	_subtitles->loadSRTFile(subPath);
+	if (!_subtitles->isLoaded()) {
+		delete _subtitles;
+		_subtitles = nullptr;
+		return;
+	}
+
+	g_system->showOverlay(false);
+	g_system->clearOverlay();
+	adjustSubtitleSize();
 }
 
 




More information about the Scummvm-git-logs mailing list