diff options
author | Johannes Schickel | 2010-01-07 15:28:58 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-01-07 15:28:58 +0000 |
commit | 71b4b3dcba134a76d7490daf65523a6042efb94d (patch) | |
tree | 67ecb17c8aaa39636dc64ee8598201a6c9063fd8 /backends/platform | |
parent | 4f463e288e99c9b2adecfe91065da9cbd74950bf (diff) | |
download | scummvm-rg350-71b4b3dcba134a76d7490daf65523a6042efb94d.tar.gz scummvm-rg350-71b4b3dcba134a76d7490daf65523a6042efb94d.tar.bz2 scummvm-rg350-71b4b3dcba134a76d7490daf65523a6042efb94d.zip |
- Adapt documentation, that keycolor in setMouseCursor may not exceed the maximum color value of the specified format.
- Change SDL backend to assert out on invalid keycolor values
In case we really need a way to specify "no keycolor" we need to
discuss on how to do it *properly*.
svn-id: r47123
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/sdl/graphics.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index e02e2f0d1d..ce3647d6fb 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -1490,9 +1490,11 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, _cursorFormat = Graphics::PixelFormat::createFormatCLUT8(); else if (format->bytesPerPixel <= _screenFormat.bytesPerPixel) _cursorFormat = *format; - keycolor &= (1 << (_cursorFormat.bytesPerPixel << 3)) - 1; + + if (_cursorFormat.bytesPerPixel < 4) + assert(keycolor < (uint)(1 << (_cursorFormat.bytesPerPixel << 3))); #else - keycolor &= 0xFF; + assert(keycolor <= 0xFF); #endif if (w == 0 || h == 0) |