aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2011-02-13 20:33:48 +0100
committerJohannes Schickel2011-02-14 17:08:33 +0100
commit16ac1290ddaf29e65893ed95bad7b7e5602e87ef (patch)
tree85f44f47d83b3489df19fd41505b2495cbacbb13 /engines
parent42bc90dde00b8df925e5284bb26efd4ff13bb12a (diff)
downloadscummvm-rg350-16ac1290ddaf29e65893ed95bad7b7e5602e87ef.tar.gz
scummvm-rg350-16ac1290ddaf29e65893ed95bad7b7e5602e87ef.tar.bz2
scummvm-rg350-16ac1290ddaf29e65893ed95bad7b7e5602e87ef.zip
TOUCHE: Adapt to setPalette RGBA->RGB change.
This change was not tested, because I do not have any touche copy.
Diffstat (limited to 'engines')
-rw-r--r--engines/touche/resource.cpp5
-rw-r--r--engines/touche/touche.cpp18
-rw-r--r--engines/touche/touche.h2
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;