[Scummvm-cvs-logs] SF.net SVN: scummvm: [31149] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Mar 16 19:24:46 CET 2008


Revision: 31149
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31149&view=rev
Author:   lordhoto
Date:     2008-03-16 11:24:45 -0700 (Sun, 16 Mar 2008)

Log Message:
-----------
- implemented skip flag handling in wsa related opcodes
- implemented skip flag handling in o2_isVoicePlaying
- fixed skip flag handling when making the cauldron appear.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_v2.cpp
    scummvm/trunk/engines/kyra/script_v2.cpp

Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-03-16 17:43:41 UTC (rev 31148)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-03-16 18:24:45 UTC (rev 31149)
@@ -821,7 +821,7 @@
 			updateInput();
 		}
 
-		if (amount > 0 )
+		if (amount > 0)
 			_system->delayMillis(amount > 10 ? 10 : amount);
 	} while (!skipFlag() && _system->getMillis() < start + amount && !_quitFlag);
 }
@@ -1763,8 +1763,13 @@
 	if (run) {
 		while (_invWsa.running && !skipFlag() && !_quitFlag) {
 			update();
-			//XXX delay?
+			_system->delayMillis(10);
 		}
+
+		if (skipFlag()) {
+			resetSkipFlag();
+			displayInvWsaLastFrame();
+		}
 	}
 }
 

Modified: scummvm/trunk/engines/kyra/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-16 17:43:41 UTC (rev 31148)
+++ scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-16 18:24:45 UTC (rev 31149)
@@ -231,9 +231,9 @@
 
 	_screen->hideMouse();
 	int curTime = 0;
-	while (curTime < maxTimes) {
+	while (curTime < maxTimes && !skipFlag()) {
 		if (startFrame < endFrame) {
-			for (int i = startFrame; i <= endFrame; ++i) {
+			for (int i = startFrame; i <= endFrame && !skipFlag(); ++i) {
 				uint32 endTime = _system->getMillis() + waitTime * _tickLength;
 				_wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags);
 				_screen->updateScreen();
@@ -246,7 +246,7 @@
 				} while (_system->getMillis() < endTime);
 			}
 		} else {
-			for (int i = startFrame; i >= endFrame; --i) {
+			for (int i = startFrame; i >= endFrame && !skipFlag(); --i) {
 				uint32 endTime = _system->getMillis() + waitTime * _tickLength;
 				_wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags);
 				_screen->updateScreen();
@@ -262,6 +262,7 @@
 
 		++curTime;
 	}
+	resetSkipFlag();
 	_screen->showMouse();
 	return 0;
 }
@@ -288,13 +289,14 @@
 	
 	_screen->hideMouse();
 
-	while (currentFrame <= lastFrame) {	
+	while (currentFrame <= lastFrame && !skipFlag()) {	
 		uint32 endTime = _system->getMillis() + frameDelay;
 		_wsaSlots[index]->displayFrame(currentFrame++, copyParam);
 		_screen->updateScreen();
 		delayUntil(endTime);
 	}
 
+	resetSkipFlag();
 	_screen->showMouse();
 
 	return 0;
@@ -317,7 +319,7 @@
 	int currentFrame = 0;
 	const int lastFrame = _wsaSlots[index]->frames();
 
-	while (currentFrame <= lastFrame) {	
+	while (currentFrame <= lastFrame && !skipFlag()) {	
 		uint32 endTime = _system->getMillis() + frameDelay;
 		_wsaSlots[index]->displayFrame(currentFrame++, copyParam);
 		if (doUpdate)
@@ -326,6 +328,7 @@
 		delayUntil(endTime);
 	}
 
+	resetSkipFlag();
 	_screen->showMouse();
 
 	return 0;
@@ -1293,7 +1296,7 @@
 
 int KyraEngine_v2::o2_isVoicePlaying(ScriptState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "o2_isVoicePlaying(%p) ()", (const void *)script);
-	return snd_voiceIsPlaying() ? 1 : 0;
+	return (snd_voiceIsPlaying() && !skipFlag()) ? 1 : 0;
 }
 
 int KyraEngine_v2::o2_stopVoicePlaying(ScriptState *script) {


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