aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl
diff options
context:
space:
mode:
authorAndre Heider2010-04-20 21:16:58 +0000
committerAndre Heider2010-04-20 21:16:58 +0000
commit845d1869d8612ba408333bda01b7c687c64bf9b1 (patch)
tree2bfb406e56953067381b5fd11b0795b35f344445 /backends/platform/sdl
parent74c0db4548afbc879bbe48bd0eee228917d8ff8a (diff)
downloadscummvm-rg350-845d1869d8612ba408333bda01b7c687c64bf9b1.tar.gz
scummvm-rg350-845d1869d8612ba408333bda01b7c687c64bf9b1.tar.bz2
scummvm-rg350-845d1869d8612ba408333bda01b7c687c64bf9b1.zip
abort() when calling setPalette() or grabPalette() in non CLUT8 modes.
svn-id: r48757
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r--backends/platform/sdl/graphics.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp
index c8bd62c572..290f531278 100644
--- a/backends/platform/sdl/graphics.cpp
+++ b/backends/platform/sdl/graphics.cpp
@@ -1226,8 +1226,7 @@ void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
assert(colors);
#ifdef USE_RGB_COLOR
- if (_screenFormat.bytesPerPixel > 1)
- return; //not using a paletted pixel format
+ assert(_screenFormat.bytesPerPixel == 1);
#endif
// Setting the palette before _screen is created is allowed - for now -
@@ -1260,6 +1259,11 @@ void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
void OSystem_SDL::grabPalette(byte *colors, uint start, uint num) {
assert(colors);
+
+#ifdef USE_RGB_COLOR
+ assert(_screenFormat.bytesPerPixel == 1);
+#endif
+
const SDL_Color *base = _currentPalette + start;
for (uint i = 0; i < num; ++i) {