aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android
diff options
context:
space:
mode:
authorJohannes Schickel2011-02-19 21:42:34 +0100
committerJohannes Schickel2011-02-19 21:46:45 +0100
commite21d6e0d1120e917a4a019a4070ec4db5e988b9b (patch)
tree1142828b72ccf17d513c621e108d749f148fd32b /backends/platform/android
parent32d0e4c15fb33f80db194087850466664a43516a (diff)
parentb26f30b98793c522265a3eeb48fb3b41034663c6 (diff)
downloadscummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.tar.gz
scummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.tar.bz2
scummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.zip
Merge branch 'osystem-palette' of https://github.com/lordhoto/scummvm into master
Conflicts: backends/platform/android/android.cpp engines/sci/graphics/screen.cpp engines/sci/graphics/transitions.cpp
Diffstat (limited to 'backends/platform/android')
-rw-r--r--backends/platform/android/android.cpp26
1 files changed, 3 insertions, 23 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index 0424983824..38bc94eb7f 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -749,32 +749,12 @@ void OSystem_Android::setPalette(const byte *colors, uint start, uint num) {
if (!_use_mouse_palette)
_setCursorPalette(colors, start, num);
- byte *palette = _game_texture->palette() + start * 3;
-
- do {
- for (int i = 0; i < 3; ++i)
- palette[i] = colors[i];
-
- palette += 3;
- colors += 4;
- } while (--num);
+ memcpy(_game_texture->palette() + start * 3, colors, num * 3);
}
void OSystem_Android::grabPalette(byte *colors, uint start, uint num) {
ENTER("%p, %u, %u", colors, start, num);
-
- const byte *palette = _game_texture->palette_const() + start * 3;
-
- do {
- for (int i = 0; i < 3; ++i)
- colors[i] = palette[i];
-
- // alpha
- colors[3] = 0xff;
-
- palette += 3;
- colors += 4;
- } while (--num);
+ memcpy(colors, _game_texture->palette_const() + start * 3, num * 3);
}
void OSystem_Android::copyRectToScreen(const byte *buf, int pitch,
@@ -1051,7 +1031,7 @@ void OSystem_Android::_setCursorPalette(const byte *colors,
// Leave alpha untouched to preserve keycolor
palette += 4;
- colors += 4;
+ colors += 3;
} while (--num);
}