diff options
author | Johannes Schickel | 2011-02-13 14:37:19 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-02-14 17:08:31 +0100 |
commit | 813f503884806c62a28e515ad36f40c7bffd6c0b (patch) | |
tree | 7b4052b2473ec7973bea6730a3cb2dc0a376eb10 /backends/graphics | |
parent | 18ff02a2fa0469eaf6e4bc608ad37243937a054e (diff) | |
download | scummvm-rg350-813f503884806c62a28e515ad36f40c7bffd6c0b.tar.gz scummvm-rg350-813f503884806c62a28e515ad36f40c7bffd6c0b.tar.bz2 scummvm-rg350-813f503884806c62a28e515ad36f40c7bffd6c0b.zip |
SDL: Adapt SDL graphics module to the setPalette/grabPalette RGBA->RGB change.
Diffstat (limited to 'backends/graphics')
-rw-r--r-- | backends/graphics/sdl/sdl-graphics.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 480cf2e795..15d896c57a 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -1337,11 +1337,10 @@ void SdlGraphicsManager::setPalette(const byte *colors, uint start, uint num) { const byte *b = colors; uint i; SDL_Color *base = _currentPalette + start; - for (i = 0; i < num; i++) { + for (i = 0; i < num; i++, b += 3) { base[i].r = b[0]; base[i].g = b[1]; base[i].b = b[2]; - b += 4; } if (start < _paletteDirtyStart) @@ -1365,10 +1364,9 @@ void SdlGraphicsManager::grabPalette(byte *colors, uint start, uint num) { const SDL_Color *base = _currentPalette + start; for (uint i = 0; i < num; ++i) { - colors[i * 4] = base[i].r; - colors[i * 4 + 1] = base[i].g; - colors[i * 4 + 2] = base[i].b; - colors[i * 4 + 3] = 0xFF; + colors[i * 3] = base[i].r; + colors[i * 3 + 1] = base[i].g; + colors[i * 3 + 2] = base[i].b; } } @@ -1377,11 +1375,10 @@ void SdlGraphicsManager::setCursorPalette(const byte *colors, uint start, uint n const byte *b = colors; uint i; SDL_Color *base = _cursorPalette + start; - for (i = 0; i < num; i++) { + for (i = 0; i < num; i++, b += 3) { base[i].r = b[0]; base[i].g = b[1]; base[i].b = b[2]; - b += 4; } _cursorPaletteDisabled = false; |