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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Wed Mar 26 22:52:28 CET 2008


Revision: 31253
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31253&view=rev
Author:   lordhoto
Date:     2008-03-26 14:52:28 -0700 (Wed, 26 Mar 2008)

Log Message:
-----------
- reworked skip flag handling in some places again
- hopefully fixed tons of warnings related to stackPosString

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

Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-03-26 21:39:44 UTC (rev 31252)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-03-26 21:52:28 UTC (rev 31253)
@@ -1573,7 +1573,7 @@
 
 	resetSkipFlag();
 
-	while (_scriptInterpreter->validScript(&_temporaryScriptState) && !skipFlag()) {
+	while (_scriptInterpreter->validScript(&_temporaryScriptState)) {
 		_temporaryScriptExecBit = false;
 		while (_scriptInterpreter->validScript(&_temporaryScriptState) && !_temporaryScriptExecBit)
 			_scriptInterpreter->runScript(&_temporaryScriptState);

Modified: scummvm/trunk/engines/kyra/script.h
===================================================================
--- scummvm/trunk/engines/kyra/script.h	2008-03-26 21:39:44 UTC (rev 31252)
+++ scummvm/trunk/engines/kyra/script.h	2008-03-26 21:52:28 UTC (rev 31253)
@@ -53,7 +53,7 @@
 };
 
 #define stackPos(x) (script->stack[script->sp+x])
-#define stackPosString(x) ((const char*)&script->dataPtr->text[READ_BE_UINT16(&((uint16 *)script->dataPtr->text)[stackPos(x)])])
+#define stackPosString(x) ((const char*)&script->dataPtr->text[READ_BE_UINT16(&script->dataPtr->text[stackPos(x)<<1])])
 
 #define FORM_CHUNK 0x4D524F46
 #define TEXT_CHUNK 0x54584554

Modified: scummvm/trunk/engines/kyra/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-26 21:39:44 UTC (rev 31252)
+++ scummvm/trunk/engines/kyra/script_v2.cpp	2008-03-26 21:52:28 UTC (rev 31253)
@@ -283,27 +283,33 @@
 			for (int i = startFrame; i <= endFrame; ++i) {
 				uint32 endTime = _system->getMillis() + waitTime * _tickLength;
 				_wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags, 0, 0);
-				_screen->updateScreen();
 
-				do {
-					update();
+				if (!skipFlag()) {
+					_screen->updateScreen();
 
-					if (endTime - _system->getMillis() >= 10 && !skipFlag())
-						delay(10);
-				} while (_system->getMillis() < endTime && !skipFlag());
+					do {
+						update();
+
+						if (endTime - _system->getMillis() >= 10)
+							delay(10);
+					} while (_system->getMillis() < endTime);
+				}
 			}
 		} else {
 			for (int i = startFrame; i >= endFrame; --i) {
 				uint32 endTime = _system->getMillis() + waitTime * _tickLength;
 				_wsaSlots[slot]->displayFrame(i, 0xC000 | copyFlags, 0, 0);
-				_screen->updateScreen();
 
-				do {
-					update();
+				if (!skipFlag()) {
+					_screen->updateScreen();
 
-					if (endTime - _system->getMillis() >= 10 && !skipFlag())
-						delay(10);
-				} while (_system->getMillis() < endTime && !skipFlag());
+					do {
+						update();
+
+						if (endTime - _system->getMillis() >= 10 && !skipFlag())
+							delay(10);
+					} while (_system->getMillis() < endTime && !skipFlag());
+				}
 			}
 		}
 
@@ -339,8 +345,10 @@
 	while (currentFrame <= lastFrame) {	
 		uint32 endTime = _system->getMillis() + frameDelay;
 		_wsaSlots[index]->displayFrame(currentFrame++, copyParam, 0, 0);
-		_screen->updateScreen();
-		delayUntil(endTime);
+		if (!skipFlag()) {
+			_screen->updateScreen();
+			delayUntil(endTime);
+		}
 	}
 
 	resetSkipFlag();
@@ -369,10 +377,12 @@
 	while (currentFrame <= lastFrame) {	
 		uint32 endTime = _system->getMillis() + frameDelay;
 		_wsaSlots[index]->displayFrame(currentFrame++, copyParam, 0, 0);
-		if (doUpdate)
-			update();
-		_screen->updateScreen();
-		delayUntil(endTime);
+		if (!skipFlag()) {
+			if (doUpdate)
+				update();
+			_screen->updateScreen();
+			delayUntil(endTime);
+		}
 	}
 
 	resetSkipFlag();


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