[Scummvm-cvs-logs] CVS: scummvm/saga actor.h,1.92,1.93 script.h,1.104,1.105 sfuncs.cpp,1.150,1.151

Eugene Sandulenko sev at users.sourceforge.net
Wed Aug 10 10:40:57 CEST 2005


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

Modified Files:
	actor.h script.h sfuncs.cpp 
Log Message:
Improved debug output on stub script functions.
Impelmented sfSetSpeechBox, though it is not yet functional.


Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.h,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- actor.h	10 Aug 2005 14:53:17 -0000	1.92
+++ actor.h	10 Aug 2005 17:39:29 -0000	1.93
@@ -647,6 +647,8 @@
 	ActorData *_protagonist;
 	int _handleActionDiv;
 
+	Rect _speechBoxScript;
+
 protected:
 	SpeechData _activeSpeech;
 	int _protagState;

Index: script.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.h,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- script.h	9 Aug 2005 16:01:03 -0000	1.104
+++ script.h	10 Aug 2005 17:39:29 -0000	1.105
@@ -551,11 +551,28 @@
 	void sfDemoIsInteractive(SCRIPTFUNC_PARAMS);
 	void sfVsetTrack(SCRIPTFUNC_PARAMS);
 	void sfDebugShowData(SCRIPTFUNC_PARAMS);
-	void SF_stub(SCRIPTFUNC_PARAMS);
 	void sfNull(SCRIPTFUNC_PARAMS);
 	void sfWaitFramesEsc(SCRIPTFUNC_PARAMS);
 	void sfPsychicProfile(SCRIPTFUNC_PARAMS);
 	void sfPsychicProfileOff(SCRIPTFUNC_PARAMS);
+	void sfSetSpeechBox(SCRIPTFUNC_PARAMS);
+	void sf74(SCRIPTFUNC_PARAMS);
+	void sf75(SCRIPTFUNC_PARAMS);
+	void sf83(SCRIPTFUNC_PARAMS);
+	void sf84(SCRIPTFUNC_PARAMS);
+	void sf85(SCRIPTFUNC_PARAMS);
+	void sf87(SCRIPTFUNC_PARAMS);
+	void sf88(SCRIPTFUNC_PARAMS);
+	void sf89(SCRIPTFUNC_PARAMS);
+	void sf95(SCRIPTFUNC_PARAMS);
+	void sf96(SCRIPTFUNC_PARAMS);
+	void sf97(SCRIPTFUNC_PARAMS);
+	void sf98(SCRIPTFUNC_PARAMS);
+	void sf99(SCRIPTFUNC_PARAMS);
+	void sf103(SCRIPTFUNC_PARAMS);
+	void sf104(SCRIPTFUNC_PARAMS);
+
+	void SF_stub(const char *name, ScriptThread *thread, int nArgs);
 };
 
 } // End of namespace Saga

Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -d -r1.150 -r1.151
--- sfuncs.cpp	10 Aug 2005 15:31:15 -0000	1.150
+++ sfuncs.cpp	10 Aug 2005 17:39:29 -0000	1.151
@@ -209,8 +209,8 @@
 		OPCODE(sfRand),
 		OPCODE(sfFadeMusic),
 		OPCODE(sfNull),
-		OPCODE(SF_stub),
-		OPCODE(SF_stub),
+		OPCODE(sf74),
+		OPCODE(sf75),
 		OPCODE(sfScriptStartCutAway),
 		OPCODE(sfReturnFromCutAway),
 		OPCODE(sfEndCutAway),
@@ -218,28 +218,28 @@
 		OPCODE(sfResetMouseClicks),
 		OPCODE(sfWaitFrames),
 		OPCODE(sfScriptFade),
-		OPCODE(SF_stub),
-		OPCODE(SF_stub),
-		OPCODE(SF_stub),
+		OPCODE(sf83),
+		OPCODE(sf84),
+		OPCODE(sf85),
 		OPCODE(sfSetActorZ),
-		OPCODE(SF_stub),
-		OPCODE(SF_stub),
+		OPCODE(sf87),
+		OPCODE(sf88),
+		OPCODE(sf89),
 		OPCODE(sfVstopFX),
 		OPCODE(sfVstopLoopedFX),
-		OPCODE(SF_stub),
 		OPCODE(sfNull),
 		OPCODE(sfDemoIsInteractive),
 		OPCODE(sfVsetTrack),
-		OPCODE(SF_stub),
-		OPCODE(SF_stub),
-		OPCODE(SF_stub),
-		OPCODE(SF_stub),
-		OPCODE(SF_stub),
-		OPCODE(SF_stub),
+		OPCODE(sf95),
+		OPCODE(sf96),
+		OPCODE(sf97),
+		OPCODE(sf98),
+		OPCODE(sf99),
+		OPCODE(sfSetSpeechBox),
 		OPCODE(sfDebugShowData),
 		OPCODE(sfWaitFramesEsc),
-		OPCODE(SF_stub),
-		OPCODE(SF_stub)
+		OPCODE(sf103),
+		OPCODE(sf104)
 	};
 	if (_vm->getGameType() == GType_IHNM)
 		_scriptFunctionsList = IHNMscriptFunctionsList;
@@ -666,10 +666,9 @@
 
 // Script function #24 (0x18)
 void Script::SF_cycleColors(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
+	SF_stub("SF_cycleColors", thread, nArgs);
 
-	error("STUB: SF_cycleColors(), %d args", nArgs);
+	error("Please, report this to sev");
 }
 
 // Script function #25 (0x19)
