[Scummvm-git-logs] scummvm master -> 626755db94f3a0a8070b76ebbf4853a4bdc67e1e

criezy criezy at scummvm.org
Sat Nov 7 18:05:57 UTC 2020


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:
626755db94 IPHONE: Use kFeatureFilteringMode to toggle filtering


Commit: 626755db94f3a0a8070b76ebbf4853a4bdc67e1e
    https://github.com/scummvm/scummvm/commit/626755db94f3a0a8070b76ebbf4853a4bdc67e1e
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2020-11-07T18:05:53Z

Commit Message:
IPHONE: Use kFeatureFilteringMode to toggle filtering

Changed paths:
    backends/platform/iphone/iphone_common.h
    backends/platform/iphone/iphone_video.mm
    backends/platform/iphone/osys_main.cpp
    backends/platform/iphone/osys_main.h
    backends/platform/iphone/osys_video.mm


diff --git a/backends/platform/iphone/iphone_common.h b/backends/platform/iphone/iphone_common.h
index a09ddd462c..80a829e921 100644
--- a/backends/platform/iphone/iphone_common.h
+++ b/backends/platform/iphone/iphone_common.h
@@ -52,16 +52,11 @@ enum UIViewSwipeDirection {
 	kUIViewSwipeRight = 8
 };
 
-enum GraphicsModes {
-	kGraphicsModeLinear = 0,
-	kGraphicsModeNone = 1
-};
-
 struct VideoContext {
 	VideoContext() : asprectRatioCorrection(), screenWidth(), screenHeight(), overlayVisible(false),
 	                 overlayWidth(), overlayHeight(), mouseX(), mouseY(),
 	                 mouseHotspotX(), mouseHotspotY(), mouseWidth(), mouseHeight(),
-	                 mouseIsVisible(), graphicsMode(kGraphicsModeLinear),
+	                 mouseIsVisible(), filtering(false),
 	                 shakeXOffset(), shakeYOffset() {
 	}
 
@@ -83,7 +78,7 @@ struct VideoContext {
 	Graphics::Surface mouseTexture;
 
 	// Misc state
-	GraphicsModes graphicsMode;
+	bool filtering;
 	int shakeXOffset;
 	int shakeYOffset;
 };
diff --git a/backends/platform/iphone/iphone_video.mm b/backends/platform/iphone/iphone_video.mm
index 1eb5627c54..d99c1e2822 100644
--- a/backends/platform/iphone/iphone_video.mm
+++ b/backends/platform/iphone/iphone_video.mm
@@ -269,17 +269,7 @@ const char *iPhone_getDocumentsDir() {
 
 	glBindTexture(GL_TEXTURE_2D, tex); printOpenGLError();
 
-	GLint filter = GL_LINEAR;
-
-	switch (_videoContext.graphicsMode) {
-	case kGraphicsModeLinear:
-		filter = GL_LINEAR;
-		break;
-
-	case kGraphicsModeNone:
-		filter = GL_NEAREST;
-		break;
-	}
+	GLint filter = _videoContext.filtering ? GL_LINEAR : GL_NEAREST;
 
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); printOpenGLError();
 	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); printOpenGLError();
diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp
index de3fd682d1..2361861548 100644
--- a/backends/platform/iphone/osys_main.cpp
+++ b/backends/platform/iphone/osys_main.cpp
@@ -44,12 +44,6 @@
 #include "backends/platform/iphone/osys_main.h"
 
 
-const OSystem::GraphicsMode OSystem_IPHONE::s_supportedGraphicsModes[] = {
-	{ "linear", "Linear filtering", kGraphicsModeLinear },
-	{ "none", "No filtering", kGraphicsModeNone },
-	{ 0, 0, 0 }
-};
-
 AQCallbackStruct OSystem_IPHONE::s_AudioQueue;
 SoundProc OSystem_IPHONE::s_soundCallback = NULL;
 void *OSystem_IPHONE::s_soundParam = NULL;
@@ -110,6 +104,7 @@ void OSystem_IPHONE::initBackend() {
 bool OSystem_IPHONE::hasFeature(Feature f) {
 	switch (f) {
 	case kFeatureCursorPalette:
+	case kFeatureFilteringMode:
 	case kFeatureNoQuit:
 		return true;
 
@@ -127,6 +122,9 @@ void OSystem_IPHONE::setFeatureState(Feature f, bool enable) {
 			_mouseCursorPaletteEnabled = enable;
 		}
 		break;
+	case kFeatureFilteringMode:
+		_videoContext->filtering = enable;
+		break;
 	case kFeatureAspectRatioCorrection:
 		_videoContext->asprectRatioCorrection = enable;
 		break;
@@ -140,6 +138,8 @@ bool OSystem_IPHONE::getFeatureState(Feature f) {
 	switch (f) {
 	case kFeatureCursorPalette:
 		return _mouseCursorPaletteEnabled;
+	case kFeatureFilteringMode:
+		return _videoContext->filtering;
 	case kFeatureAspectRatioCorrection:
 		return _videoContext->asprectRatioCorrection;
 
diff --git a/backends/platform/iphone/osys_main.h b/backends/platform/iphone/osys_main.h
index a5755062bf..f771d6e18e 100644
--- a/backends/platform/iphone/osys_main.h
+++ b/backends/platform/iphone/osys_main.h
@@ -54,7 +54,6 @@ struct AQCallbackStruct {
 
 class OSystem_IPHONE : public EventsBaseBackend, public PaletteManager {
 protected:
-	static const OSystem::GraphicsMode s_supportedGraphicsModes[];
 	static AQCallbackStruct s_AudioQueue;
 	static SoundProc s_soundCallback;
 	static void *s_soundParam;
@@ -122,10 +121,6 @@ public:
 	virtual bool hasFeature(Feature f);
 	virtual void setFeatureState(Feature f, bool enable);
 	virtual bool getFeatureState(Feature f);
-	virtual const GraphicsMode *getSupportedGraphicsModes() const;
-	virtual int getDefaultGraphicsMode() const;
-	virtual bool setGraphicsMode(int mode);
-	virtual int getGraphicsMode() const;
 	virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format);
 
 	virtual void beginGFXTransaction();
diff --git a/backends/platform/iphone/osys_video.mm b/backends/platform/iphone/osys_video.mm
index f31e7b233b..1cb9ae5487 100644
--- a/backends/platform/iphone/osys_video.mm
+++ b/backends/platform/iphone/osys_video.mm
@@ -44,30 +44,6 @@ void OSystem_IPHONE::initVideoContext() {
 	_videoContext = [g_iPhoneViewInstance getVideoContext];
 }
 
-const OSystem::GraphicsMode *OSystem_IPHONE::getSupportedGraphicsModes() const {
-	return s_supportedGraphicsModes;
-}
-
-int OSystem_IPHONE::getDefaultGraphicsMode() const {
-	return kGraphicsModeLinear;
-}
-
-bool OSystem_IPHONE::setGraphicsMode(int mode) {
-	switch (mode) {
-	case kGraphicsModeNone:
-	case kGraphicsModeLinear:
-		_videoContext->graphicsMode = (GraphicsModes)mode;
-		return true;
-
-	default:
-		return false;
-	}
-}
-
-int OSystem_IPHONE::getGraphicsMode() const {
-	return _videoContext->graphicsMode;
-}
-
 #ifdef USE_RGB_COLOR
 Common::List<Graphics::PixelFormat> OSystem_IPHONE::getSupportedFormats() const {
 	Common::List<Graphics::PixelFormat> list;




More information about the Scummvm-git-logs mailing list