diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/script.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/script_v0.cpp | 12 | ||||
-rw-r--r-- | engines/scumm/scumm_v0.h | 3 | ||||
-rw-r--r-- | engines/scumm/vars.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/verbs.cpp | 13 |
5 files changed, 18 insertions, 14 deletions
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index 588ebaffb9..6dac647714 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -1219,7 +1219,7 @@ void ScummEngine_v0::checkAndRunSentenceScript() { } void ScummEngine_v0::runSentenceScript() { - drawSentenceLine(); + _redrawSentenceLine = true; if (getVerbEntrypoint(_cmdObject, _cmdVerb) != 0) { // do not read in the dark diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp index e277480aed..7fce4011e4 100644 --- a/engines/scumm/script_v0.cpp +++ b/engines/scumm/script_v0.cpp @@ -453,6 +453,8 @@ void ScummEngine_v0::drawSentenceObject(int object) { void ScummEngine_v0::drawSentenceLine() { + _redrawSentenceLine = false; + if (!(_userState & 32)) return; @@ -601,7 +603,7 @@ void ScummEngine_v0::o_loadRoomWithEgo() { _fullRedraw = true; - resetSentence(false); + resetSentence(); if (x >= 0 && y >= 0) { a->startWalkActor(x, y, -1); @@ -625,6 +627,7 @@ void ScummEngine_v0::o_cursorCommand() { _currentMode = fetchScriptByte(); switch (_currentMode) { case kModeCutscene: + _redrawSentenceLine = false; state = 15; break; case kModeKeypad: @@ -909,7 +912,7 @@ void ScummEngine_v0::o_cutscene() { setUserState(15); _sentenceNum = 0; - resetSentence(false); + resetSentence(); vm.cutScenePtr[0] = 0; } @@ -930,6 +933,8 @@ void ScummEngine_v0::o_endCutscene() { } else if (vm.cutSceneData[2] != _currentRoom) { startScene(vm.cutSceneData[2], 0, 0); } + + _redrawSentenceLine = true; } void ScummEngine_v0::o_beginOverride() { @@ -961,11 +966,12 @@ void ScummEngine_v0::o_setOwnerOf() { setOwnerOf(obj, owner); } -void ScummEngine_v0::resetSentence(bool walking) { +void ScummEngine_v0::resetSentence() { _activeVerb = kVerbWalkTo; _activeObject = 0; _activeObject2 = 0; _walkToObjectIdx = 0; + _redrawSentenceLine = true; } } // End of namespace Scumm diff --git a/engines/scumm/scumm_v0.h b/engines/scumm/scumm_v0.h index d70d893f09..ae97b57a3e 100644 --- a/engines/scumm/scumm_v0.h +++ b/engines/scumm/scumm_v0.h @@ -52,6 +52,7 @@ protected: int _walkToObject; int _walkToObjectIdx; + bool _redrawSentenceLine; public: ScummEngine_v0(OSystem *syst, const DetectorResult &dr); @@ -98,7 +99,7 @@ protected: virtual int getActiveObject(); - virtual void resetSentence(bool walking); + virtual void resetSentence(); virtual bool areBoxesNeighbors(int box1nr, int box2nr); diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp index 6365a728d2..6d132c601f 100644 --- a/engines/scumm/vars.cpp +++ b/engines/scumm/vars.cpp @@ -546,7 +546,7 @@ void ScummEngine_v8::setupScummVars() { #endif void ScummEngine_v0::resetScummVars() { - resetSentence(false); + resetSentence(); VAR(VAR_EGO) = 3; diff --git a/engines/scumm/verbs.cpp b/engines/scumm/verbs.cpp index dc049816e3..8888935ea7 100644 --- a/engines/scumm/verbs.cpp +++ b/engines/scumm/verbs.cpp @@ -132,7 +132,7 @@ void ScummEngine_v0::resetVerbs() { } void ScummEngine_v0::switchActor(int slot) { - resetSentence(false); + resetSentence(); if (_currentRoom == 45) return; @@ -741,7 +741,6 @@ void ScummEngine_v0::checkExecVerbs() { ActorC64 *a = (ActorC64 *)derefActor(VAR(VAR_EGO), "checkExecVerbs"); VirtScreen *zone = findVirtScreen(_mouse.y); - int sentenceLineChanged = false; bool execute = false; //if (_userPut <= 0) @@ -757,7 +756,7 @@ void ScummEngine_v0::checkExecVerbs() { _activeObject = 0; _activeObject2 = 0; _activeVerb = over; - sentenceLineChanged = true; + _redrawSentenceLine = true; } else { // execute sentence if complete if (checkSentenceComplete()) @@ -793,7 +792,7 @@ void ScummEngine_v0::checkExecVerbs() { else kid = 2; _activeVerb = kVerbWalkTo; - drawSentenceLine(); + _redrawSentenceLine = true; switchActor(kid); } _activeVerb = kVerbWalkTo; @@ -855,7 +854,7 @@ void ScummEngine_v0::checkExecVerbs() { } } - sentenceLineChanged = true; + _redrawSentenceLine = true; if (_activeVerb == kVerbWalkTo && zone->number == kMainVirtScreen) { _walkToObjectIdx = 0; execute = true; @@ -864,10 +863,8 @@ void ScummEngine_v0::checkExecVerbs() { } } - if (sentenceLineChanged) { + if (_redrawSentenceLine) drawSentenceLine(); - sentenceLineChanged = false; - } if (!execute || !_activeVerb) return; |