[Scummvm-cvs-logs] SF.net SVN: scummvm: [27440] scummvm/trunk/engines/saga/animation.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Jun 16 04:38:19 CEST 2007


Revision: 27440
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27440&view=rev
Author:   thebluegr
Date:     2007-06-15 19:38:17 -0700 (Fri, 15 Jun 2007)

Log Message:
-----------
Rewrote the cutaway initialization part

Modified Paths:
--------------
    scummvm/trunk/engines/saga/animation.cpp

Modified: scummvm/trunk/engines/saga/animation.cpp
===================================================================
--- scummvm/trunk/engines/saga/animation.cpp	2007-06-16 01:59:04 UTC (rev 27439)
+++ scummvm/trunk/engines/saga/animation.cpp	2007-06-16 02:38:17 UTC (rev 27440)
@@ -84,6 +84,16 @@
 
 	_cutAwayFade = fade;
 
+	// Chained cutaway, clean up the previous cutaway
+	if (_cutawayActive) {
+		returnFromCutaway();
+
+		// This is used because when AM is zapping the child's mother in Benny's chapter, 
+		// there is a cutaway followed by a video. The video needs to start immediately after
+		// the cutaway so that it looks like the original
+		startImmediately = true;
+	}
+
 	_vm->_gfx->savePalette();
 
 	// TODO
@@ -103,33 +113,18 @@
 		_vm->_events->queue(&event);
 	}*/
 
-	if (!_cutawayActive) {
-		_vm->_gfx->showCursor(false);
-		_vm->_interface->setStatusText("");
-		_vm->_interface->setSaveReminderState(0);
-		_vm->_interface->rememberMode();
-		if (_cutAwayMode == kPanelVideo)
-			_vm->_interface->setMode(kPanelVideo);
-		else
-			_vm->_interface->setMode(kPanelCutaway);
-		_cutawayActive = true;
-	} else {
-		// HACK: Chained cutaways don't behave properly with our event system, leading to 
-		// crashes. We need to clear all the current cutaways (like clearcutaway does) and make
-		// sure that the next cutaway or video is started immediately. This avoids crashes
-		// with chained cutaways and videos, without causing any side effects, but this is not
-		// in the original interpreter.
-		// The only chained cutaways I've seen up to now are in Ben's chapter. 
-		// FIXME: Is there a more elegant solution for this?
-		for (int i = 0; i < ARRAYSIZE(_cutawayAnimations); i++) {
-			delete _cutawayAnimations[i];
-			_cutawayAnimations[i] = NULL;
-		}
-		startImmediately = true;
-	}
+	// Prepare cutaway
+	_vm->_gfx->showCursor(false);
+	_vm->_interface->setStatusText("");
+	_vm->_interface->setSaveReminderState(0);
+	_vm->_interface->rememberMode();
+	if (_cutAwayMode == kPanelVideo)
+		_vm->_interface->setMode(kPanelVideo);
+	else
+		_vm->_interface->setMode(kPanelCutaway);
+	_cutawayActive = true;
 
 	// Set the initial background and palette for the cutaway
-
 	ResourceContext *context = _vm->_resource->getContext(GAME_RESOURCEFILE);
 
 	byte *resourceData;


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