aboutsummaryrefslogtreecommitdiff
path: root/engines/toon/movie.cpp
diff options
context:
space:
mode:
authorDavid Turner2011-02-07 02:35:17 +0000
committerDavid Turner2011-02-07 02:35:17 +0000
commit5167cd390ca3c28698f7ee6ba77877b8a4a0f474 (patch)
treedb1953b466023c8574a1fa8a83ed4a6842dfd92a /engines/toon/movie.cpp
parentcf918d72e5c959b10b0de162db6cbcfaf08c5e82 (diff)
downloadscummvm-rg350-5167cd390ca3c28698f7ee6ba77877b8a4a0f474.tar.gz
scummvm-rg350-5167cd390ca3c28698f7ee6ba77877b8a4a0f474.tar.bz2
scummvm-rg350-5167cd390ca3c28698f7ee6ba77877b8a4a0f474.zip
TOON: Added workaround for obvious glitch in first intro video.
This glitch occured in the original interpreter and is probably due an encoding error of 209_1M.SMK. svn-id: r55798
Diffstat (limited to 'engines/toon/movie.cpp')
-rw-r--r--engines/toon/movie.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/engines/toon/movie.cpp b/engines/toon/movie.cpp
index d41fde66c2..c6b57d96e2 100644
--- a/engines/toon/movie.cpp
+++ b/engines/toon/movie.cpp
@@ -50,7 +50,7 @@ bool ToonstruckSmackerDecoder::loadFile(const Common::String &filename, int forc
delete _surface;
}
_surface = new Graphics::Surface();
- _surface->create(640, 400, 1);
+ _surface->create(640, 400, 1);
_header.flags = 4;
}
@@ -81,12 +81,15 @@ void Movie::init() const {
void Movie::play(Common::String video, int32 flags) {
debugC(1, kDebugMovie, "play(%s, %d)", video.c_str(), flags);
+ bool isFirstIntroVideo = false;
+ if (video == "209_1M.SMK")
+ isFirstIntroVideo = true;
_playing = true;
if (flags & 1)
_vm->getAudioManager()->setMusicVolume(0);
_decoder->loadFile(video.c_str(), flags);
- playVideo();
+ playVideo(isFirstIntroVideo);
_vm->flushPalette(false);
if (flags & 1)
_vm->getAudioManager()->setMusicVolume(_vm->getAudioManager()->isMusicMuted() ? 0 : 255);
@@ -94,8 +97,8 @@ void Movie::play(Common::String video, int32 flags) {
_playing = false;
}
-bool Movie::playVideo() {
- debugC(1, kDebugMovie, "playVideo()");
+bool Movie::playVideo(bool isFirstIntroVideo) {
+ debugC(1, kDebugMovie, "playVideo(isFirstIntroVideo: %d)", isFirstIntroVideo);
while (!_vm->shouldQuit() && !_decoder->endOfVideo()) {
if (_decoder->needsUpdate()) {
@@ -111,6 +114,18 @@ bool Movie::playVideo() {
_vm->getSystem()->unlockScreen();
} else {
_vm->getSystem()->copyRectToScreen((byte *)frame->pixels, frame->pitch, 0, 0, frame->w, frame->h);
+
+ // WORKAROUND: There is an encoding glitch in the first intro video. This hides this using the adjacent pixels.
+ if (isFirstIntroVideo) {
+ int32 currentFrame = _decoder->getCurFrame();
+ if (currentFrame >= 956 && currentFrame <= 1038) {
+ debugC(1, kDebugMovie, "Triggered workaround for glitch in first intro video...");
+ _vm->getSystem()->copyRectToScreen((const byte *)frame->getBasePtr(frame->w-188, 123), frame->pitch, frame->w-188, 124, 188, 1);
+ _vm->getSystem()->copyRectToScreen((const byte *)frame->getBasePtr(frame->w-188, 126), frame->pitch, frame->w-188, 125, 188, 1);
+ _vm->getSystem()->copyRectToScreen((const byte *)frame->getBasePtr(0, 125), frame->pitch, 0, 126, 64, 1);
+ _vm->getSystem()->copyRectToScreen((const byte *)frame->getBasePtr(0, 128), frame->pitch, 0, 127, 64, 1);
+ }
+ }
}
}
_decoder->setSystemPalette();