diff options
author | Johannes Schickel | 2011-02-13 20:10:34 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-02-14 17:08:33 +0100 |
commit | bb9e82c3b3f56ac9fd985c8f8d22f6d1dc0cc5e7 (patch) | |
tree | cbeee36c1a19fbcefffcb93db97087eef6879617 | |
parent | bba430eebc2a0701b9cea5fd5cc57ec1da87a5c9 (diff) | |
download | scummvm-rg350-bb9e82c3b3f56ac9fd985c8f8d22f6d1dc0cc5e7.tar.gz scummvm-rg350-bb9e82c3b3f56ac9fd985c8f8d22f6d1dc0cc5e7.tar.bz2 scummvm-rg350-bb9e82c3b3f56ac9fd985c8f8d22f6d1dc0cc5e7.zip |
SCUMM: Adapt to setPalette RGBA->RGB change.
-rw-r--r-- | engines/scumm/cursor.cpp | 6 | ||||
-rw-r--r-- | engines/scumm/he/cup_player_he.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/he/cup_player_he.h | 2 | ||||
-rw-r--r-- | engines/scumm/he/palette_he.cpp | 15 | ||||
-rw-r--r-- | engines/scumm/palette.cpp | 6 | ||||
-rw-r--r-- | engines/scumm/smush/smush_player.cpp | 14 |
6 files changed, 9 insertions, 38 deletions
diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 8e211a5041..f49635d10f 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -176,9 +176,9 @@ void ScummEngine_v70he::setCursorFromImg(uint img, uint room, uint imgindex) { void ScummEngine_v70he::setDefaultCursor() { const uint16 *src; int i, j; - static const byte palette[] = {0, 0, 0, 0, - 0xff, 0xff, 0xff, 0, - 0, 0, 0, 0}; + static const byte palette[] = {0, 0, 0, + 0xff, 0xff, 0xff, + 0, 0, 0, }; if (_bytesPerPixel == 2) { for (i = 0; i < 1024; i++) diff --git a/engines/scumm/he/cup_player_he.cpp b/engines/scumm/he/cup_player_he.cpp index 516ff6b977..79bb47aafc 100644 --- a/engines/scumm/he/cup_player_he.cpp +++ b/engines/scumm/he/cup_player_he.cpp @@ -298,9 +298,7 @@ void CUP_Player::handleSFXB(Common::SeekableReadStream &dataStream, uint32 dataS } void CUP_Player::handleRGBS(Common::SeekableReadStream &dataStream, uint32 dataSize) { - for (int i = 0; i < 256; i++) { - dataStream.read(&_paletteData[i * 4], 3); - } + dataStream.read(_paletteData, 256 * 3); _paletteChanged = true; } diff --git a/engines/scumm/he/cup_player_he.h b/engines/scumm/he/cup_player_he.h index 1b1c32d86f..93146fdf85 100644 --- a/engines/scumm/he/cup_player_he.h +++ b/engines/scumm/he/cup_player_he.h @@ -90,7 +90,7 @@ protected: int _playbackRate; int _width, _height; - uint8 _paletteData[256 * 4]; + uint8 _paletteData[256 * 3]; bool _paletteChanged; uint8 *_offscreenBuffer; diff --git a/engines/scumm/he/palette_he.cpp b/engines/scumm/he/palette_he.cpp index c7ed9e64a8..b42d6e97e2 100644 --- a/engines/scumm/he/palette_he.cpp +++ b/engines/scumm/he/palette_he.cpp @@ -380,21 +380,8 @@ void ScummEngine_v99he::updatePalette() { return; int num = _palDirtyMax - _palDirtyMin + 1; - int i; - - byte palette_colors[1024]; - byte *p = palette_colors; - - for (i = _palDirtyMin; i <= _palDirtyMax; i++) { - byte *data = _hePalettes + 1024 + i * 3; - - *p++ = data[0]; - *p++ = data[1]; - *p++ = data[2]; - *p++ = 0; - } - _system->getPaletteManager()->setPalette(palette_colors, _palDirtyMin, num); + _system->getPaletteManager()->setPalette(_hePalettes + 1024 + _palDirtyMin * 3, _palDirtyMin, num); _palDirtyMax = -1; _palDirtyMin = 256; diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp index 52592cd90e..18784151b7 100644 --- a/engines/scumm/palette.cpp +++ b/engines/scumm/palette.cpp @@ -1081,7 +1081,7 @@ void ScummEngine::updatePalette() { int num = _palDirtyMax - first + 1; int i; - byte palette_colors[1024]; + byte palette_colors[3 * 256]; byte *p = palette_colors; for (i = _palDirtyMin; i <= _palDirtyMax; i++) { @@ -1108,12 +1108,10 @@ void ScummEngine::updatePalette() { *p++ = brightness; *p++ = brightness; *p++ = brightness; - *p++ = 0; } else { *p++ = data[0]; *p++ = data[1]; *p++ = data[2]; - *p++ = 0; } } @@ -1126,7 +1124,7 @@ void ScummEngine::updatePalette() { p = palette_colors; for (i = first; i < first + num; ++i) { _16BitPalette[i] = get16BitColor(p[0], p[1], p[2]); - p += 4; + p += 3; } return; } diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index ad8a135a7c..fe2b9d99ff 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -1217,19 +1217,7 @@ void SmushPlayer::play(const char *filename, int32 speed, int32 offset, int32 st _vm->parseEvents(); _vm->processInput(); if (_palDirtyMax >= _palDirtyMin) { - byte palette_colors[1024]; - byte *p = palette_colors; - - for (int i = _palDirtyMin; i <= _palDirtyMax; i++) { - byte *data = _pal + i * 3; - - *p++ = data[0]; - *p++ = data[1]; - *p++ = data[2]; - *p++ = 0; - } - - _vm->_system->getPaletteManager()->setPalette(palette_colors, _palDirtyMin, _palDirtyMax - _palDirtyMin + 1); + _vm->_system->getPaletteManager()->setPalette(_pal + _palDirtyMin * 3, _palDirtyMin, _palDirtyMax - _palDirtyMin + 1); _palDirtyMax = -1; _palDirtyMin = 256; |