diff options
author | Max Horn | 2002-12-25 14:46:39 +0000 |
---|---|---|
committer | Max Horn | 2002-12-25 14:46:39 +0000 |
commit | 004ea9f8eb7aa3cd79540c72b75986a9fa182cf6 (patch) | |
tree | 136ede26c4d6b73c99b3b102b18d548b1aae9ab3 /scumm/script.cpp | |
parent | a01b169434b87aacb67fd1939545f3b3120ae235 (diff) | |
download | scummvm-rg350-004ea9f8eb7aa3cd79540c72b75986a9fa182cf6.tar.gz scummvm-rg350-004ea9f8eb7aa3cd79540c72b75986a9fa182cf6.tar.bz2 scummvm-rg350-004ea9f8eb7aa3cd79540c72b75986a9fa182cf6.zip |
converted heaps of int16 to int for V8 compatibility; fixed defineArray for V8; added some work in o8_kludge2
svn-id: r6132
Diffstat (limited to 'scumm/script.cpp')
-rw-r--r-- | scumm/script.cpp | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/scumm/script.cpp b/scumm/script.cpp index beeeeffec0..7d036bdd7d 100644 --- a/scumm/script.cpp +++ b/scumm/script.cpp @@ -35,7 +35,7 @@ enum { /* Start executing script 'script' with parameters 'a' and 'b' */ -void Scumm::runScript(int script, int a, int b, int16 *lvarptr) +void Scumm::runScript(int script, int a, int b, int *lvarptr) { byte *scriptPtr; uint32 scriptOffs; @@ -592,7 +592,7 @@ bool Scumm::isScriptInUse(int script) void Scumm::runHook(int i) { - int16 tmp[16]; + int tmp[16]; tmp[0] = i; if (_vars[VAR_HOOK_SCRIPT]) { runScript(_vars[VAR_HOOK_SCRIPT], 0, 0, tmp); @@ -781,7 +781,7 @@ void Scumm::checkAndRunSentenceScript() void Scumm::runInputScript(int a, int cmd, int mode) { - int16 args[16]; + int args[16]; memset(args, 0, sizeof(args)); args[0] = a; args[1] = cmd; @@ -805,7 +805,7 @@ void Scumm::decreaseScriptDelay(int amount) } } -void Scumm::runVerbCode(int object, int entry, int a, int b, int16 *vars) +void Scumm::runVerbCode(int object, int entry, int a, int b, int *vars) { uint32 obcd; int slot, where, offs; @@ -843,7 +843,7 @@ void Scumm::runVerbCode(int object, int entry, int a, int b, int16 *vars) runScriptNested(slot); } -void Scumm::initializeLocals(int slot, int16 *vars) +void Scumm::initializeLocals(int slot, int *vars) { int i; if (!vars) { @@ -897,7 +897,7 @@ void Scumm::endCutscene() { ScriptSlot *ss = &vm.slot[_currentScript]; uint32 *csptr; - int16 args[16]; + int args[16]; memset(args, 0, sizeof(args)); @@ -919,7 +919,7 @@ void Scumm::endCutscene() runScript(_vars[VAR_CUTSCENE_END_SCRIPT], 0, 0, args); } -void Scumm::cutscene(int16 *args) +void Scumm::cutscene(int *args) { int scr = _currentScript; vm.slot[scr].cutsceneOverride++; @@ -1016,21 +1016,30 @@ int Scumm::defineArray(int array, int type, int dim2, int dim1) id = getArrayId(); - if (array & 0x4000) { - _arrays[id] = (char)vm.slot[_currentScript].number; - } - - if (array & 0x8000) { - error("Can't define bit variable as array pointer"); - } - - writeVar(array, id); - if (_features & GF_AFTER_V8) { + if (array & 0x40000000) { + _arrays[id] = (char)vm.slot[_currentScript].number; + } + + if (array & 0x80000000) { + error("Can't define bit variable as array pointer"); + } + size = (type == 5) ? 32 : 8; } else { + if (array & 0x4000) { + _arrays[id] = (char)vm.slot[_currentScript].number; + } + + if (array & 0x8000) { + error("Can't define bit variable as array pointer"); + } + size = (type == 5) ? 16 : 8; } + + writeVar(array, id); + size *= dim2 + 1; size *= dim1 + 1; size >>= 3; |