[Scummvm-cvs-logs] CVS: scummvm/saga saga.cpp,1.122,1.123 saga.h,1.111,1.112 script.h,1.98,1.99 sthread.cpp,1.91,1.92

Eugene Sandulenko sev at users.sourceforge.net
Sat Jul 30 07:45:06 CEST 2005


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7068

Modified Files:
	saga.cpp saga.h script.h sthread.cpp 
Log Message:
Thread-related IHNM differences.


Index: saga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.cpp,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- saga.cpp	29 Jul 2005 17:57:59 -0000	1.122
+++ saga.cpp	30 Jul 2005 14:41:24 -0000	1.123
@@ -143,6 +143,8 @@
 	_sound = NULL;
 	_puzzle = NULL;
 
+	_frameCount = 0;
+
 
 	// The Linux version of Inherit the Earth puts all data files in an
 	// 'itedata' sub-directory, except for voices.rsc

Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -d -r1.111 -r1.112
--- saga.h	29 Jul 2005 19:44:25 -0000	1.111
+++ saga.h	30 Jul 2005 14:41:25 -0000	1.112
@@ -639,6 +639,9 @@
 	Common::Rect _displayClip;
 
 public:
+	int32 _frameCount;
+
+public:
 	bool initGame(void);
 //	RSCFILE_CONTEXT *getFileContext(uint16 type, int param);
 //	bool isBigEndianFile(const char *filename);

Index: script.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.h,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- script.h	25 Jul 2005 02:38:43 -0000	1.98
+++ script.h	30 Jul 2005 14:41:25 -0000	1.99
@@ -104,7 +104,8 @@
 	kWaitTypeRequest = 6,		// a request is up
 	kWaitTypePause = 7,
 	kWaitTypePlacard = 8,
-	kWaitTypeStatusTextInput = 9
+	kWaitTypeStatusTextInput = 9,
+	kWaitTypeWaitFrames = 10    // IHNM. waiting for a frame count
 };
 
 enum OpCodes {
@@ -262,6 +263,7 @@
 
 	uint16 _instructionOffset;			// Instruction offset
 
+	int32 _frameWait;
 
 public:
 	byte *baseAddress(byte addrMode) {

Index: sthread.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sthread.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- sthread.cpp	29 Jul 2005 17:58:00 -0000	1.91
+++ sthread.cpp	30 Jul 2005 14:41:25 -0000	1.92
@@ -117,13 +117,19 @@
 			if (thread->_flags & kTFlagFinished)
 				setPointerVerb();
 
-			threadIterator = _threadList.erase(threadIterator);
+			if (_vm->getGameType() == GType_IHNM) {
+				thread->_flags &= ~kTFlagFinished;
+				thread->_flags |= kTFlagAborted;
+			} else {
+				threadIterator = _threadList.erase(threadIterator);
+			}
 			continue;
 		}
 
 		if (thread->_flags & kTFlagWaiting) {
 
-			if (thread->_waitType == kWaitTypeDelay) {
+			switch (thread->_waitType) {
+			case kWaitTypeDelay:
 				if (thread->_sleepTime < msec) {
 					thread->_sleepTime = 0;
 				} else {
@@ -132,14 +138,22 @@
 
 				if (thread->_sleepTime == 0)
 					thread->_flags &= ~kTFlagWaiting;
-			} else {
-				if (thread->_waitType == kWaitTypeWalk) {
+				break;
+			
+			case kWaitTypeWalk:
+				{
 					ActorData *actor;
 					actor = (ActorData *)thread->_threadObj;
 					if (actor->currentAction == kActionWait) {
 						thread->_flags &= ~kTFlagWaiting;
 					}
 				}
+				break;
+
+			case kWaitTypeWaitFrames: // IHNM
+				if (thread->_frameWait < _vm->_frameCount)
+					thread->_flags &= ~kTFlagWaiting;
+				break;
 			}
 		}
 
@@ -169,7 +183,9 @@
 }
 
 void Script::completeThread(void) {
-	for (int i = 0; i < 40 &&  !_threadList.isEmpty() ; i++)
+	int limit = (_vm->getGameType() == GType_IHNM) ? 100 : 40;
+
+	for (int i = 0; i < limit &&  !_threadList.isEmpty() ; i++)
 		executeThreads(0);
 }
 





More information about the Scummvm-git-logs mailing list