[Scummvm-cvs-logs] CVS: scummvm/saga script.h,1.25,1.26 sfuncs.cpp,1.39,1.40

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Sun Nov 7 07:39:47 CET 2004


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

Modified Files:
	script.h sfuncs.cpp 
Log Message:
Renamed SF_getObjName() to SF_getObjImage() and unstubbed it. (Untested)


Index: script.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- script.h	6 Nov 2004 22:33:08 -0000	1.25
+++ script.h	7 Nov 2004 15:35:42 -0000	1.26
@@ -270,7 +270,7 @@
 	int SF_gotoScene(SCRIPTFUNC_PARAMS);
 	int SF_setObjImage(SCRIPTFUNC_PARAMS);
 	int SF_setObjName(SCRIPTFUNC_PARAMS);
-	int SF_getObjName(SCRIPTFUNC_PARAMS);
+	int SF_getObjImage(SCRIPTFUNC_PARAMS);
 	int SF_getNumber(SCRIPTFUNC_PARAMS);
 	int SF_openDoor(SCRIPTFUNC_PARAMS);
 	int SF_closeDoor(SCRIPTFUNC_PARAMS);

Index: sfuncs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sfuncs.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- sfuncs.cpp	7 Nov 2004 15:28:20 -0000	1.39
+++ sfuncs.cpp	7 Nov 2004 15:35:42 -0000	1.40
@@ -65,7 +65,7 @@
 		OPCODE(SF_gotoScene),
 		OPCODE(SF_setObjImage),
 		OPCODE(SF_setObjName),
-		OPCODE(SF_getObjName),
+		OPCODE(SF_getObjImage),
 		OPCODE(SF_getNumber),
 		OPCODE(SF_openDoor),
 		OPCODE(SF_closeDoor),
@@ -365,19 +365,30 @@
 
 // Script function #18 (0x12)
 int Script::SF_setObjName(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
+	SDataWord_T obj_param = thread->pop();
+	SDataWord_T name_param = thread->pop();
 
-	debug(1, "stub: SF_setObjName(), %d args", nArgs);
+	int index = obj_param & 0x1FFF;
+
+	if (index >= ARRAYSIZE(ObjectTable)) {
+		return FAILURE;
+	}
+
+	ObjectTable[index].nameIndex = name_param;
 	return SUCCESS;
 }
 
 // Script function #19 (0x13)
-int Script::SF_getObjName(SCRIPTFUNC_PARAMS) {
-	for (int i = 0; i < nArgs; i++)
-		thread->pop();
+int Script::SF_getObjImage(SCRIPTFUNC_PARAMS) {
+	SDataWord_T param = thread->pop();
+	int index = param & 0x1FFF;
 
-	debug(1, "stub: SF_getObjName(), %d args", nArgs);
+	if (index >= ARRAYSIZE(ObjectTable)) {
+		thread->retVal = 0;
+		return FAILURE;
+	}
+
+	thread->retVal = ObjectTable[index].spritelistRn;
 	return SUCCESS;
 }
 





More information about the Scummvm-git-logs mailing list