diff options
| author | Johannes Schickel | 2011-02-19 21:42:34 +0100 |
|---|---|---|
| committer | Johannes Schickel | 2011-02-19 21:46:45 +0100 |
| commit | e21d6e0d1120e917a4a019a4070ec4db5e988b9b (patch) | |
| tree | 1142828b72ccf17d513c621e108d749f148fd32b /engines/touche | |
| parent | 32d0e4c15fb33f80db194087850466664a43516a (diff) | |
| parent | b26f30b98793c522265a3eeb48fb3b41034663c6 (diff) | |
| download | scummvm-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 'engines/touche')
| -rw-r--r-- | engines/touche/resource.cpp | 5 | ||||
| -rw-r--r-- | engines/touche/touche.cpp | 18 | ||||
| -rw-r--r-- | engines/touche/touche.h | 2 |
3 files changed, 10 insertions, 15 deletions
diff --git a/engines/touche/resource.cpp b/engines/touche/resource.cpp index df7992f26c..3c108e2931 100644 --- a/engines/touche/resource.cpp +++ b/engines/touche/resource.cpp @@ -423,10 +423,7 @@ void ToucheEngine::res_loadRoom(int num) { _fData.skip(2); const int roomImageNum = _fData.readUint16LE(); _fData.skip(2); - for (int i = 0; i < 256; ++i) { - _fData.read(&_paletteBuffer[i * 4], 3); - _paletteBuffer[i * 4 + 3] = 0; - } + _fData.read(_paletteBuffer, 3 * 256); const uint32 offsImage = res_getDataOffset(kResourceTypeRoomImage, roomImageNum); _fData.seek(offsImage); diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index ff8b0d944e..97d533f29f 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -3243,23 +3243,21 @@ void ToucheEngine::clearDirtyRects() { } void ToucheEngine::setPalette(int firstColor, int colorCount, int rScale, int gScale, int bScale) { - uint8 pal[256 * 4]; + uint8 pal[256 * 3]; for (int i = firstColor; i < firstColor + colorCount; ++i) { - int r = _paletteBuffer[i * 4 + 0]; + int r = _paletteBuffer[i * 3 + 0]; r = (r * rScale) >> 8; - pal[i * 4 + 0] = (uint8)r; + pal[i * 3 + 0] = (uint8)r; - int g = _paletteBuffer[i * 4 + 1]; + int g = _paletteBuffer[i * 3 + 1]; g = (g * gScale) >> 8; - pal[i * 4 + 1] = (uint8)g; + pal[i * 3 + 1] = (uint8)g; - int b = _paletteBuffer[i * 4 + 2]; + int b = _paletteBuffer[i * 3 + 2]; b = (b * bScale) >> 8; - pal[i * 4 + 2] = (uint8)b; - - pal[i * 4 + 3] = 0; + pal[i * 3 + 2] = (uint8)b; } - _system->getPaletteManager()->setPalette(&pal[firstColor * 4], firstColor, colorCount); + _system->getPaletteManager()->setPalette(&pal[firstColor * 3], firstColor, colorCount); } void ToucheEngine::updateScreenArea(int x, int y, int w, int h) { diff --git a/engines/touche/touche.h b/engines/touche/touche.h index 8b5f14d926..1580d072e6 100644 --- a/engines/touche/touche.h +++ b/engines/touche/touche.h @@ -781,7 +781,7 @@ protected: int _fullRedrawCounter; int _menuRedrawCounter; uint8 *_offscreenBuffer; - uint8 _paletteBuffer[256 * 4]; + uint8 _paletteBuffer[256 * 3]; Common::Rect _dirtyRectsTable[NUM_DIRTY_RECTS]; int _dirtyRectsTableCount; |
