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/tucker | |
| 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/tucker')
| -rw-r--r-- | engines/tucker/locations.cpp | 8 | ||||
| -rw-r--r-- | engines/tucker/sequences.cpp | 33 | ||||
| -rw-r--r-- | engines/tucker/tucker.cpp | 14 | ||||
| -rw-r--r-- | engines/tucker/tucker.h | 2 |
4 files changed, 22 insertions, 35 deletions
diff --git a/engines/tucker/locations.cpp b/engines/tucker/locations.cpp index cd99656695..108c6bcad5 100644 --- a/engines/tucker/locations.cpp +++ b/engines/tucker/locations.cpp @@ -1791,11 +1791,11 @@ void TuckerEngine::execData3PreUpdate_locationNum29() { _updateLocationFadePaletteCounter = 0; } const int d = _updateLocationFadePaletteCounter / 2; - uint8 scrollPal[5 * 4]; + uint8 scrollPal[5 * 3]; for (int i = 0; i < 5; ++i) { - scrollPal[i * 4] = r[i + d]; - scrollPal[i * 4 + 1] = g[i + d]; - scrollPal[i * 4 + 2] = b[i + d]; + scrollPal[i * 3] = r[i + d]; + scrollPal[i * 3 + 1] = g[i + d]; + scrollPal[i * 3 + 2] = b[i + d]; } _system->getPaletteManager()->setPalette(scrollPal, 118, 5); if (_flagsTable[143] == 1) { diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp index 40706aee0f..5e99e3ccef 100644 --- a/engines/tucker/sequences.cpp +++ b/engines/tucker/sequences.cpp @@ -677,14 +677,14 @@ void AnimationSequencePlayer::updateSounds() { } void AnimationSequencePlayer::fadeInPalette() { - uint8 paletteBuffer[256 * 4]; + uint8 paletteBuffer[256 * 3]; memset(paletteBuffer, 0, sizeof(paletteBuffer)); bool fadeColors = true; for (int step = 0; step < 64; ++step) { if (fadeColors) { fadeColors = false; - for (int i = 0; i < 1024; ++i) { - if ((i & 3) != 3 && paletteBuffer[i] < _animationPalette[i]) { + for (int i = 0; i < 3*256; ++i) { + if (paletteBuffer[i] < _animationPalette[i]) { const int color = paletteBuffer[i] + 4; paletteBuffer[i] = MIN<int>(color, _animationPalette[i]); fadeColors = true; @@ -698,14 +698,14 @@ void AnimationSequencePlayer::fadeInPalette() { } void AnimationSequencePlayer::fadeOutPalette() { - uint8 paletteBuffer[256 * 4]; - memcpy(paletteBuffer, _animationPalette, 1024); + uint8 paletteBuffer[256 * 3]; + memcpy(paletteBuffer, _animationPalette, 3*256); bool fadeColors = true; for (int step = 0; step < 64; ++step) { if (fadeColors) { fadeColors = false; - for (int i = 0; i < 1024; ++i) { - if ((i & 3) != 3 && paletteBuffer[i] > 0) { + for (int i = 0; i < 3*256; ++i) { + if (paletteBuffer[i] > 0) { const int color = paletteBuffer[i] - 4; paletteBuffer[i] = MAX<int>(0, color); fadeColors = true; @@ -741,13 +741,7 @@ uint8 *AnimationSequencePlayer::loadPicture(const char *fileName) { } void AnimationSequencePlayer::getRGBPalette(int index) { - const byte *rgbPalette = _flicPlayer[index].getPalette(); - for (int i = 0; i < 256; i++) { - _animationPalette[i * 4 + 0] = rgbPalette[i * 3 + 0]; - _animationPalette[i * 4 + 1] = rgbPalette[i * 3 + 1]; - _animationPalette[i * 4 + 2] = rgbPalette[i * 3 + 2]; - _animationPalette[i * 4 + 3] = 0; - } + memcpy(_animationPalette, _flicPlayer[index].getPalette(), 3 * 256); } void AnimationSequencePlayer::openAnimation(int index, const char *fileName) { @@ -827,9 +821,7 @@ void AnimationSequencePlayer::displayLoadingScreen() { if (f.open("graphics/loading.pic")) { fadeOutPalette(); f.seek(32); - for (int i = 0; i < 1024; i += 4) { - f.read(_animationPalette + i, 3); - } + f.read(_animationPalette, 3 * 256); f.read(_offscreenBuffer, 64000); _system->copyRectToScreen(_offscreenBuffer, 320, 0, 0, kScreenWidth, kScreenHeight); fadeInPalette(); @@ -846,12 +838,7 @@ void AnimationSequencePlayer::initPicPart4() { void AnimationSequencePlayer::drawPicPart4() { static const uint8 offsets[] = { 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1 }; if (_updateScreenIndex == -1) { - for (int i = 0; i < 256; ++i) { - if (memcmp(_animationPalette + i * 4, _picBufPtr + 32 + i * 3, 3) != 0) { - memcpy(_animationPalette + i * 4, _picBufPtr + 32 + i * 3, 3); - _animationPalette[i * 4 + 3] = 0; - } - } + memcpy(_animationPalette, _picBufPtr + 32, 3 * 256); } if (_updateScreenCounter == 0) { static const uint8 counter[] = { 1, 2, 3, 4, 5, 35, 5, 4, 3, 2, 1 }; diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index d4afdaba56..6e44eadc47 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -933,12 +933,12 @@ void TuckerEngine::updateFlagsForCharPosition() { } void TuckerEngine::fadeOutPalette(int colorsCount) { - uint8 pal[256 * 4]; + uint8 pal[256 * 3]; _system->getPaletteManager()->grabPalette(pal, 0, colorsCount); for (int color = 0; color < colorsCount; ++color) { for (int i = 0; i < 3; ++i) { - const int c = int(pal[color * 4 + i]) + kFadePaletteStep * 4; - pal[color * 4 + i] = MIN<int>(c, _currentPalette[color * 3 + i]); + const int c = int(pal[color * 3 + i]) + kFadePaletteStep * 3; + pal[color * 3 + i] = MIN<int>(c, _currentPalette[color * 3 + i]); } } _system->getPaletteManager()->setPalette(pal, 0, colorsCount); @@ -946,12 +946,12 @@ void TuckerEngine::fadeOutPalette(int colorsCount) { } void TuckerEngine::fadeInPalette(int colorsCount) { - uint8 pal[256 * 4]; + uint8 pal[256 * 3]; _system->getPaletteManager()->grabPalette(pal, 0, colorsCount); for (int color = 0; color < colorsCount; ++color) { for (int i = 0; i < 3; ++i) { - const int c = int(pal[color * 4 + i]) - kFadePaletteStep * 4; - pal[color * 4 + i] = MAX<int>(c, 0); + const int c = int(pal[color * 3 + i]) - kFadePaletteStep * 3; + pal[color * 3 + i] = MAX<int>(c, 0); } } _system->getPaletteManager()->setPalette(pal, 0, colorsCount); @@ -969,7 +969,7 @@ void TuckerEngine::fadePaletteColor(int color, int step) { } void TuckerEngine::setBlackPalette() { - uint8 pal[256 * 4]; + uint8 pal[256 * 3]; memset(pal, 0, sizeof(pal)); _system->getPaletteManager()->setPalette(pal, 0, 256); } diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index 6488bbc215..fd931998e4 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -975,7 +975,7 @@ private: const SequenceUpdateFunc *_updateFunc; int _updateFuncIndex; Video::FlicDecoder _flicPlayer[2]; - uint8 _animationPalette[256 * 4]; + uint8 _animationPalette[256 * 3]; int _soundSeqDataCount; int _soundSeqDataIndex; const SoundSequenceData *_soundSeqData; |
