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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Apr 27 14:40:57 CEST 2008


Revision: 31752
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31752&view=rev
Author:   lordhoto
Date:     2008-04-27 05:40:56 -0700 (Sun, 27 Apr 2008)

Log Message:
-----------
Moved newShape code to sequences_v3.cpp

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/animator_v3.cpp
    scummvm/trunk/engines/kyra/sequences_v3.cpp

Modified: scummvm/trunk/engines/kyra/animator_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/animator_v3.cpp	2008-04-27 12:39:16 UTC (rev 31751)
+++ scummvm/trunk/engines/kyra/animator_v3.cpp	2008-04-27 12:40:56 UTC (rev 31752)
@@ -532,79 +532,6 @@
 	_nextIdleType = !_nextIdleType;
 }
 
-int KyraEngine_v3::initNewShapes(uint8 *filedata) {
-	debugC(9, kDebugLevelAnimator, "KyraEngine_v3::initNewShapes(%p)", (const void*)filedata);
-	const int lastEntry = MIN(_newShapeLastEntry, 41);
-	for (int i = 0; i < lastEntry; ++i)
-		_gameShapes[9+i] = _screen->getPtrToShape(filedata, i);
-	return lastEntry;
-}
-
-void KyraEngine_v3::processNewShapes(int allowSkip, int resetChar) {
-	debugC(9, kDebugLevelAnimator, "KyraEngine_v3::processNewShapes(%d, %d)", allowSkip, resetChar);
-	setCharacterAnimDim(_newShapeWidth, _newShapeHeight);
-
-	_scriptInterpreter->initScript(&_temporaryScriptState, &_temporaryScriptData);
-	_scriptInterpreter->startScript(&_temporaryScriptState, 1);
-
-	resetSkipFlag();
-
-	while (_scriptInterpreter->validScript(&_temporaryScriptState)) {
-		_temporaryScriptExecBit = false;
-		while (_scriptInterpreter->validScript(&_temporaryScriptState) && !_temporaryScriptExecBit)
-			_scriptInterpreter->runScript(&_temporaryScriptState);
-
-		if (_newShapeAnimFrame < 0)
-			continue;
-
-		_mainCharacter.animFrame = _newShapeAnimFrame + 9;
-		updateCharacterAnim(0);
-		if (_chatText)
-			updateWithText();
-		else
-			update();
-
-		uint32 delayEnd = _system->getMillis() + _newShapeDelay * _tickLength;
-
-		while ((!skipFlag() || !allowSkip) && _system->getMillis() < delayEnd) {
-			if (_chatText)
-				updateWithText();
-			else
-				update();
-
-			delay(10);
-		}
-
-		if (skipFlag())
-			resetSkipFlag();
-	}
-
-	if (resetChar) {
-		if (_newShapeFlag >= 0) {
-			_mainCharacter.animFrame = _newShapeFlag + 9;
-			updateCharacterAnim(0);
-			if (_chatText)
-				updateWithText();
-			else
-				update();
-		}
-
-		_mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
-		updateCharacterAnim(0);
-	}
-
-	_newShapeFlag = -1;
-	resetCharacterAnimDim();
-}
-
-void KyraEngine_v3::resetNewShapes(int count, uint8 *filedata) {
-	debugC(9, kDebugLevelAnimator, "KyraEngine_v3::resetNewShapes(%d, %p)", count, (const void*)filedata);
-	for (int i = 0; i < count; ++i)
-		_gameShapes[9+i] = 0;
-	delete [] filedata;
-	setNextIdleAnimTimer();
-}
-
 void KyraEngine_v3::addItemToAnimList(int item) {
 	debugC(9, kDebugLevelAnimator, "KyraEngine_v3::addItemToAnimList(%d)", item);
 	restorePage3();

Modified: scummvm/trunk/engines/kyra/sequences_v3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sequences_v3.cpp	2008-04-27 12:39:16 UTC (rev 31751)
+++ scummvm/trunk/engines/kyra/sequences_v3.cpp	2008-04-27 12:40:56 UTC (rev 31752)
@@ -169,6 +169,9 @@
 
 	objectChat((const char*)getTableEntry(_cCodeFile, 35), 0, 204, 35);
 	objectChat((const char*)getTableEntry(_cCodeFile, 40), 0, 204, 40);
+
+	setGameFlag(0xD1);
+
 	playSoundEffect(0x2A, 0xC8);
 
 	setGameFlag(0x171);
@@ -200,5 +203,78 @@
 	_screen->showMouse();
 }
 
+int KyraEngine_v3::initNewShapes(uint8 *filedata) {
+	debugC(9, kDebugLevelAnimator, "KyraEngine_v3::initNewShapes(%p)", (const void*)filedata);
+	const int lastEntry = MIN(_newShapeLastEntry, 41);
+	for (int i = 0; i < lastEntry; ++i)
+		_gameShapes[9+i] = _screen->getPtrToShape(filedata, i);
+	return lastEntry;
+}
+
+void KyraEngine_v3::processNewShapes(int allowSkip, int resetChar) {
+	debugC(9, kDebugLevelAnimator, "KyraEngine_v3::processNewShapes(%d, %d)", allowSkip, resetChar);
+	setCharacterAnimDim(_newShapeWidth, _newShapeHeight);
+
+	_scriptInterpreter->initScript(&_temporaryScriptState, &_temporaryScriptData);
+	_scriptInterpreter->startScript(&_temporaryScriptState, 1);
+
+	resetSkipFlag();
+
+	while (_scriptInterpreter->validScript(&_temporaryScriptState)) {
+		_temporaryScriptExecBit = false;
+		while (_scriptInterpreter->validScript(&_temporaryScriptState) && !_temporaryScriptExecBit)
+			_scriptInterpreter->runScript(&_temporaryScriptState);
+
+		if (_newShapeAnimFrame < 0)
+			continue;
+
+		_mainCharacter.animFrame = _newShapeAnimFrame + 9;
+		updateCharacterAnim(0);
+		if (_chatText)
+			updateWithText();
+		else
+			update();
+
+		uint32 delayEnd = _system->getMillis() + _newShapeDelay * _tickLength;
+
+		while ((!skipFlag() || !allowSkip) && _system->getMillis() < delayEnd) {
+			if (_chatText)
+				updateWithText();
+			else
+				update();
+
+			delay(10);
+		}
+
+		if (skipFlag())
+			resetSkipFlag();
+	}
+
+	if (resetChar) {
+		if (_newShapeFlag >= 0) {
+			_mainCharacter.animFrame = _newShapeFlag + 9;
+			updateCharacterAnim(0);
+			if (_chatText)
+				updateWithText();
+			else
+				update();
+		}
+
+		_mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
+		updateCharacterAnim(0);
+	}
+
+	_newShapeFlag = -1;
+	resetCharacterAnimDim();
+}
+
+void KyraEngine_v3::resetNewShapes(int count, uint8 *filedata) {
+	debugC(9, kDebugLevelAnimator, "KyraEngine_v3::resetNewShapes(%d, %p)", count, (const void*)filedata);
+	for (int i = 0; i < count; ++i)
+		_gameShapes[9+i] = 0;
+	delete [] filedata;
+	setNextIdleAnimTimer();
+}
+
 } // end of namespace Kyra
 


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