[Scummvm-cvs-logs] scummvm master -> 6927e570bbbd69886b5fe2c2ce484ae236af61db

fuzzie fuzzie at fuzzie.org
Thu Jan 23 23:03:18 CET 2014


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:
6927e570bb ANDROID: Add 32bpp support.


Commit: 6927e570bbbd69886b5fe2c2ce484ae236af61db
    https://github.com/scummvm/scummvm/commit/6927e570bbbd69886b5fe2c2ce484ae236af61db
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2014-01-23T14:00:00-08:00

Commit Message:
ANDROID: Add 32bpp support.

We still prefer 16bpp for performance reasons.

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



diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index 0ce95a3..9f6c759 100644
--- a/backends/platform/android/gfx.cpp
+++ b/backends/platform/android/gfx.cpp
@@ -94,6 +94,7 @@ Common::List<Graphics::PixelFormat> OSystem_Android::getSupportedFormats() const
 	Common::List<Graphics::PixelFormat> res;
 	res.push_back(GLES565Texture::pixelFormat());
 	res.push_back(GLES5551Texture::pixelFormat());
+	res.push_back(GLES8888Texture::pixelFormat());
 	res.push_back(GLES4444Texture::pixelFormat());
 	res.push_back(Graphics::PixelFormat::createFormatCLUT8());
 
@@ -147,6 +148,8 @@ void OSystem_Android::initTexture(GLESBaseTexture **texture,
 			*texture = new GLES565Texture();
 		else if (format_new == GLES5551Texture::pixelFormat())
 			*texture = new GLES5551Texture();
+		else if (format_new == GLES8888Texture::pixelFormat())
+			*texture = new GLES8888Texture();
 		else if (format_new == GLES4444Texture::pixelFormat())
 			*texture = new GLES4444Texture();
 		else {
diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp
index cc41c0d..87fd2d9 100644
--- a/backends/platform/android/texture.cpp
+++ b/backends/platform/android/texture.cpp
@@ -259,11 +259,15 @@ void GLESTexture::fillBuffer(uint32 color) {
 	assert(_surface.getPixels());
 
 	if (_pixelFormat.bytesPerPixel == 1 ||
-			((color & 0xff) == ((color >> 8) & 0xff)))
+			(_pixelFormat.bytesPerPixel == 2 &&
+			((color & 0xff) == ((color >> 8) & 0xff))))
 		memset(_pixels, color & 0xff, _surface.pitch * _surface.h);
-	else
-		Common::fill(_pixels, _pixels + _surface.pitch * _surface.h,
+	else if (_pixelFormat.bytesPerPixel == 2)
+		Common::fill((uint16 *)_pixels, (uint16 *)(_pixels + _surface.pitch * _surface.h),
 						(uint16)color);
+	else
+		Common::fill((uint32 *)_pixels, (uint32 *)(_pixels + _surface.pitch * _surface.h),
+						color);
 
 	setDirty();
 }
@@ -334,6 +338,13 @@ GLES565Texture::GLES565Texture() :
 GLES565Texture::~GLES565Texture() {
 }
 
+GLES8888Texture::GLES8888Texture() :
+	GLESTexture(GL_RGBA, GL_UNSIGNED_BYTE, pixelFormat()) {
+}
+
+GLES8888Texture::~GLES8888Texture() {
+}
+
 GLESFakePaletteTexture::GLESFakePaletteTexture(GLenum glFormat, GLenum glType,
 									Graphics::PixelFormat pixelFormat) :
 	GLESBaseTexture(glFormat, glType, pixelFormat),
diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h
index 4307b5a..67f7343 100644
--- a/backends/platform/android/texture.h
+++ b/backends/platform/android/texture.h
@@ -224,6 +224,18 @@ public:
 	}
 };
 
+// RGBA8888 texture
+class GLES8888Texture : public GLESTexture {
+public:
+	GLES8888Texture();
+	virtual ~GLES8888Texture();
+
+	static inline Graphics::PixelFormat pixelFormat() {
+		// We assume LE since all Android platforms are LE.
+		return Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24);
+	}
+};
+
 class GLESFakePaletteTexture : public GLESBaseTexture {
 protected:
 	GLESFakePaletteTexture(GLenum glFormat, GLenum glType,






More information about the Scummvm-git-logs mailing list