aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorMax Horn2010-06-01 22:29:55 +0000
committerMax Horn2010-06-01 22:29:55 +0000
commit9f14e43d16a45c37b041ed2e3041fd8e7690121d (patch)
tree558a63dc70f79d7d8ea47c4cd085cb512a239cc1 /backends
parent93867d567fd76f909bfbb64f8300d6841af584e2 (diff)
downloadscummvm-rg350-9f14e43d16a45c37b041ed2e3041fd8e7690121d.tar.gz
scummvm-rg350-9f14e43d16a45c37b041ed2e3041fd8e7690121d.tar.bz2
scummvm-rg350-9f14e43d16a45c37b041ed2e3041fd8e7690121d.zip
Fix bug #2999153: "IPHONE: No grabPalette() implementation"
svn-id: r49384
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/iphone/osys_video.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/backends/platform/iphone/osys_video.cpp b/backends/platform/iphone/osys_video.cpp
index 6cb5e18d95..76c2031758 100644
--- a/backends/platform/iphone/osys_video.cpp
+++ b/backends/platform/iphone/osys_video.cpp
@@ -86,7 +86,7 @@ int16 OSystem_IPHONE::getWidth() {
}
void OSystem_IPHONE::setPalette(const byte *colors, uint start, uint num) {
- //printf("setPalette()\n");
+ assert(start + num <= 256);
const byte *b = colors;
for (uint i = start; i < start + num; ++i) {
@@ -98,7 +98,14 @@ void OSystem_IPHONE::setPalette(const byte *colors, uint start, uint num) {
}
void OSystem_IPHONE::grabPalette(byte *colors, uint start, uint num) {
- //printf("grabPalette()\n");
+ assert(start + num <= 256);
+ byte *b = colors;
+
+ for (uint i = start; i < start + num; ++i) {
+ Graphics::colorToRGB<Graphics::ColorMasks<565> >(_palette[i], b[0], b[1], b[2]);
+ b[3] = 0xFF;
+ b += 4;
+ }
}
void OSystem_IPHONE::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {