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

sev- sev at scummvm.org
Sun Jul 29 09:37:43 CEST 2018


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:
d494d73c80 ANDROID: Replace getPixelFormatName function with PixelFormat::toString


Commit: d494d73c80027a58b7b8edd2c53893220b1c3989
    https://github.com/scummvm/scummvm/commit/d494d73c80027a58b7b8edd2c53893220b1c3989
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2018-07-29T09:37:40+02:00

Commit Message:
ANDROID: Replace getPixelFormatName function with PixelFormat::toString

Changed paths:
    backends/platform/android/android.h
    backends/platform/android/gfx.cpp


diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h
index c261f85..3a9d391 100644
--- a/backends/platform/android/android.h
+++ b/backends/platform/android/android.h
@@ -157,7 +157,6 @@ private:
 	void initOverlay();
 
 #ifdef USE_RGB_COLOR
-	Common::String getPixelFormatName(const Graphics::PixelFormat &format) const;
 	void initTexture(GLESBaseTexture **texture, uint width, uint height,
 						const Graphics::PixelFormat *format);
 #endif
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index a4f1746..58c92ad 100644
--- a/backends/platform/android/gfx.cpp
+++ b/backends/platform/android/gfx.cpp
@@ -101,23 +101,6 @@ Common::List<Graphics::PixelFormat> OSystem_Android::getSupportedFormats() const
 	return res;
 }
 
-Common::String OSystem_Android::getPixelFormatName(const Graphics::PixelFormat &format) const {
-	if (format.bytesPerPixel == 1)
-		return "CLUT8";
-
-	if (format.aLoss == 8)
-		return Common::String::format("RGB%u%u%u",
-										8 - format.rLoss,
-										8 - format.gLoss,
-										8 - format.bLoss);
-
-	return Common::String::format("RGBA%u%u%u%u",
-									8 - format.rLoss,
-									8 - format.gLoss,
-									8 - format.bLoss,
-									8 - format.aLoss);
-}
-
 void OSystem_Android::initTexture(GLESBaseTexture **texture,
 									uint width, uint height,
 									const Graphics::PixelFormat *format) {
@@ -140,7 +123,7 @@ void OSystem_Android::initTexture(GLESBaseTexture **texture,
 	if (format_current != format_new) {
 		if (*texture)
 			LOGD("switching pixel format from: %s",
-					getPixelFormatName((*texture)->getPixelFormat()).c_str());
+					(*texture)->getPixelFormat().toString().c_str());
 
 		delete *texture;
 
@@ -156,13 +139,13 @@ void OSystem_Android::initTexture(GLESBaseTexture **texture,
 			// TODO what now?
 			if (format_new != format_clut8)
 				LOGE("unsupported pixel format: %s",
-					getPixelFormatName(format_new).c_str());
+					format_new.toString().c_str());
 
 			*texture = new GLESFakePalette565Texture;
 		}
 
 		LOGD("new pixel format: %s",
-				getPixelFormatName((*texture)->getPixelFormat()).c_str());
+				(*texture)->getPixelFormat().toString().c_str());
 	}
 
 	(*texture)->allocBuffer(width, height);





More information about the Scummvm-git-logs mailing list