aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Montoir2010-06-06 13:31:19 +0000
committerGregory Montoir2010-06-06 13:31:19 +0000
commit8e6cc1201a43dbba52daa528c07622f02d121c3d (patch)
tree0e89388a4b3585237d4b915d0dfbf6ab91d549c6
parent43c353d9308515e0ce4d73773e50810f9e89ae47 (diff)
downloadscummvm-rg350-8e6cc1201a43dbba52daa528c07622f02d121c3d.tar.gz
scummvm-rg350-8e6cc1201a43dbba52daa528c07622f02d121c3d.tar.bz2
scummvm-rg350-8e6cc1201a43dbba52daa528c07622f02d121c3d.zip
use palette image during sequence 3 scrolling
svn-id: r49452
-rw-r--r--engines/tucker/sequences.cpp30
-rw-r--r--engines/tucker/tucker.h3
2 files changed, 21 insertions, 12 deletions
diff --git a/engines/tucker/sequences.cpp b/engines/tucker/sequences.cpp
index 68f5301a80..e8e81bde2d 100644
--- a/engines/tucker/sequences.cpp
+++ b/engines/tucker/sequences.cpp
@@ -491,7 +491,6 @@ AnimationSequencePlayer::AnimationSequencePlayer(OSystem *system, Audio::Mixer *
_offscreenBuffer = (uint8 *)malloc(kScreenWidth * kScreenHeight);
_updateScreenWidth = 0;
_updateScreenPicture = false;
- _updateScreenOffset = 0;
_picBufPtr = _pic2BufPtr = 0;
}
@@ -841,19 +840,28 @@ void AnimationSequencePlayer::displayLoadingScreen() {
void AnimationSequencePlayer::initPicPart4() {
_updateScreenWidth = 320;
_updateScreenPicture = true;
- _updateScreenOffset = 0;
+ _updateScreenCounter = 0;
+ _updateScreenIndex = -1;
}
void AnimationSequencePlayer::drawPicPart4() {
- static const uint8 offsetsTable[77] = {
- 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4,
- 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3,
- 3, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1
- };
- _updateScreenWidth = _updateScreenWidth - offsetsTable[_updateScreenOffset];
- ++_updateScreenOffset;
+ 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;
+ }
+ }
+ }
+ if (_updateScreenCounter == 0) {
+ static const uint8 counter[] = { 1, 2, 3, 4, 5, 35, 5, 4, 3, 2, 1 };
+ ++_updateScreenIndex;
+ assert(_updateScreenIndex < ARRAYSIZE(counter));
+ _updateScreenCounter = counter[_updateScreenIndex];
+ }
+ --_updateScreenCounter;
+ _updateScreenWidth -= offsets[_updateScreenIndex];
for (int y = 0; y < 200; ++y) {
memcpy(_offscreenBuffer + y * 320, _picBufPtr + 800 + y * 640 + _updateScreenWidth, 320);
}
diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h
index d9810c7929..d33b9d1e07 100644
--- a/engines/tucker/tucker.h
+++ b/engines/tucker/tucker.h
@@ -975,7 +975,8 @@ private:
uint8 *_offscreenBuffer;
int _updateScreenWidth;
int _updateScreenPicture;
- int _updateScreenOffset;
+ int _updateScreenCounter;
+ int _updateScreenIndex;
int _frameCounter;
int _frameTime;
uint32 _lastFrameTime;