[Scummvm-cvs-logs] SF.net SVN: scummvm:[53474] scummvm/trunk/engines/sword25/fmv

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Fri Oct 15 12:52:23 CEST 2010


Revision: 53474
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53474&view=rev
Author:   dreammaster
Date:     2010-10-15 10:52:23 +0000 (Fri, 15 Oct 2010)

Log Message:
-----------
SWORD25: Fix unloading of movies so the menu animation properly loops

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
    scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp

Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.cpp	2010-10-15 09:08:54 UTC (rev 53473)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.cpp	2010-10-15 10:52:23 UTC (rev 53474)
@@ -130,17 +130,21 @@
 void MoviePlayer::update() {
 	if (_decoder.isVideoLoaded()) {
 		Graphics::Surface *s = _decoder.decodeNextFrame();
+		if (s) {
+			// Transfer the next frame
+			assert(s->bytesPerPixel == 4);
 
-		// Transfer the next frame
-		assert(s->bytesPerPixel == 4);
-
 #if INDIRECTRENDERING
-		byte *frameData = (byte *)s->getBasePtr(0, 0);
-		_outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch);
+			byte *frameData = (byte *)s->getBasePtr(0, 0);
+			_outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch);
 #else
-		g_system->copyRectToScreen((byte *)s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h));
-		g_system->updateScreen();
+			g_system->copyRectToScreen((byte *)s->getBasePtr(0, 0), s->pitch, _outX, _outY, MIN(s->w, _backSurface->w), MIN(s->h, _backSurface->h));
+			g_system->updateScreen();
 #endif
+		} else {
+			// Movie complete, so unload the movie
+			unloadMovie();
+		}
 	}
 }
 

Modified: scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp	2010-10-15 09:08:54 UTC (rev 53473)
+++ scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp	2010-10-15 10:52:23 UTC (rev 53474)
@@ -399,8 +399,7 @@
 	}
 
 	if (!_videobufReady && !_audiobufReady && _fileStream->eos()) {
-		close();
-		return _surface;
+		return NULL;
 	}
 
 	if (!_videobufReady || !_audiobufReady) {


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