diff options
author | Max Horn | 2003-05-20 20:58:26 +0000 |
---|---|---|
committer | Max Horn | 2003-05-20 20:58:26 +0000 |
commit | 49e7f7564a6d33e0079898cc9584fb69c0fcdcfd (patch) | |
tree | 6687f674e24fe1187cfce58c3d569d184316ea95 /scumm | |
parent | 1a394aa3c764c8a50def5bb9d8aa1342d962fbdd (diff) | |
download | scummvm-rg350-49e7f7564a6d33e0079898cc9584fb69c0fcdcfd.tar.gz scummvm-rg350-49e7f7564a6d33e0079898cc9584fb69c0fcdcfd.tar.bz2 scummvm-rg350-49e7f7564a6d33e0079898cc9584fb69c0fcdcfd.zip |
renamed various things for clarity
svn-id: r7754
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/actor.cpp | 2 | ||||
-rw-r--r-- | scumm/debugger.cpp | 2 | ||||
-rw-r--r-- | scumm/script.cpp | 36 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 6 | ||||
-rw-r--r-- | scumm/script_v5.cpp | 8 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 10 | ||||
-rw-r--r-- | scumm/scumm.h | 8 | ||||
-rw-r--r-- | scumm/scummvm.cpp | 2 | ||||
-rw-r--r-- | scumm/smush/smush_player.cpp | 2 |
9 files changed, 36 insertions, 40 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 3d6972e0c0..a7c2a04021 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -99,7 +99,7 @@ void Actor::initActor(int mode) { } void Actor::stopActorMoving() { - _vm->stopScriptNr(walk_script); + _vm->stopScript(walk_script); moving = 0; } diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index a55279f1a2..139ca5bb37 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -466,7 +466,7 @@ bool ScummDebugger::Cmd_Script(int argc, const char** argv) { //} if ((!strcmp(argv[2], "kill")) || (!strcmp(argv[2], "stop"))) { - _s->stopScriptNr(scriptnum); + _s->stopScript(scriptnum); } else if ((!strcmp(argv[2], "run")) || (!strcmp(argv[2], "start"))) { _s->runScript(scriptnum, 0, 0, 0); return false; diff --git a/scumm/script.cpp b/scumm/script.cpp index 476a5f1662..be6963edf2 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -46,7 +46,7 @@ void Scumm::runScript(int script, bool freezeResistant, bool recursive, int *lva return; if (!recursive) - stopScriptNr(script); + stopScript(script); if (script < _numGlobalScripts) { scriptPtr = getResourceAddress(rtScript, script); @@ -76,7 +76,7 @@ void Scumm::runScript(int script, bool freezeResistant, bool recursive, int *lva runScriptNested(slot); } -void Scumm::runVerbCode(int object, int entry, bool freezeResistant, bool recursive, int *vars) { +void Scumm::runObjectScript(int object, int entry, bool freezeResistant, bool recursive, int *vars) { ScriptSlot *s; uint32 obcd; int slot, where, offs; @@ -192,7 +192,7 @@ int Scumm::getVerbEntrypoint(int obj, int entry) { } /* Stop script 'script' */ -void Scumm::stopScriptNr(int script) { +void Scumm::stopScript(int script) { ScriptSlot *ss; NestedScript *nest; int i, num; @@ -259,7 +259,7 @@ void Scumm::stopObjectScript(int script) { do { if (nest->number == script && - (nest->where == WIO_ROOM || nest->where == WIO_FLOBJECT || nest->where == WIO_INVENTORY)) { + (nest->where == WIO_ROOM || nest->where == WIO_INVENTORY || nest->where == WIO_FLOBJECT)) { nest->number = 0xFF; nest->slot = 0xFF; nest->where = 0xFF; @@ -620,7 +620,7 @@ void Scumm::stopObjectCode() { if (ss->where != WIO_GLOBAL && ss->where != WIO_LOCAL) { if (ss->cutsceneOverride) { - warning("Object %d ending with active cutscene/override", ss->number); + warning("Object %d ending with active cutscene/override (%d)", ss->number, ss->cutsceneOverride); ss->cutsceneOverride = 0; } } else { @@ -634,19 +634,6 @@ void Scumm::stopObjectCode() { _currentScript = 0xFF; } -bool Scumm::isScriptInUse(int script) { - ScriptSlot *ss; - int i; - - ss = vm.slot; - for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) { - if (ss->number == script) - return true; - } - return false; -} - - void Scumm::runHook(int i) { if (_features & GF_AFTER_V2) { // FIXME - TODO @@ -909,6 +896,15 @@ void Scumm::decreaseScriptDelay(int amount) { } } +bool Scumm::isScriptInUse(int script) { + int i; + ScriptSlot *ss = vm.slot; + for (i = 0; i < NUM_SCRIPT_SLOT; i++, ss++) + if (ss->number == script) + return true; + return false; +} + bool Scumm::isScriptRunning(int script) { int i; ScriptSlot *ss = vm.slot; @@ -1037,7 +1033,7 @@ int Scumm::resStrLen(const byte *src) const { return num; } -void Scumm::cutscene(int *args) { +void Scumm::beginCutscene(int *args) { int scr = _currentScript; vm.slot[scr].cutsceneOverride++; @@ -1077,7 +1073,7 @@ void Scumm::endCutscene() { runScript(VAR(VAR_CUTSCENE_END_SCRIPT), 0, 0, args); } -void Scumm::exitCutscene() { +void Scumm::abortCutscene() { uint32 offs = vm.cutScenePtr[vm.cutSceneStackPointer]; if (offs) { ScriptSlot *ss = &vm.slot[vm.cutSceneScript[vm.cutSceneStackPointer]]; diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index fae2680235..5d803e16ab 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -828,7 +828,7 @@ void Scumm_v2::o2_doSentence() { a = getVarOrDirectByte(0x80); if (a == 0xFB) { _sentenceNum = 0; - stopScriptNr(SENTENCE_SCRIPT); + stopScript(SENTENCE_SCRIPT); return; } if (a == 0xFC) { @@ -855,7 +855,7 @@ void Scumm_v2::o2_doSentence() { _scummVars[VAR_ACTIVE_VERB] = st->verb; _scummVars[VAR_ACTIVE_OBJECT1] = st->objectA; _scummVars[VAR_ACTIVE_OBJECT2] = st->objectB; - runVerbCode(st->objectA, st->verb, 0, 0, NULL); + runObjectScript(st->objectA, st->verb, 0, 0, NULL); break; case 2: @@ -1134,7 +1134,7 @@ void Scumm_v2::o2_roomOps() { void Scumm_v2::o2_cutscene() { warning("TODO o2_cutscene()"); _sentenceNum = 0; - stopScriptNr(SENTENCE_SCRIPT); + stopScript(SENTENCE_SCRIPT); resetSentence(); } diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index a02c71758f..59c77b23f3 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -688,7 +688,7 @@ void Scumm_v5::o5_cursorCommand() { void Scumm_v5::o5_cutscene() { int args[16]; getWordVararg(args); - cutscene(args); + beginCutscene(args); } void Scumm_v5::o5_endCutscene() { @@ -738,7 +738,7 @@ void Scumm_v5::o5_doSentence() { a = getVarOrDirectByte(0x80); if (a == 0xFE) { _sentenceNum = 0; - stopScriptNr(VAR(VAR_SENTENCE_SCRIPT)); + stopScript(VAR(VAR_SENTENCE_SCRIPT)); clearClickedStatus(); return; } @@ -2057,7 +2057,7 @@ void Scumm_v5::o5_startObject() { script = getVarOrDirectByte(0x40); getWordVararg(data); - runVerbCode(obj, script, 0, 0, data); + runObjectScript(obj, script, 0, 0, data); } void Scumm_v5::o5_startScript() { @@ -2094,7 +2094,7 @@ void Scumm_v5::o5_stopScript() { if (!script) stopObjectCode(); else - stopScriptNr(script); + stopScript(script); } void Scumm_v5::o5_stringOps() { diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index f893c836f1..1306ede6c1 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -724,7 +724,7 @@ void Scumm_v6::o6_startObjectEx() { entryp = pop(); script = pop(); flags = pop(); - runVerbCode(script, entryp, (flags & 1) != 0, (flags & 2) != 0, args); + runObjectScript(script, entryp, (flags & 1) != 0, (flags & 2) != 0, args); } void Scumm_v6::o6_startObjectQuick() { @@ -733,7 +733,7 @@ void Scumm_v6::o6_startObjectQuick() { getStackList(args, ARRAYSIZE(args)); entryp = pop(); script = pop(); - runVerbCode(script, entryp, 0, 1, args); + runObjectScript(script, entryp, 0, 1, args); } void Scumm_v6::o6_setObjectState() { @@ -765,7 +765,7 @@ void Scumm_v6::o6_endCutscene() { void Scumm_v6::o6_cutscene() { int args[16]; getStackList(args, ARRAYSIZE(args)); - cutscene(args); + beginCutscene(args); } void Scumm_v6::o6_stopMusic() { @@ -983,7 +983,7 @@ void Scumm_v6::o6_stopScript() { if (script == 0) stopObjectCode(); else - stopScriptNr(script); + stopScript(script); } void Scumm_v6::o6_walkActorToObj() { @@ -2165,7 +2165,7 @@ void Scumm_v6::o6_delayMinutes() { void Scumm_v6::o6_stopSentence() { _sentenceNum = 0; - stopScriptNr(VAR(VAR_SENTENCE_SCRIPT)); + stopScript(VAR(VAR_SENTENCE_SCRIPT)); clearClickedStatus(); } diff --git a/scumm/scumm.h b/scumm/scumm.h index a797315d1a..e7abedd2d8 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -507,7 +507,7 @@ protected: public: void runScript(int script, bool freezeResistant, bool recursive, int *lvarptr); - void stopScriptNr(int script); + void stopScript(int script); protected: void runScriptNested(int script); @@ -532,9 +532,9 @@ protected: void freezeScripts(int scr); void unfreezeScripts(); void runAllScripts(); - void cutscene(int *args); + void beginCutscene(int *args); void endCutscene(); - void exitCutscene(); + void abortCutscene(); void runExitScript(); void runEntryScript(); @@ -709,7 +709,7 @@ protected: int getVerbEntrypoint(int obj, int entry); int getVerbSlot(int id, int mode); void killVerb(int slot); - void runVerbCode(int script, int entry, bool freezeResistant, bool recursive, int *vars); + void runObjectScript(int script, int entry, bool freezeResistant, bool recursive, int *vars); void setVerbObject(uint room, uint object, uint verb); public: diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 18be9f9983..f9aecc09e5 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -1762,7 +1762,7 @@ void Scumm::processKbd() { if (_insaneState) { _videoFinished = true; } else - exitCutscene(); + abortCutscene(); } else if (_lastKeyHit == saveloadkey && _currentRoom != 0) { if (VAR_SAVELOAD_SCRIPT != 0xFF) runScript(VAR(VAR_SAVELOAD_SCRIPT), 0, 0, 0); diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index d851399dbd..a29b7ac65c 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -274,7 +274,7 @@ void SmushPlayer::deinit() { } _scumm->_insaneState = false; - _scumm->exitCutscene(); + _scumm->abortCutscene(); if (_scumm->_imuseDigital) { _scumm->_imuseDigital->pause(false); } |