aboutsummaryrefslogtreecommitdiff
path: root/saga/sfuncs.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2005-04-16 20:59:24 +0000
committerEugene Sandulenko2005-04-16 20:59:24 +0000
commit44acfd9467e126d324a6ac730dccedd30c916480 (patch)
treefed123167f011ddcec3a44879993d126e1eb8130 /saga/sfuncs.cpp
parentaea451f092a90bdc28bc8bd82508ec40b9920868 (diff)
downloadscummvm-rg350-44acfd9467e126d324a6ac730dccedd30c916480.tar.gz
scummvm-rg350-44acfd9467e126d324a6ac730dccedd30c916480.tar.bz2
scummvm-rg350-44acfd9467e126d324a6ac730dccedd30c916480.zip
Implement sfGetDeltaFrame and sfEnableZone. Fixes freeze when sanctuary
gates open and also used in world map. Spelling and indentation fixes here and there. svn-id: r17640
Diffstat (limited to 'saga/sfuncs.cpp')
-rw-r--r--saga/sfuncs.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp
index 68b21b082d..947ae14dce 100644
--- a/saga/sfuncs.cpp
+++ b/saga/sfuncs.cpp
@@ -78,7 +78,7 @@ void Script::setupScriptFuncList(void) {
OPCODE(sfDoCenterActor),
OPCODE(sfStartBgdAnimSpeed),
OPCODE(sfScriptWalkToAsync),
- OPCODE(SF_enableZone),
+ OPCODE(sfEnableZone),
OPCODE(sfSetActorState),
OPCODE(sfScriptMoveTo),
OPCODE(SF_sceneEq),
@@ -122,7 +122,7 @@ void Script::setupScriptFuncList(void) {
OPCODE(sfEnableEscape),
OPCODE(sfPlaySound),
OPCODE(SF_playLoopedSound),
- OPCODE(SF_getDeltaFrame),
+ OPCODE(sfGetDeltaFrame),
OPCODE(SF_showProtect),
OPCODE(SF_protectResult),
OPCODE(sfRand),
@@ -610,7 +610,6 @@ void Script::sfSetBgdAnimSpeed(SCRIPTFUNC_PARAMS) {
_vm->_anim->setFrameTime(animId, ticksToMSec(speed));
debug(1, "sfSetBgdAnimSpeed(%d, %d)", animId, speed);
-
}
// Script function #24 (0x18)
@@ -665,11 +664,20 @@ void Script::sfScriptWalkToAsync(SCRIPTFUNC_PARAMS) {
}
// Script function #28 (0x1C)
-void Script::SF_enableZone(SCRIPTFUNC_PARAMS) {
- for (int i = 0; i < nArgs; i++)
- thread->pop();
+void Script::sfEnableZone(SCRIPTFUNC_PARAMS) {
+ int16 hitZoneIndex = objectIdToIndex(thread->pop());
+ int16 flag = thread->pop();
+ HitZone *hitZone;
+
+ debug(0, "sfEnableZone(%d, %d)", hitZoneIndex, flag);
+ hitZone = _vm->_scene->_objectMap->getHitZone(hitZoneIndex);
- debug(1, "stub: SF_enableZone(), %d args", nArgs);
+ if (flag) {
+ hitZone->setFlag(kHitZoneEnabled);
+ } else {
+ hitZone->clearFlag(kHitZoneEnabled);
+ _vm->_actor->_protagonist->lastZone = NULL;
+ }
}
// Script function #29 (0x1D)
@@ -1587,11 +1595,10 @@ void Script::SF_playLoopedSound(SCRIPTFUNC_PARAMS) {
}
// Script function #72 (0x48)
-void Script::SF_getDeltaFrame(SCRIPTFUNC_PARAMS) {
- for (int i = 0; i < nArgs; i++)
- thread->pop();
+void Script::sfGetDeltaFrame(SCRIPTFUNC_PARAMS) {
+ uint16 animId = (uint16)thread->pop();
- debug(1, "stub: SF_getDeltaFrame(), %d args", nArgs);
+ thread->_returnValue = _vm->_anim->getCurrentFrame(animId);
}
// Script function #73 (0x49)