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

athrxx noreply at scummvm.org
Wed Nov 18 22:50: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:
b2206b348e SNATCHER: (Sega Renderer) - fix aspect ratio correction


Commit: b2206b348e139f9b38a4af2a08e5a02228824433
    https://github.com/scummvm/scummvm/commit/b2206b348e139f9b38a4af2a08e5a02228824433
Author: athrxx (athrxx at scummvm.org)
Date: 2026-11-18T23:49:39+01:00

Commit Message:
SNATCHER: (Sega Renderer) - fix aspect ratio correction

(regression: with the option disabled, it would do a correction to a 1:1 ratio)

Changed paths:
    graphics/segagfx.cpp
    graphics/segagfx.h


diff --git a/graphics/segagfx.cpp b/graphics/segagfx.cpp
index 076fbce00c9..09350a5979b 100644
--- a/graphics/segagfx.cpp
+++ b/graphics/segagfx.cpp
@@ -32,7 +32,7 @@ SegaRenderer::SegaRenderer(const PixelFormat *systemPixelFormat) : _pixelFormat(
 	_tempBufferSprites(nullptr), _tempBufferSpritesPrio(nullptr), _tempBufferPlanes(nullptr), _tempBufferPlanesPrio(nullptr), _renderColorTable(nullptr), _rr(kUnspecified),
 	_renderLineFragmentD(0), _renderLineFragmentM(0), _hINTEnable(false), _hINTCounter(0), _hINTCounterNext(0), _hINTHandler(nullptr), _destPitch(0), _displayEnabled(true), _realW(0), _realH(0)
 #if(BUILD_SEGAGFX_ASPECT_RATIO_CORRECTION_SUPPORT)
-	, _arcIncX(0), _arcCntX(0), _arcIncY(0), _arcCntY(0), _xyAspectRatio(1.0), _scaleFactor(1.0)
+	, _arcIncX(0), _arcCntX(0), _arcIncY(0), _arcCntY(0), _xyAspectRatio(0.0), _scaleFactor(1.0)
 #endif
 {
 	_vram = new uint8[0x10000]();
@@ -132,12 +132,13 @@ void SegaRenderer::setAspectRatioCorrection(double xyAspectRatio, double scaleFa
 	_arcCntX = _arcCntY = 0;
 	_arcIncX = _arcIncY = trunc(scaleFactor * 0x10000);
 
-	double screenRatio = (double)_screenW / _screenH;
-
-	if (screenRatio > xyAspectRatio)
-		_arcIncY = trunc((scaleFactor * screenRatio * 0x10000) / xyAspectRatio);
-	else if (screenRatio < xyAspectRatio)
-		_arcIncX = trunc(xyAspectRatio * scaleFactor * 0x10000 / screenRatio);
+	if (xyAspectRatio != 0.0) {
+		double screenRatio = (double)_screenW / _screenH;
+		if (screenRatio > xyAspectRatio)
+			_arcIncY = trunc((scaleFactor * screenRatio * 0x10000) / xyAspectRatio);
+		else if (screenRatio < xyAspectRatio)
+			_arcIncX = trunc(xyAspectRatio * scaleFactor * 0x10000 / screenRatio);
+	}
 
 	_realW = (_screenW * _arcIncX) >> 16;
 	_realH = (_screenH * _arcIncY) >> 16;
diff --git a/graphics/segagfx.h b/graphics/segagfx.h
index f33fb6b68e1..9eec5c90c76 100644
--- a/graphics/segagfx.h
+++ b/graphics/segagfx.h
@@ -95,10 +95,10 @@ public:
 	 * interact with and/or impact a scaler or shader setting. So it might make sense not to overdo it with the scale factor (apart from
 	 * the obvious, that the aspect ratio correction will not come anywhere near as cheap any more).
 	 * 
-	 * @param xyAspectRatio:		desired x/y ratio. E. g., for 4 : 3, type '4.0 / 3.0'. To turn it off, use 1.0.
+	 * @param xyAspectRatio:		desired x/y ratio. E. g., for 4 : 3, type '4.0 / 3.0'. To turn it off, use 0.0.
 	 * @param scaleFactor:			scale factor for the aspect ratio correction, e. g. 1.0 for no scaling, 2.0 for double size
 	 */
-	void setAspectRatioCorrection(double xyAspectRatio = 1.0, double scaleFactor = 1.0);
+	void setAspectRatioCorrection(double xyAspectRatio = 0.0, double scaleFactor = 1.0);
 #endif
 
 	/**




More information about the Scummvm-git-logs mailing list