[Scummvm-cvs-logs] SF.net SVN: scummvm: [21006] scummvm/trunk/engines/scumm
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Thu Mar 2 01:35:10 CET 2006
Revision: 21006
Author: fingolfin
Date: 2006-03-02 01:34:48 -0800 (Thu, 02 Mar 2006)
ViewCVS: http://svn.sourceforge.net/scummvm?rev=21006&view=rev
Log Message:
-----------
Yet another patch for bug #1407789 (FT: Invalid Actor when "Combining" Two Items)
Modified Paths:
--------------
scummvm/trunk/engines/scumm/script.cpp
scummvm/trunk/engines/scumm/scumm.cpp
scummvm/trunk/engines/scumm/scumm.h
Modified: scummvm/trunk/engines/scumm/script.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script.cpp 2006-03-02 06:33:15 UTC (rev 21005)
+++ scummvm/trunk/engines/scumm/script.cpp 2006-03-02 09:34:48 UTC (rev 21006)
@@ -601,29 +601,6 @@
if (!(var & 0xF000)) {
checkRange(_numVariables - 1, 0, var, "Variable %d out of range(w)");
- if (var == VAR_SENTENCE_SCRIPT && _game.id == GID_FT && _defaultFTSentenceScript == -1) {
- // WORKAROUND for bug #1407789. See checkAndRunSentenceScript()
- // for the actual workaround.
-
- // FIXME: We do not yet have all necessary information, but the
- // following is known:
- //
- // * The US PC version uses scripts 28 and 103.
- // * The French PC version uses scripts 29 and 104.
- // * The German Mac version uses scripts 29 and 104.
- // * The German, Italian, Portuguese and Spanish PC versions
- // use script 29. The other script is not currently known.
- // * The US Mac demo uses script 28.
- //
- // For now we assume that the very first time VAR_SENTENCE_SCRIPT
- // is set, it is set to the default value (this happens in script 1).
- // We furtermore assume that both scripts, if their IDs are shifted,
- // are shifted by the same amount.
-
- _defaultFTSentenceScript = value;
- _buggyFTSentenceScript = 103 + (_defaultFTSentenceScript - 28);
- }
-
if (VAR_SUBTITLES != 0xFF && var == VAR_SUBTITLES) {
// Ignore default setting in HE72-73 games
if (_game.heversion <= 73 && vm.slot[_currentScript].number == 1)
@@ -1125,12 +1102,32 @@
localParamList[1] = _sentence[_sentenceNum].objectA;
localParamList[2] = _sentence[_sentenceNum].objectB;
- // WORKAROUND for bug #1407789. The buggy script clearly
- // assumes that one of the two objects is an actor. If that's
- // not the case, fall back on the default sentence script.
- if (_game.id == GID_FT && sentenceScript == _buggyFTSentenceScript && !isValidActor(localParamList[1]) && !isValidActor(localParamList[2])) {
- sentenceScript = _defaultFTSentenceScript;
+ if (_game.id == GID_FT && !isValidActor(localParamList[1]) && !isValidActor(localParamList[2])) {
+ // WORKAROUND for bug #1407789. The buggy script clearly
+ // assumes that one of the two objects is an actor. If that's
+ // not the case, fall back on the default sentence script.
+
+ // FIXME: We do not yet have all necessary information, but the
+ // following is known:
+ //
+ // * The US PC version uses scripts 28 and 103 and has 456 scripts.
+ // * The French PC version uses scripts 29 and 104 and has 467 scripts.
+ // * The German Mac version uses scripts 29 and 104 and has 469 scripts.
+ // * The German, Italian, Portuguese and Spanish PC versions
+ // use script 29. The other script is not currently known.
+ // * The US Mac demo uses script 28.
+ //
+ // For now we assume that if there are more than 460 scripts, then
+ // the pair 29/104 is used, else the pair 28/103.
+
+ if (res.num[rtScript] > 460) {
+ if (sentenceScript == 104)
+ sentenceScript = 29;
+ } else {
+ if (sentenceScript == 103)
+ sentenceScript = 28;
+ }
}
}
_currentScript = 0xFF;
Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp 2006-03-02 06:33:15 UTC (rev 21005)
+++ scummvm/trunk/engines/scumm/scumm.cpp 2006-03-02 09:34:48 UTC (rev 21006)
@@ -393,9 +393,6 @@
// Clean _substResFileNameBundle
memset(&_substResFileNameBundle, 0, sizeof(_substResFileNameBundle));
- _defaultFTSentenceScript = -1;
- _buggyFTSentenceScript = -1;
-
// Add default file directories.
if (((_game.platform == Common::kPlatformAmiga) || (_game.platform == Common::kPlatformAtariST)) && (_game.version <= 4)) {
// This is for the Amiga version of Indy3/Loom/Maniac/Zak
Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h 2006-03-02 06:33:15 UTC (rev 21005)
+++ scummvm/trunk/engines/scumm/scumm.h 2006-03-02 09:34:48 UTC (rev 21006)
@@ -667,9 +667,6 @@
int _vmStack[150];
int _keyScriptKey, _keyScriptNo;
- // See the ScummEngine constructor and checkAndRunSentenceScript()
- int _defaultFTSentenceScript, _buggyFTSentenceScript;
-
virtual void setupOpcodes() = 0;
virtual void executeOpcode(byte i) = 0;
virtual const char *getOpcodeDesc(byte i) = 0;
More information about the Scummvm-git-logs
mailing list