From ea253ff26d2d5ffeec85d34a79c00f0f50598111 Mon Sep 17 00:00:00 2001 From: dhewg Date: Tue, 5 Apr 2011 15:07:07 +0200 Subject: [PATCH] ANDROID: Use a faked paletted texture for CLUT cursors Same change as for the game screen, reduces CPU usage a little --- backends/platform/android/android.cpp | 2 +- backends/platform/android/android.h | 2 +- backends/platform/android/texture.cpp | 8 ++++++++ backends/platform/android/texture.h | 6 ++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 1a83289c25bb..6346ffa7a3cd 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -359,7 +359,7 @@ void OSystem_Android::initBackend() { _game_texture = new GLESFakePalette565Texture(); _overlay_texture = new GLES4444Texture(); - _mouse_texture_palette = new GLESPalette5551Texture(); + _mouse_texture_palette = new GLESFakePalette5551Texture(); _mouse_texture = _mouse_texture_palette; initOverlay(); diff --git a/backends/platform/android/android.h b/backends/platform/android/android.h index a5a30aef1904..55a828b87315 100644 --- a/backends/platform/android/android.h +++ b/backends/platform/android/android.h @@ -129,7 +129,7 @@ class OSystem_Android : public BaseBackend, public PaletteManager { // Mouse layer GLESBaseTexture *_mouse_texture; - GLESPaletteTexture *_mouse_texture_palette; + GLESBaseTexture *_mouse_texture_palette; GLES5551Texture *_mouse_texture_rgb; Common::Point _mouse_hotspot; uint32 _mouse_keycolor; diff --git a/backends/platform/android/texture.cpp b/backends/platform/android/texture.cpp index 573f8f83e1ce..2018dfdaab82 100644 --- a/backends/platform/android/texture.cpp +++ b/backends/platform/android/texture.cpp @@ -584,5 +584,13 @@ GLESFakePalette565Texture::GLESFakePalette565Texture() : GLESFakePalette565Texture::~GLESFakePalette565Texture() { } +GLESFakePalette5551Texture::GLESFakePalette5551Texture() : + GLESFakePaletteTexture(GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, + GLES5551Texture::pixelFormat()) { +} + +GLESFakePalette5551Texture::~GLESFakePalette5551Texture() { +} + #endif diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h index 925418721b63..d825357760c8 100644 --- a/backends/platform/android/texture.h +++ b/backends/platform/android/texture.h @@ -330,6 +330,12 @@ class GLESFakePalette565Texture : public GLESFakePaletteTexture { virtual ~GLESFakePalette565Texture(); }; +class GLESFakePalette5551Texture : public GLESFakePaletteTexture { +public: + GLESFakePalette5551Texture(); + virtual ~GLESFakePalette5551Texture(); +}; + #endif #endif