@@ -1399,15 +1398,11 @@
 }
 
 void Script::sfPsychicProfile(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
-	warning("STUB: sfPsychicProfile()");
+	SF_stub("sfPsychicProfile", thread, nArgs);
 }
 
 void Script::sfPsychicProfileOff(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
-	warning("STUB: sfPsychicProfileOff()");
+	SF_stub("sfPsychicProfileOff", thread, nArgs);
 }
 
 // Script function #50 (0x32)
@@ -1823,53 +1818,64 @@
 	wakeUpThreads(kWaitTypeDialogBegin);
 }
 
-void Script::sfScriptStartCutAway(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
+void Script::sf74(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf74", thread, nArgs);
+}
 
-	debug(0, "STUB: sfScriptStartCutAway(), %d args", nArgs);
+void Script::sf75(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf75", thread, nArgs);
 }
 
-void Script::sfReturnFromCutAway(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
+void Script::sfScriptStartCutAway(SCRIPTFUNC_PARAMS) {
+	SF_stub("sfScriptStartCutAway", thread, nArgs);
+}
 
-	debug(0, "STUB: sfReturnFromCutAway(), %d args", nArgs);
+void Script::sfReturnFromCutAway(SCRIPTFUNC_PARAMS) {
+	SF_stub("sfReturnFromCutAway", thread, nArgs);
 }
 
 void Script::sfEndCutAway(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
-
-	debug(0, "STUB: sfEndCutAway(), %d args", nArgs);
+	SF_stub("sfEndCutAway", thread, nArgs);
 }
 
 void Script::sfGetMouseClicks(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
-
-	debug(0, "STUB: sfGetMouseClicks(), %d args", nArgs);
+	SF_stub("sfGetMouseClicks", thread, nArgs);
 }
 
 void Script::sfResetMouseClicks(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
-
-	debug(0, "STUB: sfResetMouseClicks(), %d args", nArgs);
+	SF_stub("sfResetMouseClicks", thread, nArgs);
 }
 
 void Script::sfWaitFrames(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
-
-	debug(0, "STUB: sfWaitFrames(), %d args", nArgs);
+	SF_stub("sfWaitFrames", thread, nArgs);
 }
 
 void Script::sfScriptFade(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
+	SF_stub("sfScriptFade", thread, nArgs);
+}
 
-	debug(0, "STUB: sfScriptFade(), %d args", nArgs);
+void Script::sf83(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf83", thread, nArgs);
+}
+
+void Script::sf84(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf84", thread, nArgs);
+}
+
+void Script::sf85(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf85", thread, nArgs);
+}
+
+void Script::sf87(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf87", thread, nArgs);
+}
+
+void Script::sf88(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf88", thread, nArgs);
+}
+
+void Script::sf89(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf89", thread, nArgs);
 }
 
 void Script::sfVstopFX(SCRIPTFUNC_PARAMS) {
@@ -1892,6 +1898,40 @@
 	_vm->_scene->changeScene(sceneNumber, actorsEntrance, kTransitionFade, chapter);
 }
 
+void Script::sf95(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf95", thread, nArgs);
+}
+
+void Script::sf96(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf96", thread, nArgs);
+}
+
+void Script::sf97(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf97", thread, nArgs);
+}
+
+void Script::sf98(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf98", thread, nArgs);
+}
+
+void Script::sf99(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf99", thread, nArgs);
+}
+
+void Script::sfSetSpeechBox(SCRIPTFUNC_PARAMS) {
+	int16 param1 = thread->pop();
+	int16 param2 = thread->pop();
+	int16 param3 = thread->pop();
+	int16 param4 = thread->pop();
+
+	_vm->_actor->_speechBoxScript.left = param1;
+	_vm->_actor->_speechBoxScript.top = param2;
+	_vm->_actor->_speechBoxScript.setWidth(param3);
+	_vm->_actor->_speechBoxScript.setHeight(param4);
+
+	debug(0, "STUB: sfSetSpeechBox(%d, %d, %d, %d)", param1, param2, param3, param4);
+}
+
 void Script::sfDebugShowData(SCRIPTFUNC_PARAMS) {
 	int16 param = thread->pop();
 	char buf[50];
@@ -1903,6 +1943,16 @@
 
 void Script::sfWaitFramesEsc(SCRIPTFUNC_PARAMS) {
 	thread->_returnValue = 0;
+
+	debug(0, "STUB: sfWaitFramesEsc()");
+}
+
+void Script::sf103(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf103", thread, nArgs);
+}
+
+void Script::sf104(SCRIPTFUNC_PARAMS) {
+	SF_stub("sf104", thread, nArgs);
 }
 
 void Script::sfNull(SCRIPTFUNC_PARAMS) {
@@ -1910,11 +1960,19 @@
 		thread->pop();
 }
 
-void Script::SF_stub(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
+void Script::SF_stub(const char *name, ScriptThread *thread, int nArgs) {
+	char buf[256], buf1[100];
 
-	debug(0, "STUB: SF_stub(), %d args", nArgs);
+	snprintf(buf, 256, "STUB: %s(", name);
+
+	for (int i = 0; i < nArgs; i++) {
+		snprintf(buf1, 100, "%d", thread->pop());
+		strncat(buf, buf1, 256);
+		if (i + 1 < nArgs)
+			strncat(buf, ", ", 256);
+	}
+
+	debug(0, "%s)", buf);
 }
 
 } // End of namespace Saga





More information about the Scummvm-git-logs mailing list