aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-11-07 15:35:42 +0000
committerTorbjörn Andersson2004-11-07 15:35:42 +0000
commit073d0680e1b9ce7cf2de50892ff065716eee3b6f (patch)
tree1228cc4c7241f4351e705c9d0912c2cc96899ad7
parentd6cfbdad21fe995b5f2c4e6c3b1b7afb84701d9e (diff)
downloadscummvm-rg350-073d0680e1b9ce7cf2de50892ff065716eee3b6f.tar.gz
scummvm-rg350-073d0680e1b9ce7cf2de50892ff065716eee3b6f.tar.bz2
scummvm-rg350-073d0680e1b9ce7cf2de50892ff065716eee3b6f.zip
Renamed SF_getObjName() to SF_getObjImage() and unstubbed it. (Untested)
svn-id: r15728
-rw-r--r--saga/script.h2
-rw-r--r--saga/sfuncs.cpp27
2 files changed, 20 insertions, 9 deletions
diff --git a/saga/script.h b/saga/script.h
index 19bb4122d5..3cf7c37358 100644
--- a/saga/script.h
+++ b/saga/script.h
@@ -270,7 +270,7 @@ private:
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);
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp
index ce458c0640..0d413ac18b 100644
--- a/saga/sfuncs.cpp
+++ b/saga/sfuncs.cpp
@@ -65,7 +65,7 @@ void Script::setupScriptFuncList(void) {
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 @@ int Script::SF_setObjImage(SCRIPTFUNC_PARAMS) {
// 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();
+
+ int index = obj_param & 0x1FFF;
+
+ if (index >= ARRAYSIZE(ObjectTable)) {
+ return FAILURE;
+ }
- debug(1, "stub: SF_setObjName(), %d args", nArgs);
+ 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;
+
+ if (index >= ARRAYSIZE(ObjectTable)) {
+ thread->retVal = 0;
+ return FAILURE;
+ }
- debug(1, "stub: SF_getObjName(), %d args", nArgs);
+ thread->retVal = ObjectTable[index].spritelistRn;
return SUCCESS;
}