[Scummvm-git-logs] scummvm master -> 54423ab73d259236ad3cb4fd8a71f679987199b2

sev- noreply at scummvm.org
Fri Aug 25 23:25:55 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:
54423ab73d SURFACESDL: Move the AspectRatio class into the graphics manager class


Commit: 54423ab73d259236ad3cb4fd8a71f679987199b2
    https://github.com/scummvm/scummvm/commit/54423ab73d259236ad3cb4fd8a71f679987199b2
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2023-08-26T01:25:51+02:00

Commit Message:
SURFACESDL: Move the AspectRatio class into the graphics manager class

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


diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 9ee0d0ec580..a18ef063519 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -78,7 +78,7 @@ const OSystem::GraphicsMode s_supportedStretchModes[] = {
 };
 #endif
 
-AspectRatio::AspectRatio(int w, int h) {
+SurfaceSdlGraphicsManager::AspectRatio::AspectRatio(int w, int h) {
 	// TODO : Validation and so on...
 	// Currently, we just ensure the program don't instantiate non-supported aspect ratios
 	_kw = w;
@@ -86,7 +86,7 @@ AspectRatio::AspectRatio(int w, int h) {
 }
 
 #if defined(USE_ASPECT)
-static AspectRatio getDesiredAspectRatio() {
+SurfaceSdlGraphicsManager::AspectRatio SurfaceSdlGraphicsManager::getDesiredAspectRatio() {
 	const size_t AR_COUNT = 4;
 	const char *desiredAspectRatioAsStrings[AR_COUNT] = {	"auto",				"4/3",				"16/9",				"16/10" };
 	const AspectRatio desiredAspectRatios[AR_COUNT] = {		AspectRatio(0, 0),	AspectRatio(4,3),	AspectRatio(16,9),	AspectRatio(16,10) };
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index 02e5c61748b..be5035c78c4 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -44,18 +44,6 @@ enum {
 };
 
 
-class AspectRatio {
-	int _kw, _kh;
-public:
-	AspectRatio() { _kw = _kh = 0; }
-	AspectRatio(int w, int h);
-
-	bool isAuto() const { return (_kw | _kh) == 0; }
-
-	int kw() const { return _kw; }
-	int kh() const { return _kh; }
-};
-
 /**
  * SDL graphics manager
  */
@@ -167,6 +155,20 @@ protected:
 	void drawOSD();
 #endif
 
+	class AspectRatio {
+		int _kw, _kh;
+	public:
+		AspectRatio() { _kw = _kh = 0; }
+		AspectRatio(int w, int h);
+
+		bool isAuto() const { return (_kw | _kh) == 0; }
+
+		int kw() const { return _kw; }
+		int kh() const { return _kh; }
+	};
+
+	static AspectRatio getDesiredAspectRatio();
+
 	bool gameNeedsAspectRatioCorrection() const override {
 		return _videoMode.aspectRatioCorrection;
 	}




More information about the Scummvm-git-logs mailing list