aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authordhewg2011-03-12 09:13:33 +0100
committerdhewg2011-03-12 09:36:22 +0100
commit4afa2c62b979251cb4d8ff7e5a97f5385a6287fe (patch)
treebabb10d93c788652de23c91bbb1522c18df6b44a /backends
parent0b8c57be8482f58d6c5a9ff54102c440cf399dc4 (diff)
downloadscummvm-rg350-4afa2c62b979251cb4d8ff7e5a97f5385a6287fe.tar.gz
scummvm-rg350-4afa2c62b979251cb4d8ff7e5a97f5385a6287fe.tar.bz2
scummvm-rg350-4afa2c62b979251cb4d8ff7e5a97f5385a6287fe.zip
ANDROID: Get rid of ugly casts
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/android/gfx.cpp8
-rw-r--r--backends/platform/android/texture.h12
2 files changed, 13 insertions, 7 deletions
diff --git a/backends/platform/android/gfx.cpp b/backends/platform/android/gfx.cpp
index 605f4eb744..327ef06f38 100644
--- a/backends/platform/android/gfx.cpp
+++ b/backends/platform/android/gfx.cpp
@@ -300,8 +300,7 @@ void OSystem_Android::setPalette(const byte *colors, uint start, uint num) {
GLTHREADCHECK;
- memcpy(((GLESPaletteTexture *)_game_texture)->palette() + start * 3,
- colors, num * 3);
+ memcpy(_game_texture->palette() + start * 3, colors, num * 3);
if (!_use_mouse_palette)
setCursorPaletteInternal(colors, start, num);
@@ -316,8 +315,7 @@ void OSystem_Android::grabPalette(byte *colors, uint start, uint num) {
GLTHREADCHECK;
- memcpy(colors, ((GLESPaletteTexture *)_game_texture)->palette() + start * 3,
- num * 3);
+ memcpy(colors, _game_texture->palette() + start * 3, num * 3);
}
void OSystem_Android::copyRectToScreen(const byte *buf, int pitch,
@@ -685,7 +683,7 @@ void OSystem_Android::disableCursorPalette(bool disable) {
// when disabling the cursor palette, and we're running a clut8 game,
// it expects the game palette to be used for the cursor
if (disable && _game_texture->getPixelFormat().bytesPerPixel == 1) {
- byte *src = ((GLESPaletteTexture *)_game_texture)->palette();
+ byte *src = _game_texture->palette();
byte *dst = _mouse_texture_palette->palette();
for (uint i = 0; i < 256; ++i, src += 3, dst += 4) {
diff --git a/backends/platform/android/texture.h b/backends/platform/android/texture.h
index 78df43aea9..1ed16cb390 100644
--- a/backends/platform/android/texture.h
+++ b/backends/platform/android/texture.h
@@ -84,6 +84,14 @@ public:
return &_surface;
}
+ virtual const byte *palette_const() const {
+ return 0;
+ };
+
+ virtual byte *palette() {
+ return 0;
+ };
+
inline bool dirty() const {
return _all_dirty || !_dirty_rect.isEmpty();
}
@@ -183,11 +191,11 @@ public:
drawTexture(0, 0, _surface.w, _surface.h);
}
- inline const byte *palette_const() const {
+ virtual const byte *palette_const() const {
return _texture;
};
- inline byte *palette() {
+ virtual byte *palette() {
setDirty();
return _texture;
};