diff options
author | Max Horn | 2002-09-22 01:17:53 +0000 |
---|---|---|
committer | Max Horn | 2002-09-22 01:17:53 +0000 |
commit | a681eb029e7fc5b0383d5cdfce2c561e8fa221d2 (patch) | |
tree | 62c79d406f1fdd730eb8000e25a42ecd557a990d /scumm/script.cpp | |
parent | 45ce1d111312ec413d6d680092f98a4f49e31556 (diff) | |
download | scummvm-rg350-a681eb029e7fc5b0383d5cdfce2c561e8fa221d2.tar.gz scummvm-rg350-a681eb029e7fc5b0383d5cdfce2c561e8fa221d2.tar.bz2 scummvm-rg350-a681eb029e7fc5b0383d5cdfce2c561e8fa221d2.zip |
renamec string -> _string and sentence -> _sentence in class Scumm (I originally reworked StringTab, but then noticed the save game format depends on it <sigh>)
svn-id: r4995
Diffstat (limited to 'scumm/script.cpp')
-rw-r--r-- | scumm/script.cpp | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp index e28fa2395e..ee3d536183 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -567,7 +567,7 @@ void Scumm::freezeScripts(int flag) } for (i = 0; i < 6; i++) - sentence[i].unk++; + _sentence[i].unk++; if (vm.cutSceneScriptIndex != 0xFF) { vm.slot[vm.cutSceneScriptIndex].status &= 0x7F; @@ -587,8 +587,8 @@ void Scumm::unfreezeScripts() } for (i = 0; i < 6; i++) { - if (((int8)--sentence[i].unk) < 0) - sentence[i].unk = 0; + if (_sentence[i].unk > 0) + _sentence[i].unk--; } } @@ -703,18 +703,18 @@ void Scumm::checkAndRunVar33() return; } - if (!_sentenceNum || sentence[_sentenceNum - 1].unk) + if (!_sentenceNum || _sentence[_sentenceNum - 1].unk) return; _sentenceNum--; if (!(_features & GF_AFTER_V7)) - if (sentence[_sentenceNum].unk2 && sentence[_sentenceNum].unk3 == sentence[_sentenceNum].unk4) + if (_sentence[_sentenceNum].unk2 && _sentence[_sentenceNum].unk3 == _sentence[_sentenceNum].unk4) return; - _localParamList[0] = sentence[_sentenceNum].unk5; - _localParamList[1] = sentence[_sentenceNum].unk4; - _localParamList[2] = sentence[_sentenceNum].unk3; + _localParamList[0] = _sentence[_sentenceNum].unk5; + _localParamList[1] = _sentence[_sentenceNum].unk4; + _localParamList[2] = _sentence[_sentenceNum].unk3; _currentScript = 0xFF; if (_vars[VAR_SENTENCE_SCRIPT]) runScript(_vars[VAR_SENTENCE_SCRIPT], 0, 0, _localParamList); @@ -1079,42 +1079,39 @@ void Scumm::exitCutscene() } void Scumm::doSentence(int c, int b, int a) { + SentenceTab *st; + if (_features & GF_AFTER_V7) { - SentenceTab *st; if (b == a) return; - st = &sentence[_sentenceNum - 1]; - + st = &_sentence[_sentenceNum - 1]; + + + // Check if this doSentence request is identical to the previous one; + // if yes, ignore this invocation. if (_sentenceNum && st->unk5 == c && st->unk4 == b && st->unk3 == a) return; _sentenceNum++; st++; - st->unk5 = c; - st->unk4 = b; - st->unk3 = a; - st->unk = 0; - - warning("dosentence(%d,%d,%d)", c, b, a); + warning("doSentence(%d,%d,%d)", c, b, a); } else { - SentenceTab *st; - - st = &sentence[_sentenceNum++]; - - st->unk5 = c; - st->unk4 = b; - st->unk3 = a; + st = &_sentence[_sentenceNum++]; if (!(st->unk3 & 0xFF00)) st->unk2 = 0; else st->unk2 = 1; - st->unk = 0; } + + st->unk5 = c; + st->unk4 = b; + st->unk3 = a; + st->unk = 0; } |