aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/he/script_v100he.cpp5
-rw-r--r--engines/scumm/he/script_v70he.cpp5
-rw-r--r--engines/scumm/he/sound_he.cpp4
-rw-r--r--engines/scumm/imuse_digi/dimuse_codecs.cpp4
-rw-r--r--engines/scumm/insane/insane_enemy.cpp96
-rw-r--r--engines/scumm/script.cpp5
-rw-r--r--engines/scumm/string.cpp6
7 files changed, 57 insertions, 68 deletions
diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp
index b6f92942a1..e057ab524a 100644
--- a/engines/scumm/he/script_v100he.cpp
+++ b/engines/scumm/he/script_v100he.cpp
@@ -2350,10 +2350,10 @@ void ScummEngine_v100he::o100_debugInput() {
void ScummEngine_v100he::o100_isResourceLoaded() {
// Reports percentage of resource loaded by queue
- int type;
+ ResType type;
byte subOp = fetchScriptByte();
- /* int idx = */ pop();
+ int idx = pop();
switch (subOp) {
case 25:
@@ -2374,6 +2374,7 @@ void ScummEngine_v100he::o100_isResourceLoaded() {
default:
error("o100_isResourceLoaded: default case %d", subOp);
}
+ debug(7, "o100_isResourceLoaded(%d,%d)", type, idx);
push(100);
}
diff --git a/engines/scumm/he/script_v70he.cpp b/engines/scumm/he/script_v70he.cpp
index 684ccff3ec..adb2fcac2e 100644
--- a/engines/scumm/he/script_v70he.cpp
+++ b/engines/scumm/he/script_v70he.cpp
@@ -361,10 +361,10 @@ void ScummEngine_v70he::o70_getStringLen() {
void ScummEngine_v70he::o70_isResourceLoaded() {
// Reports percentage of resource loaded by queue
- int type;
+ ResType type;
byte subOp = fetchScriptByte();
- /* int idx = */ pop();
+ int idx = pop();
switch (subOp) {
case 18:
@@ -385,6 +385,7 @@ void ScummEngine_v70he::o70_isResourceLoaded() {
default:
error("o70_isResourceLoaded: default case %d", subOp);
}
+ debug(7, "o70_isResourceLoaded(%d,%d)", type, idx);
push(100);
}
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp
index 85a8c02665..5c15a85929 100644
--- a/engines/scumm/he/sound_he.cpp
+++ b/engines/scumm/he/sound_he.cpp
@@ -302,13 +302,13 @@ void SoundHE::setOverrideFreq(int freq) {
}
void SoundHE::setupHEMusicFile() {
- int i, total_size;
+ int i;
Common::File musicFile;
Common::String buf(_vm->generateFilename(-4));
if (musicFile.open(buf) == true) {
musicFile.seek(4, SEEK_SET);
- total_size = musicFile.readUint32BE();
+ /*int total_size =*/ musicFile.readUint32BE();
musicFile.seek(16, SEEK_SET);
_heMusicTracks = musicFile.readUint32LE();
debug(5, "Total music tracks %d", _heMusicTracks);
diff --git a/engines/scumm/imuse_digi/dimuse_codecs.cpp b/engines/scumm/imuse_digi/dimuse_codecs.cpp
index b0ecacf31c..69cd89320c 100644
--- a/engines/scumm/imuse_digi/dimuse_codecs.cpp
+++ b/engines/scumm/imuse_digi/dimuse_codecs.cpp
@@ -206,7 +206,7 @@ int32 decompressADPCM(byte *compInput, byte *compOutput, int channels) {
int32 destPos;
int16 firstWord;
byte initialTablePos[MAX_CHANNELS] = {0, 0};
- int32 initialimcTableEntry[MAX_CHANNELS] = {7, 7};
+ //int32 initialimcTableEntry[MAX_CHANNELS] = {7, 7};
int32 initialOutputWord[MAX_CHANNELS] = {0, 0};
int32 totalBitOffset, curTablePos, outputWord;
byte *dst;
@@ -245,7 +245,7 @@ int32 decompressADPCM(byte *compInput, byte *compOutput, int channels) {
for (i = 0; i < channels; i++) {
initialTablePos[i] = *src;
src += 1;
- initialimcTableEntry[i] = READ_BE_UINT32(src);
+ //initialimcTableEntry[i] = READ_BE_UINT32(src);
src += 4;
initialOutputWord[i] = READ_BE_UINT32(src);
src += 4;
diff --git a/engines/scumm/insane/insane_enemy.cpp b/engines/scumm/insane/insane_enemy.cpp
index b26fa9d7fa..68766ab72c 100644
--- a/engines/scumm/insane/insane_enemy.cpp
+++ b/engines/scumm/insane/insane_enemy.cpp
@@ -88,14 +88,13 @@ int32 Insane::enemyHandler(int num, int32 actor1, int32 actor2, int32 probabilit
}
int32 Insane::enemy0handler(int32 actor1, int32 actor2, int32 probability) {
- int32 act1damage, act2damage, act1x, act2x, retval;
int32 dist;
- retval = 0;
- act1damage = _actor[actor1].damage; // ebx
- act2damage = _actor[actor2].damage; // ebp
- act1x = _actor[actor1].x; // esi
- act2x = _actor[actor2].x; // edi
+ int32 retval = 0;
+ int32 act1damage = _actor[actor1].damage; // ebx
+ int32 act2damage = _actor[actor2].damage; // ebp
+ int32 act1x = _actor[actor1].x; // esi
+ int32 act2x = _actor[actor2].x; // edi
if (!_actor[actor1].defunct) {
if (_enHdlVar[EN_ROTT1][1] > _enHdlVar[EN_ROTT1][2]) {
@@ -252,14 +251,13 @@ int32 Insane::enemy0initializer(int32 actor1, int32 actor2, int32 probability) {
}
int32 Insane::enemy1handler(int32 actor1, int32 actor2, int32 probability) {
- int32 act1damage, act2damage, act1x, act2x, retval;
int32 dist;
- retval = 0;
- act1damage = _actor[actor1].damage; // ebx
- act2damage = _actor[actor2].damage; // ebp
- act1x = _actor[actor1].x; // esi
- act2x = _actor[actor2].x; // edi
+ int32 retval = 0;
+ int32 act1damage = _actor[actor1].damage; // ebx
+ int32 act2damage = _actor[actor2].damage; // ebp
+ int32 act1x = _actor[actor1].x; // esi
+ int32 act2x = _actor[actor2].x; // edi
if (!_actor[actor1].defunct) {
if (_enHdlVar[EN_ROTT2][1] > _enHdlVar[EN_ROTT2][2]) {
@@ -397,14 +395,13 @@ int32 Insane::enemy1initializer(int32 actor1, int32 actor2, int32 probability) {
}
int32 Insane::enemy2handler(int32 actor1, int32 actor2, int32 probability) {
- int32 act1damage, act2damage, act1x, act2x, retval;
int32 dist;
- retval = 0;
- act1damage = _actor[actor1].damage; // ebx
- act2damage = _actor[actor2].damage; // ebp
- act1x = _actor[actor1].x; // esi
- act2x = _actor[actor2].x; // edi
+ int32 retval = 0;
+ int32 act1damage = _actor[actor1].damage; // ebx
+ int32 act2damage = _actor[actor2].damage; // ebp
+ int32 act1x = _actor[actor1].x; // esi
+ int32 act2x = _actor[actor2].x; // edi
if (!_actor[actor1].defunct) {
if (_enHdlVar[EN_ROTT3][1] > _enHdlVar[EN_ROTT3][2]) {
@@ -546,14 +543,13 @@ int32 Insane::enemy2initializer(int32 actor1, int32 actor2, int32 probability) {
}
int32 Insane::enemy3handler(int32 actor1, int32 actor2, int32 probability) {
- int32 act1damage, act2damage, act1x, act2x, retval;
int32 dist;
- retval = 0;
- act1damage = _actor[actor1].damage; // ebx
- act2damage = _actor[actor2].damage; // ebp
- act1x = _actor[actor1].x; // esi
- act2x = _actor[actor2].x; // edi
+ int32 retval = 0;
+ int32 act1damage = _actor[actor1].damage; // ebx
+ int32 act2damage = _actor[actor2].damage; // ebp
+ int32 act1x = _actor[actor1].x; // esi
+ int32 act2x = _actor[actor2].x; // edi
if (!_actor[actor1].defunct) {
if (_enHdlVar[EN_VULTF1][1] > _enHdlVar[EN_VULTF1][2]) {
@@ -703,14 +699,13 @@ int32 Insane::enemy3initializer(int32 actor1, int32 actor2, int32 probability) {
}
int32 Insane::enemy4handler(int32 actor1, int32 actor2, int32 probability) {
- int32 act1damage, act2damage, act1x, act2x, retval;
int32 dist;
- retval = 0;
- act1damage = _actor[actor1].damage; // ebx
- act2damage = _actor[actor2].damage; // ebp
- act1x = _actor[actor1].x; // esi
- act2x = _actor[actor2].x; // edi
+ int32 retval = 0;
+ int32 act1damage = _actor[actor1].damage; // ebx
+ int32 act2damage = _actor[actor2].damage; // ebp
+ int32 act1x = _actor[actor1].x; // esi
+ int32 act2x = _actor[actor2].x; // edi
if (!_actor[actor1].defunct) {
if (_enHdlVar[EN_VULTM1][1] > _enHdlVar[EN_VULTM1][2]) {
@@ -873,15 +868,12 @@ int32 Insane::enemy4initializer(int32 actor1, int32 actor2, int32 probability) {
}
int32 Insane::enemy5handler(int32 actor1, int32 actor2, int32 probability) {
- int32 act1damage, act1x, act2x, retval;
- int32 dist;
-
- retval = 0;
- act1damage = _actor[actor1].damage; // ebx
- act1x = _actor[actor1].x; // esi
- act2x = _actor[actor2].x; // ebp
+ int32 retval = 0;
+ int32 act1damage = _actor[actor1].damage; // ebx
+ int32 act1x = _actor[actor1].x; // esi
+ int32 act2x = _actor[actor2].x; // ebp
- dist = ABS(act1x - act2x);
+ int32 dist = ABS(act1x - act2x);
if (weaponMaxRange(actor1) >= dist) {
if (!_enHdlVar[EN_VULTF2][2])
@@ -1019,19 +1011,16 @@ int32 Insane::enemy5initializer(int32 actor1, int32 actor2, int32 probability) {
}
int32 Insane::enemy6handler(int32 actor1, int32 actor2, int32 probability) {
- int32 act1damage, act2damage, act1x, act2x, retval;
- int32 dist;
-
- retval = 0;
- act1damage = _actor[actor1].damage; // ebx //ebx
- act2damage = _actor[actor2].damage; // ebp // edi
- act1x = _actor[actor1].x; // esi
- act2x = _actor[actor2].x; // edi
+ int32 retval = 0;
+ int32 act1damage = _actor[actor1].damage; // ebx //ebx
+ //int32 act2damage = _actor[actor2].damage; // ebp // edi
+ int32 act1x = _actor[actor1].x; // esi
+ int32 act2x = _actor[actor2].x; // edi
if (_actor[actor2].weapon == INV_CHAINSAW)
retval = 1;
- dist = ABS(act1x - act2x);
+ int32 dist = ABS(act1x - act2x);
if (_actor[actor1].defunct) {
/* scenePropIdx[18] */
@@ -1160,15 +1149,12 @@ int32 Insane::enemy6initializer(int32 actor1, int32 actor2, int32 probability) {
}
int32 Insane::enemy7handler(int32 actor1, int32 actor2, int32 probability) {
- int32 act1damage, act1x, act2x, retval;
- int32 dist;
-
- retval = 0;
- act1damage = _actor[actor1].damage; // ebx
- act1x = _actor[actor1].x; // ebp, esi
- act2x = _actor[actor2].x; // edi
+ int32 retval = 0;
+ int32 act1damage = _actor[actor1].damage; // ebx
+ int32 act1x = _actor[actor1].x; // ebp, esi
+ int32 act2x = _actor[actor2].x; // edi
- dist = ABS(act1x - act2x);
+ int32 dist = ABS(act1x - act2x);
if (_enHdlVar[EN_CAVEFISH][1] >= 600) {
_enHdlVar[EN_CAVEFISH][2] = 1;
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index 4402445b1d..cd9a0ed1c8 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -36,7 +36,7 @@ namespace Scumm {
/* Start executing script 'script' with the given parameters */
void ScummEngine::runScript(int script, bool freezeResistant, bool recursive, int *lvarptr, int cycle) {
ScriptSlot *s;
- byte *scriptPtr;
+ //byte *scriptPtr;
uint32 scriptOffs;
byte scriptType;
int slot;
@@ -48,7 +48,8 @@ void ScummEngine::runScript(int script, bool freezeResistant, bool recursive, in
stopScript(script);
if (script < _numGlobalScripts) {
- scriptPtr = getResourceAddress(rtScript, script);
+ // Call getResourceAddress to ensure the resource is loaded & its usage count reset
+ /*scriptPtr =*/ getResourceAddress(rtScript, script);
scriptOffs = _resourceHeaderSize;
scriptType = WIO_GLOBAL;
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 54826c3fea..c27b6d5e1c 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -352,7 +352,7 @@ bool ScummEngine::handleNextCharsetCode(Actor *a, int *code) {
bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) {
const int charsetCode = (_game.heversion >= 80) ? 127 : 64;
uint32 talk_sound_a = 0;
- uint32 talk_sound_b = 0;
+ //uint32 talk_sound_b = 0;
int i, c = 0;
char value[32];
bool endLoop = false;
@@ -383,7 +383,7 @@ bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) {
i++;
}
value[i] = 0;
- talk_sound_b = atoi(value);
+ //talk_sound_b = atoi(value);
((SoundHE *)_sound)->startHETalkSound(talk_sound_a);
break;
case 104:
@@ -406,7 +406,7 @@ bool ScummEngine_v72he::handleNextCharsetCode(Actor *a, int *code) {
}
value[i] = 0;
talk_sound_a = atoi(value);
- talk_sound_b = 0;
+ //talk_sound_b = 0;
((SoundHE *)_sound)->startHETalkSound(talk_sound_a);
break;
case 119: