[Scummvm-cvs-logs] SF.net SVN: scummvm:[55798] scummvm/trunk/engines/toon

tdhs at users.sourceforge.net tdhs at users.sourceforge.net
Mon Feb 7 03:35:17 CET 2011


Revision: 55798
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55798&view=rev
Author:   tdhs
Date:     2011-02-07 02:35:17 +0000 (Mon, 07 Feb 2011)

Log Message:
-----------
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.

Modified Paths:
--------------
    scummvm/trunk/engines/toon/movie.cpp
    scummvm/trunk/engines/toon/movie.h

Modified: scummvm/trunk/engines/toon/movie.cpp
===================================================================
--- scummvm/trunk/engines/toon/movie.cpp	2011-02-07 01:56:30 UTC (rev 55797)
+++ scummvm/trunk/engines/toon/movie.cpp	2011-02-07 02:35:17 UTC (rev 55798)
@@ -50,7 +50,7 @@
 				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::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 @@
 	_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 @@
 					_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();

Modified: scummvm/trunk/engines/toon/movie.h
===================================================================
--- scummvm/trunk/engines/toon/movie.h	2011-02-07 01:56:30 UTC (rev 55797)
+++ scummvm/trunk/engines/toon/movie.h	2011-02-07 02:35:17 UTC (rev 55798)
@@ -52,7 +52,7 @@
 	bool isPlaying() { return _playing; }
 
 protected:
-	bool playVideo();
+	bool playVideo(bool isFirstIntroVideo);
 	ToonEngine *_vm;
 	Audio::Mixer *_mixer;
 	ToonstruckSmackerDecoder *_decoder;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list