diff options
Diffstat (limited to 'engines')
-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 50a5c6e439..a074bb4492 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; |