aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android/gfx.cpp
diff options
context:
space:
mode:
authordhewg2011-03-13 14:16:39 +0100
committerdhewg2011-03-13 16:50:43 +0100
commita93229cae53bd35b320e72bd5fe794e8dd79c318 (patch)
tree7bb530e9ffb82895b6bf98f53e32b6203d46d88f /backends/platform/android/gfx.cpp
parent5b820cee64f54a0c28772fb40256334a7206ea53 (diff)
downloadscummvm-rg350-a93229cae53bd35b320e72bd5fe794e8dd79c318.tar.gz
scummvm-rg350-a93229cae53bd35b320e72bd5fe794e8dd79c318.tar.bz2
scummvm-rg350-a93229cae53bd35b320e72bd5fe794e8dd79c318.zip
ANDROID: Don't use compressed textures for the game screen
Some GLES drivers suck so much that uploading data to the GPU takes ages. CLUT8 games now use a faked paletted texture, which internally uses a RGB565 hardware texture (Android's native pixel format). This seems to be the only way to efficiently implement constant changing textures with GLES1 - at the cost of extra buffers. Then again, we can now use glTexSubImage2D to only update the dirty rects, which wasn't possible before because glCompressedTexSubImage2D is only usable on GLES2. This commit does exactly that. Overall, the CPU usage is massively reduced for CLUT8 games.
Diffstat (limited to 'backends/platform/android/gfx.cpp')
-rw-r--r--backends/platform/android/gfx.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index 6be7a03b22..62dbe644bf 100644
--- a/backends/platform/android/gfx.cpp
+++ b/backends/platform/android/gfx.cpp
@@ -72,9 +72,9 @@ Graphics::PixelFormat OSystem_Android::getScreenFormat() const {
Common::List<Graphics::PixelFormat> OSystem_Android::getSupportedFormats() const {
Common::List<Graphics::PixelFormat> res;
- res.push_back(GLES565Texture::getPixelFormat());
- res.push_back(GLES5551Texture::getPixelFormat());
- res.push_back(GLES4444Texture::getPixelFormat());
+ res.push_back(GLES565Texture::pixelFormat());
+ res.push_back(GLES5551Texture::pixelFormat());
+ res.push_back(GLES4444Texture::pixelFormat());
res.push_back(Graphics::PixelFormat::createFormatCLUT8());
return res;
@@ -123,11 +123,11 @@ void OSystem_Android::initTexture(GLESTexture **texture,
delete *texture;
- if (format_new == GLES565Texture::getPixelFormat())
+ if (format_new == GLES565Texture::pixelFormat())
*texture = new GLES565Texture();
- else if (format_new == GLES5551Texture::getPixelFormat())
+ else if (format_new == GLES5551Texture::pixelFormat())
*texture = new GLES5551Texture();
- else if (format_new == GLES4444Texture::getPixelFormat())
+ else if (format_new == GLES4444Texture::pixelFormat())
*texture = new GLES4444Texture();
else {
// TODO what now?
@@ -135,7 +135,7 @@ void OSystem_Android::initTexture(GLESTexture **texture,
LOGE("unsupported pixel format: %s",
getPixelFormatName(format_new).c_str());
- *texture = new GLESPalette565Texture;
+ *texture = new GLESFakePalette565Texture;
}
LOGD("new pixel format: %s",