aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2004-01-19 22:55:42 +0000
committerMax Horn2004-01-19 22:55:42 +0000
commit2f7198a3acabe4db57a001817686abe397c96e3f (patch)
tree90b0c58278be2e6b48dfff561aac62c8d4a38a36 /scumm
parent95891f95c728cdcf8bbd66d42a4c2b08c735b4fc (diff)
downloadscummvm-rg350-2f7198a3acabe4db57a001817686abe397c96e3f.tar.gz
scummvm-rg350-2f7198a3acabe4db57a001817686abe397c96e3f.tar.bz2
scummvm-rg350-2f7198a3acabe4db57a001817686abe397c96e3f.zip
cleanup
svn-id: r12528
Diffstat (limited to 'scumm')
-rw-r--r--scumm/insane/insane.cpp110
-rw-r--r--scumm/insane/insane.h6
-rw-r--r--scumm/insane/insane_ben.cpp48
-rw-r--r--scumm/insane/insane_enemy.cpp18
-rw-r--r--scumm/insane/insane_iact.cpp44
-rw-r--r--scumm/insane/insane_scenes.cpp118
-rw-r--r--scumm/script_v6.cpp4
7 files changed, 175 insertions, 173 deletions
diff --git a/scumm/insane/insane.cpp b/scumm/insane/insane.cpp
index bc45ab70a7..def4a29646 100644
--- a/scumm/insane/insane.cpp
+++ b/scumm/insane/insane.cpp
@@ -666,36 +666,36 @@ void Insane::putActors(void) {
}
void Insane::readState(void) {
- _actor[0].inventory[INV_CHAIN] = readArray(_numberArray, 50) != 0;
- _actor[0].inventory[INV_CHAINSAW] = readArray(_numberArray, 51) != 0;
- _actor[0].inventory[INV_MACE] = readArray(_numberArray, 52) != 0;
- _actor[0].inventory[INV_2X4] = readArray(_numberArray, 53) != 0;
- _actor[0].inventory[INV_WRENCH] = readArray(_numberArray, 54) != 0;
- _actor[0].inventory[INV_DUST] = readArray(_numberArray, 55) != 0;
+ _actor[0].inventory[INV_CHAIN] = readArray(50) != 0;
+ _actor[0].inventory[INV_CHAINSAW] = readArray(51) != 0;
+ _actor[0].inventory[INV_MACE] = readArray(52) != 0;
+ _actor[0].inventory[INV_2X4] = readArray(53) != 0;
+ _actor[0].inventory[INV_WRENCH] = readArray(54) != 0;
+ _actor[0].inventory[INV_DUST] = readArray(55) != 0;
_actor[0].inventory[INV_HAND] = 1; // Boot
_actor[0].inventory[INV_BOOT] = 1; // Hand
- _smlayer_room = readArray(_numberArray, 320);
- _smlayer_room2 = readArray(_numberArray, 321);
- _val55d = readArray(_numberArray, 322);
- _val53d = readArray(_numberArray, 323);
- _val57d = readArray(_numberArray, 324);
- _val52d = readArray(_numberArray, 325);
- _val56d = readArray(_numberArray, 326);
- _val54d = readArray(_numberArray, 327);
- _val51d = readArray(_numberArray, 328);
- _enemy[EN_TORQUE].field_8 = readArray(_numberArray, 337);
- _enemy[EN_ROTT1].field_8 = readArray(_numberArray, 329);
- _enemy[EN_ROTT2].field_8 = readArray(_numberArray, 330);
- _enemy[EN_ROTT3].field_8 = readArray(_numberArray, 331);
- _enemy[EN_VULTF1].field_8 = readArray(_numberArray, 332);
- _enemy[EN_VULTM1].field_8 = readArray(_numberArray, 333);
- _enemy[EN_VULTF2].field_8 = readArray(_numberArray, 334);
- _enemy[EN_VULTM2].field_8 = readArray(_numberArray, 335);
- _enemy[EN_CAVEFISH].field_8 = readArray(_numberArray, 336);
- _enemy[EN_VULTM2].field_10 = readArray(_numberArray, 340);
- _enemy[EN_CAVEFISH].field_10 = readArray(_numberArray, 56);
- _enemy[EN_VULTF2].field_10 = readArray(_numberArray, 339);
+ _smlayer_room = readArray(320);
+ _smlayer_room2 = readArray(321);
+ _val55d = readArray(322);
+ _val53d = readArray(323);
+ _val57d = readArray(324);
+ _val52d = readArray(325);
+ _val56d = readArray(326);
+ _val54d = readArray(327);
+ _val51d = readArray(328);
+ _enemy[EN_TORQUE].field_8 = readArray(337);
+ _enemy[EN_ROTT1].field_8 = readArray(329);
+ _enemy[EN_ROTT2].field_8 = readArray(330);
+ _enemy[EN_ROTT3].field_8 = readArray(331);
+ _enemy[EN_VULTF1].field_8 = readArray(332);
+ _enemy[EN_VULTM1].field_8 = readArray(333);
+ _enemy[EN_VULTF2].field_8 = readArray(334);
+ _enemy[EN_VULTM2].field_8 = readArray(335);
+ _enemy[EN_CAVEFISH].field_8 = readArray(336);
+ _enemy[EN_VULTM2].field_10 = readArray(340);
+ _enemy[EN_CAVEFISH].field_10 = readArray(56);
+ _enemy[EN_VULTF2].field_10 = readArray(339);
}
void Insane::setTrsFile(int file) {
@@ -804,7 +804,7 @@ void Insane::smush_setToFinish(void) {
// smlayer_stopSound
void Insane::smlayer_stopSound(int idx) {
- _vm->_sound->stopSound(readArray(_numberArray, idx));
+ _vm->_sound->stopSound(readArray(idx));
}
void Insane::switchSceneIfNeeded(void) {
@@ -939,9 +939,9 @@ int32 Insane::weaponDamage(int32 actornum) {
}
void Insane::reinitActors(void) {
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 12));
- smlayer_setActorCostume(0, 0, readArray(_numberArray, 14));
- smlayer_setActorCostume(0, 1, readArray(_numberArray, 13));
+ smlayer_setActorCostume(0, 2, readArray(12));
+ smlayer_setActorCostume(0, 0, readArray(14));
+ smlayer_setActorCostume(0, 1, readArray(13));
smlayer_setActorLayer(0, 1, 1);
smlayer_setActorLayer(0, 2, 5);
smlayer_setActorLayer(0, 0, 10);
@@ -1002,11 +1002,11 @@ void Insane::escapeKeyHandler(void) {
switch (_currSceneId) {
case 1:
queueSceneSwitch(1, _smush_minedrivFlu, "minedriv.san", 64, 0, _continueFrame1, 1300);
- setWordInString(_numberArray, 9, 0);
+ writeArray(9, 0);
break;
case 18:
queueSceneSwitch(1, _smush_minedrivFlu, "minedriv.san", 64, 0, _continueFrame1, 1300);
- setWordInString(_numberArray, 9, 1);
+ writeArray(9, 1);
break;
case 2:
flu = &_fluConf[14 + _iactSceneId2];
@@ -1020,14 +1020,14 @@ void Insane::escapeKeyHandler(void) {
if (_needSceneSwitch)
return;
- if (readArray(_numberArray, 6)) {
- if (readArray(_numberArray, 4)) {
+ if (readArray(6)) {
+ if (readArray(4)) {
queueSceneSwitch(14, 0, "hitdust2.san", 64, 0, 0, 0);
} else {
queueSceneSwitch(14, 0, "hitdust4.san", 64, 0, 0, 0);
}
} else {
- if (readArray(_numberArray, 4)) {
+ if (readArray(4)) {
queueSceneSwitch(14, 0, "hitdust1.san", 64, 0, 0, 0);
} else {
queueSceneSwitch(14, 0, "hitdust3.san", 64, 0, 0, 0);
@@ -1035,26 +1035,26 @@ void Insane::escapeKeyHandler(void) {
}
break;
case 5:
- if (readArray(_numberArray, 4)) {
+ if (readArray(4)) {
if (_needSceneSwitch)
return;
queueSceneSwitch(15, 0, "vistthru.san", 64, 0, 0, 0);
} else {
- setWordInString(_numberArray, 1, _val53d);
+ writeArray(1, _val53d);
smush_setToFinish();
}
break;
case 6:
- if (readArray(_numberArray, 4)) {
+ if (readArray(4)) {
if (_needSceneSwitch)
return;
queueSceneSwitch(15, 0, "chasthru.san", 64, 0, 0, 0);
} else {
- if (readArray(_numberArray, 5)) {
- setWordInString(_numberArray, 1, _val57d);
+ if (readArray(5)) {
+ writeArray(1, _val57d);
smush_setToFinish();
} else {
- setWordInString(_numberArray, 4, 1);
+ writeArray(4, 1);
queueSceneSwitch(15, 0, "chasout.san", 64, 0, 0, 0);
}
}
@@ -1088,10 +1088,10 @@ void Insane::escapeKeyHandler(void) {
queueSceneSwitch(21, 0, "rottfite.san", 64, 0, 0, 0);
break;
case 16:
- setWordInString(_numberArray, 4, 0);
- setWordInString(_numberArray, 5, 1);
- setWordInString(_numberArray, 1, _val56d);
- setWordInString(_numberArray, 3, _val55d);
+ writeArray(4, 0);
+ writeArray(5, 1);
+ writeArray(1, _val56d);
+ writeArray(3, _val55d);
smush_setToFinish();
break;
case 15:
@@ -1153,7 +1153,7 @@ int Insane::smlayer_loadSound(int id, int flag, int phase) {
if (_objArray2Idx >= _objArray2Idx2)
return 0;
}
- resid = readArray(_numberArray, id);
+ resid = readArray(id);
if (!resid && phase == 2)
return 0;
@@ -1187,7 +1187,7 @@ void Insane::IMUSE_restoreVolume(void) {
// smlayer_loadCostume1 && smlayer_loadCostume2
int Insane::smlayer_loadCostume(int id, int phase) {
int resid;
- resid = readArray(_numberArray, id);
+ resid = readArray(id);
if (!resid)
return 0;
@@ -1235,12 +1235,12 @@ void Insane::smlayer_setFluPalette(byte *pal, int shut_flag) {
}
bool Insane::smlayer_isSoundRunning(int32 sound) {
- return _vm->_sound->isSoundRunning(readArray(_numberArray, sound)) != 0;
+ return _vm->_sound->isSoundRunning(readArray(sound)) != 0;
}
bool Insane::smlayer_startSfx(int32 sound) {
if (smlayer_loadSound(sound, 0, 2)) {
- _vm->_imuseDigital->startSfx(readArray(_numberArray, sound));
+ _vm->_imuseDigital->startSfx(readArray(sound));
return true;
} else
return false;
@@ -1248,7 +1248,7 @@ bool Insane::smlayer_startSfx(int32 sound) {
bool Insane::smlayer_startVoice(int32 sound) {
if (smlayer_loadSound(sound, 0, 2)) {
- _vm->_imuseDigital->startSfx(readArray(_numberArray, sound));
+ _vm->_imuseDigital->startSfx(readArray(sound));
return true;
} else
return false;
@@ -1375,12 +1375,12 @@ void Insane::smush_setPaletteValue(int where, int r, int g, int b) {
warning("stub Insane::smlayer_setPaletteValue(%d, %d, %d, %d)", where, r, g, b);
}
-int32 Insane::readArray (int number, int item) {
- return _vm->readArray (number, 0, item);
+int32 Insane::readArray (int item) {
+ return _vm->readArray(_numberArray, 0, item);
}
-void Insane::setWordInString(int number, int item, int value) {
- _vm->writeArray(number, 0, item, value);
+void Insane::writeArray(int item, int value) {
+ _vm->writeArray(_numberArray, 0, item, value);
}
void Insane::smush_setupSanWithFlu(const char *filename, int32 setupsan2, int32 step1,
diff --git a/scumm/insane/insane.h b/scumm/insane/insane.h
index 4851d11428..f4bd574dd4 100644
--- a/scumm/insane/insane.h
+++ b/scumm/insane/insane.h
@@ -303,8 +303,10 @@ class Insane {
void smlayer_putActor(int actornum, int act, int x, int y, byte room);
void smlayer_setActorLayer(int actornum, int act, int layer);
void smlayer_setFluPalette(byte *pal, int shut_flag);
- int32 readArray (int field, int number);
- void setWordInString(int field, int number, int value);
+
+ int32 readArray(int item);
+ void writeArray(int item, int value);
+
int smlayer_mainLoop(void);
void mainLoop(void);
bool idx1Compare(void);
diff --git a/scumm/insane/insane_ben.cpp b/scumm/insane/insane_ben.cpp
index 1c7549151f..45e4b53b74 100644
--- a/scumm/insane/insane_ben.cpp
+++ b/scumm/insane/insane_ben.cpp
@@ -250,7 +250,7 @@ void Insane::mineChooseRoad(int32 buttons) {
case 17:
if (buttons & 1) {
if (_val123_) {
- setWordInString(_numberArray, 1, _val52d);
+ writeArray(1, _val52d);
smush_setToFinish();
}
@@ -303,7 +303,7 @@ void Insane::mineChooseRoad(int32 buttons) {
if (_val119_ && !_needSceneSwitch) {
_iactSceneId2 = _iactSceneId;
- if (readArray(_numberArray, 4) && _val211d < 3) {
+ if (readArray(4) && _val211d < 3) {
_val211d++;
queueSceneSwitch(8, 0, "fishfear.san", 64, 0, 0, 0);
} else {
@@ -312,16 +312,16 @@ void Insane::mineChooseRoad(int32 buttons) {
}
if (_val120_) {
- setWordInString(_numberArray, 1, _val55d);
- setWordInString(_numberArray, 3, _val57d);
+ writeArray(1, _val55d);
+ writeArray(3, _val57d);
smush_setToFinish();
}
if (!_val212_)
return;
- setWordInString(_numberArray, 1, _val56d);
- setWordInString(_numberArray, 3, _val57d);
+ writeArray(1, _val56d);
+ writeArray(3, _val57d);
smush_setToFinish();
break;
case 6:
@@ -340,7 +340,7 @@ void Insane::mineChooseRoad(int32 buttons) {
if (_val119_ && !_needSceneSwitch) {
_iactSceneId2 = _iactSceneId;
- if (readArray(_numberArray, 4) && _val211d < 3) {
+ if (readArray(4) && _val211d < 3) {
_val211d++;
queueSceneSwitch(7, 0, "fishfear.san", 64, 0, 0, 0);
} else {
@@ -349,16 +349,16 @@ void Insane::mineChooseRoad(int32 buttons) {
}
if (_val120_) {
- setWordInString(_numberArray, 1, _val55d);
- setWordInString(_numberArray, 3, _val53d);
+ writeArray(1, _val55d);
+ writeArray(3, _val53d);
smush_setToFinish();
}
if (!_val212_)
return;
- setWordInString(_numberArray, 1, _val56d);
- setWordInString(_numberArray, 3, _val53d);
+ writeArray(1, _val56d);
+ writeArray(3, _val53d);
smush_setToFinish();
break;
default:
@@ -769,7 +769,7 @@ void Insane::actor02Reaction(int32 buttons) {
_actor[0].act[1].room = 0;
_actor[0].act[0].room = 0;
smlayer_setActorLayer(0, 2, 25);
- smlayer_setActorCostume(1, 2, readArray(_numberArray, 45));
+ smlayer_setActorCostume(1, 2, readArray(45));
smlayer_setActorFacing(1, 2, 6, 180);
smlayer_startSfx(101);
_actor[1].act[2].state = 97;
@@ -854,7 +854,7 @@ void Insane::actor02Reaction(int32 buttons) {
_actor[0].weaponClass = 2;
_actor[0].field_34 = 1;
_actor[0].kicking = 0;
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 22));
+ smlayer_setActorCostume(0, 2, readArray(22));
smlayer_setActorFacing(0, 2, 19, 180);
_actor[0].act[2].state = 7;
_actor[0].act[2].tilt = calcTilt(_actor[0].tilt);
@@ -893,7 +893,7 @@ void Insane::actor02Reaction(int32 buttons) {
_actor[0].field_34 = 1;
_actor[0].kicking = 0;
if (_actor[0].act[2].frame >= 3) {
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 12));
+ smlayer_setActorCostume(0, 2, readArray(12));
_actor[0].field_34 = 2;
_actor[0].act[2].state = 1;
}
@@ -1264,7 +1264,7 @@ void Insane::actor02Reaction(int32 buttons) {
case 30:
smlayer_setActorLayer(0, 2, 4);
_actor[0].weaponClass = 1;
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 21));
+ smlayer_setActorCostume(0, 2, readArray(21));
smlayer_setActorFacing(0, 2, 18, 180);
_actor[0].act[2].state = 31;
_actor[0].act[2].tilt = calcTilt(_actor[0].tilt);
@@ -1310,7 +1310,7 @@ void Insane::actor02Reaction(int32 buttons) {
_actor[0].weaponClass = 1;
_actor[0].kicking = 0;
if (_actor[0].act[2].frame >= 5) {
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 12));
+ smlayer_setActorCostume(0, 2, readArray(12));
_actor[0].act[2].state = 1;
}
_actor[0].act[2].tilt = calcTilt(_actor[0].tilt);
@@ -1318,7 +1318,7 @@ void Insane::actor02Reaction(int32 buttons) {
case 36:
smlayer_setActorLayer(0, 2, 5);
_actor[0].kicking = 0;
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 18));
+ smlayer_setActorCostume(0, 2, readArray(18));
smlayer_setActorFacing(0, 2, 6, 180);
smlayer_startSfx(96);
switch (_currEnemy) {
@@ -1876,35 +1876,35 @@ void Insane::switchBenWeapon(void) {
switch (_actor[0].weapon) {
case INV_CHAIN:
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 20));
+ smlayer_setActorCostume(0, 2, readArray(20));
smlayer_setActorFacing(0, 2, 18, 180);
_actor[0].weaponClass = 0;
_actor[0].act[2].state = 34;
break;
case INV_CHAINSAW:
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 24));
+ smlayer_setActorCostume(0, 2, readArray(24));
smlayer_setActorFacing(0, 2, 18, 180);
_actor[0].weaponClass = 0;
_actor[0].act[2].state = 34;
break;
case INV_MACE:
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 23));
+ smlayer_setActorCostume(0, 2, readArray(23));
smlayer_setActorFacing(0, 2, 18, 180);
_actor[0].weaponClass = 0;
_actor[0].act[2].state = 34;
break;
case INV_2X4:
if (_currEnemy == EN_CAVEFISH)
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 38));
+ smlayer_setActorCostume(0, 2, readArray(38));
else
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 19));
+ smlayer_setActorCostume(0, 2, readArray(19));
smlayer_setActorFacing(0, 2, 18, 180);
_actor[0].weaponClass = 0;
_actor[0].act[2].state = 34;
break;
case INV_WRENCH:
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 25));
+ smlayer_setActorCostume(0, 2, readArray(25));
smlayer_setActorFacing(0, 2, 18, 180);
_actor[0].weaponClass = 0;
_actor[0].act[2].state = 34;
@@ -1912,7 +1912,7 @@ void Insane::switchBenWeapon(void) {
case INV_BOOT:
case INV_HAND:
case INV_DUST:
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 12));
+ smlayer_setActorCostume(0, 2, readArray(12));
_actor[0].weaponClass = 2;
_actor[0].act[2].state = 1;
break;
diff --git a/scumm/insane/insane_enemy.cpp b/scumm/insane/insane_enemy.cpp
index 8e235bf029..915da647c3 100644
--- a/scumm/insane/insane_enemy.cpp
+++ b/scumm/insane/insane_enemy.cpp
@@ -1149,7 +1149,7 @@ int32 Insane::enemy6handler(int32 actor1, int32 actor2, int32 probability) {
_actor[0].act[1].room = 0;
_actor[0].act[0].room = 0;
smlayer_setActorLayer(1, 2, 25);
- smlayer_setActorCostume(1, 2, readArray(_numberArray, 45));
+ smlayer_setActorCostume(1, 2, readArray(45));
smlayer_setActorFacing(1, 2, 6, 180);
_actor[1].act[2].state = 97;
_actor[1].act[2].room = 1;
@@ -1562,7 +1562,7 @@ void Insane::switchEnemyWeapon(void) {
case INV_MACE:
case INV_2X4:
case INV_WRENCH:
- smlayer_setActorCostume(1, 2, readArray(_numberArray, _enemy[_currEnemy].costume4));
+ smlayer_setActorCostume(1, 2, readArray(_enemy[_currEnemy].costume4));
smlayer_setActorFacing(1, 2, 18, 180);
_actor[1].weaponClass = 1;
_actor[1].act[2].state = 34;
@@ -1572,7 +1572,7 @@ void Insane::switchEnemyWeapon(void) {
_actor[1].act[2].state = 1;
break;
case INV_HAND:
- smlayer_setActorCostume(1, 2, readArray(_numberArray, _enemy[_currEnemy].costume4));
+ smlayer_setActorCostume(1, 2, readArray(_enemy[_currEnemy].costume4));
_actor[1].weaponClass = 2;
_actor[1].act[2].state = 1;
break;
@@ -2206,7 +2206,7 @@ void Insane::actor12Reaction(int32 buttons) {
_actor[1].weaponClass = 1;
_actor[1].kicking = 0;
if (_actor[1].act[2].frame >= 15) {
- smlayer_setActorCostume(1, 2, readArray(_numberArray, 44));
+ smlayer_setActorCostume(1, 2, readArray(44));
smlayer_setActorFacing(1, 2, 6, 180);
_actor[1].act[2].state = 95;
_actor[1].act[0].room = 0;
@@ -2231,7 +2231,7 @@ void Insane::actor12Reaction(int32 buttons) {
smlayer_setActorLayer(1, 2, 25);
_actor[1].lost = true;
if (_actor[1].act[2].frame >= 18) {
- setWordInString(_numberArray, 7, 1);
+ writeArray(7, 1);
_enemy[EN_VULTM2].field_10 = 1;
queueSceneSwitch(12, 0, "getnitro.san", 0, 0, 0, 0);
}
@@ -2273,7 +2273,7 @@ void Insane::actor12Reaction(int32 buttons) {
_actor[1].field_54 = 1;
_actor[1].cursorX = 0;
_actor[1].kicking = 0;
- smlayer_setActorCostume(1, 2, readArray(_numberArray, _enemy[_currEnemy].costumevar));
+ smlayer_setActorCostume(1, 2, readArray(_enemy[_currEnemy].costumevar));
smlayer_setActorFacing(1, 2, 6, 180);
smlayer_setActorLayer(1, 2, 25);
smlayer_startSfx(96);
@@ -2318,7 +2318,7 @@ void Insane::actor12Reaction(int32 buttons) {
_actor[1].lost = 1;
_actor[1].cursorX = 0;
_actor[1].kicking = 0;
- smlayer_setActorCostume(1, 2, readArray(_numberArray, 40));
+ smlayer_setActorCostume(1, 2, readArray(40));
smlayer_setActorFacing(1, 2, 6, 180);
smlayer_setActorLayer(1, 2, 25);
_actor[1].act[2].state = 103;
@@ -2335,7 +2335,7 @@ void Insane::actor12Reaction(int32 buttons) {
case 113:
_actor[1].lost = 1;
_actor[1].kicking = 0;
- smlayer_setActorCostume(1, 2, readArray(_numberArray, 46));
+ smlayer_setActorCostume(1, 2, readArray(46));
smlayer_setActorFacing(1, 2, 6, 180);
smlayer_setActorLayer(1, 2, 25);
_actor[1].act[1].room = 0;
@@ -2363,7 +2363,7 @@ void Insane::actor12Reaction(int32 buttons) {
case 115:
_actor[1].lost = 1;
_actor[1].kicking = 0;
- smlayer_setActorCostume(1, 2, readArray(_numberArray, 47));
+ smlayer_setActorCostume(1, 2, readArray(47));
smlayer_setActorFacing(1, 2, 6, 180);
smlayer_setActorLayer(1, 2, 25);
_actor[1].act[1].room = 0;
diff --git a/scumm/insane/insane_iact.cpp b/scumm/insane/insane_iact.cpp
index 048ac4f766..f7e4534507 100644
--- a/scumm/insane/insane_iact.cpp
+++ b/scumm/insane/insane_iact.cpp
@@ -138,7 +138,7 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12,
_iactSceneId = par4;
break;
case 7:
- if (readArray(_numberArray, 4) != 0)
+ if (readArray(4) != 0)
return;
_val120_ = true;
@@ -146,11 +146,11 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12,
_smush_icons2Nut, 8, 0, 0);
break;
case 8:
- if (readArray(_numberArray, 4) == 0 || readArray(_numberArray, 6) == 0)
+ if (readArray(4) == 0 || readArray(6) == 0)
return;
- setWordInString(_numberArray, 1, _val55d);
- setWordInString(_numberArray, 3, _val57d);
+ writeArray(1, _val55d);
+ writeArray(3, _val57d);
smush_setToFinish();
break;
@@ -192,7 +192,7 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12,
}
if (_val32d < 0 || _val32d > 4)
- if (readArray(_numberArray, 8)) {
+ if (readArray(8)) {
smlayer_drawSomething(renderBitmap, codecparam, 270, 20, 3,
_smush_icons2Nut, 20, 0, 0);
_val122_ = true;
@@ -200,7 +200,7 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12,
}
void Insane::proc62(void) {
- if (readArray(_numberArray, 58) == 0)
+ if (readArray(58) == 0)
_enemy[EN_TORQUE].field_10 = 1;
if (_enemy[EN_TORQUE].field_8 == 0) {
@@ -403,19 +403,19 @@ void Insane::iactScene4(byte *renderBitmap, int32 codecparam, int32 setupsan12,
switch (par3) {
case 1:
if (par4 == 1) {
- if (readArray(_numberArray, 6))
+ if (readArray(6))
setBit(par5);
else
clearBit(par5);
} else {
- if (readArray(_numberArray, 6))
+ if (readArray(6))
clearBit(par5);
else
setBit(par5);
}
break;
case 2:
- if (readArray(_numberArray, 5))
+ if (readArray(5))
clearBit(par5);
else
setBit(par5);
@@ -431,7 +431,7 @@ void Insane::iactScene4(byte *renderBitmap, int32 codecparam, int32 setupsan12,
_iactSceneId = par4;
break;
case 7:
- if (readArray(_numberArray, 4) != 0)
+ if (readArray(4) != 0)
return;
_val120_ = true;
@@ -439,16 +439,16 @@ void Insane::iactScene4(byte *renderBitmap, int32 codecparam, int32 setupsan12,
_smush_icons2Nut, 8, 0, 0);
break;
case 8:
- if (readArray(_numberArray, 4) == 0 || readArray(_numberArray, 6) == 0)
+ if (readArray(4) == 0 || readArray(6) == 0)
return;
- setWordInString(_numberArray, 1, _val55d);
- setWordInString(_numberArray, 3, _val57d);
+ writeArray(1, _val55d);
+ writeArray(3, _val57d);
smush_setToFinish();
break;
case 25:
- if (readArray(_numberArray, 5) == 0)
+ if (readArray(5) == 0)
return;
_val212_ = true;
@@ -484,19 +484,19 @@ void Insane::iactScene6(byte *renderBitmap, int32 codecparam, int32 setupsan12,
switch (par3) {
case 1:
if (par4 == 1) {
- if (readArray(_numberArray, 6))
+ if (readArray(6))
setBit(par5);
else
clearBit(par5);
} else {
- if (readArray(_numberArray, 6))
+ if (readArray(6))
clearBit(par5);
else
setBit(par5);
}
break;
case 2:
- if (readArray(_numberArray, 5))
+ if (readArray(5))
clearBit(par5);
else
setBit(par5);
@@ -512,7 +512,7 @@ void Insane::iactScene6(byte *renderBitmap, int32 codecparam, int32 setupsan12,
_iactSceneId = par4;
break;
case 7:
- if (readArray(_numberArray, 4) != 0)
+ if (readArray(4) != 0)
return;
_val120_ = true;
@@ -520,16 +520,16 @@ void Insane::iactScene6(byte *renderBitmap, int32 codecparam, int32 setupsan12,
_smush_icons2Nut, 8, 0, 0);
break;
case 8:
- if (readArray(_numberArray, 4) == 0 || readArray(_numberArray, 6) == 0)
+ if (readArray(4) == 0 || readArray(6) == 0)
return;
- setWordInString(_numberArray, 1, _val55d);
- setWordInString(_numberArray, 3, _val53d);
+ writeArray(1, _val55d);
+ writeArray(3, _val53d);
smush_setToFinish();
break;
case 25:
- if (readArray(_numberArray, 5) == 0)
+ if (readArray(5) == 0)
return;
_val212_ = true;
diff --git a/scumm/insane/insane_scenes.cpp b/scumm/insane/insane_scenes.cpp
index bb9b0a552b..7a07884a6b 100644
--- a/scumm/insane/insane_scenes.cpp
+++ b/scumm/insane/insane_scenes.cpp
@@ -70,21 +70,21 @@ void Insane::runScene(int arraynum) {
_val10b = _val50d; // FIXME: seems to be unused
setTrsFile(_trsFilePtr); // FIXME: we don't need it
- debug(0, "INSANE Arg: %d", readArray(_numberArray, 0));
+ debug(0, "INSANE Arg: %d", readArray(0));
- switch (readArray(_numberArray, 0)) {
+ switch (readArray(0)) {
case 1:
initScene(1);
setupValues();
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 10));
+ smlayer_setActorCostume(0, 2, readArray(10));
smlayer_putActor(0, 2, _actor[0].x, _actor[0].y1+190, _smlayer_room2);
startVideo("minedriv.san", 1, 32, 12, 0);
break;
case 2:
setupValues();
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 11));
+ smlayer_setActorCostume(0, 2, readArray(11));
smlayer_putActor(0, 2, _actor[0].x, _actor[0].y1+190, _smlayer_room2);
- _val8d = readArray(_numberArray, 2);
+ _val8d = readArray(2);
if (_val55d) {
initScene(5);
startVideo("tovista2.san", 1, 32, 12, 0);
@@ -98,9 +98,9 @@ void Insane::runScene(int arraynum) {
break;
case 3:
setupValues();
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 11));
+ smlayer_setActorCostume(0, 2, readArray(11));
smlayer_putActor(0, 2, _actor[0].x, _actor[0].y1+190, _smlayer_room2);
- _val8d = readArray(_numberArray, 2);
+ _val8d = readArray(2);
if (_val55d) {
initScene(6);
startVideo("toranch.san", 1, 32, 12, 0, _smush_toranchFlu, 300);
@@ -119,7 +119,7 @@ void Insane::runScene(int arraynum) {
startVideo("minefite.san", 1, 32, 12, 0);
break;
case 5:
- setWordInString(_numberArray, 1, _val54d);
+ writeArray(1, _val54d);
initScene(24);
startVideo("rottopen.san", 1, 32, 12, 0);
break;
@@ -127,7 +127,7 @@ void Insane::runScene(int arraynum) {
initScene(1);
setupValues();
smlayer_setFluPalette(_smush_roadrashRip, 1);
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 10));
+ smlayer_setActorCostume(0, 2, readArray(10));
smlayer_putActor(0, 2, _actor[0].x, _actor[0].y1+190, _smlayer_room2);
startVideo("minedriv.san", 1, 32, 12, 0, _smush_minedrivFlu, 420);
break;
@@ -137,10 +137,10 @@ void Insane::runScene(int arraynum) {
break;
case 10:
initScene(26);
- setWordInString(_numberArray, 1, _val54d);
+ writeArray(1, _val54d);
startVideo("credits.san", 1, 32, 12, 0);
default:
- warning("Unknown FT_INSANE mode %d", readArray(_numberArray, 0));
+ warning("Unknown FT_INSANE mode %d", readArray(0));
break;
}
@@ -153,24 +153,24 @@ void Insane::runScene(int arraynum) {
_insaneIsRunning = false;
- setWordInString(_numberArray, 50, _actor[0].inventory[INV_CHAIN]);
- setWordInString(_numberArray, 51, _actor[0].inventory[INV_CHAINSAW]);
- setWordInString(_numberArray, 52, _actor[0].inventory[INV_MACE]);
- setWordInString(_numberArray, 53, _actor[0].inventory[INV_2X4]);
- setWordInString(_numberArray, 54, _actor[0].inventory[INV_WRENCH]);
- setWordInString(_numberArray, 55, _actor[0].inventory[INV_DUST]);
- setWordInString(_numberArray, 337, _enemy[EN_TORQUE].field_8);
- setWordInString(_numberArray, 329, _enemy[EN_ROTT1].field_8);
- setWordInString(_numberArray, 330, _enemy[EN_ROTT2].field_8);
- setWordInString(_numberArray, 331, _enemy[EN_ROTT3].field_8);
- setWordInString(_numberArray, 332, _enemy[EN_VULTF1].field_8);
- setWordInString(_numberArray, 333, _enemy[EN_VULTM1].field_8);
- setWordInString(_numberArray, 334, _enemy[EN_VULTF2].field_8);
- setWordInString(_numberArray, 335, _enemy[EN_VULTM2].field_8);
- setWordInString(_numberArray, 336, _enemy[EN_CAVEFISH].field_8);
- setWordInString(_numberArray, 339, _enemy[EN_VULTF2].field_10);
- setWordInString(_numberArray, 56, _enemy[EN_CAVEFISH].field_10);
- setWordInString(_numberArray, 340, _enemy[EN_VULTM2].field_10);
+ writeArray(50, _actor[0].inventory[INV_CHAIN]);
+ writeArray(51, _actor[0].inventory[INV_CHAINSAW]);
+ writeArray(52, _actor[0].inventory[INV_MACE]);
+ writeArray(53, _actor[0].inventory[INV_2X4]);
+ writeArray(54, _actor[0].inventory[INV_WRENCH]);
+ writeArray(55, _actor[0].inventory[INV_DUST]);
+ writeArray(337, _enemy[EN_TORQUE].field_8);
+ writeArray(329, _enemy[EN_ROTT1].field_8);
+ writeArray(330, _enemy[EN_ROTT2].field_8);
+ writeArray(331, _enemy[EN_ROTT3].field_8);
+ writeArray(332, _enemy[EN_VULTF1].field_8);
+ writeArray(333, _enemy[EN_VULTM1].field_8);
+ writeArray(334, _enemy[EN_VULTF2].field_8);
+ writeArray(335, _enemy[EN_VULTM2].field_8);
+ writeArray(336, _enemy[EN_CAVEFISH].field_8);
+ writeArray(339, _enemy[EN_VULTF2].field_10);
+ writeArray(56, _enemy[EN_CAVEFISH].field_10);
+ writeArray(340, _enemy[EN_VULTM2].field_10);
// insane_unlock(); // FIXME
_vm->_sound->stopAllSounds(); // IMUSE_StopAllSounds();
if (_memoryAllocatedNotOK) {
@@ -623,7 +623,7 @@ void Insane::setSceneCostumes(int sceneId) {
switch (sceneId) {
case 1:
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 10));
+ smlayer_setActorCostume(0, 2, readArray(10));
smlayer_putActor(0, 2, _actor[0].x, _actor[0].y1+190, _smlayer_room2);
smlayer_setFluPalette(_smush_roadrashRip, 0);
setupValues();
@@ -635,7 +635,7 @@ void Insane::setSceneCostumes(int sceneId) {
return;
break;
case 2:
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 10));
+ smlayer_setActorCostume(0, 2, readArray(10));
setupValues();
return;
break;
@@ -654,14 +654,14 @@ void Insane::setSceneCostumes(int sceneId) {
case 4:
case 5:
case 6:
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 11));
+ smlayer_setActorCostume(0, 2, readArray(11));
smlayer_putActor(0, 2, _actor[0].x, _actor[0].y1+190, _smlayer_room2);
setupValues();
return;
break;
case 7:
case 8:
- setWordInString(_numberArray, 4, 0);
+ writeArray(4, 0);
return;
}
}
@@ -671,9 +671,9 @@ void Insane::setEnemyCostumes(void) {
debug(0, "setEnemyCostumes(%d)", _currEnemy);
- smlayer_setActorCostume(0, 2, readArray(_numberArray, 12));
- smlayer_setActorCostume(0, 0, readArray(_numberArray, 14));
- smlayer_setActorCostume(0, 1, readArray(_numberArray, 13));
+ smlayer_setActorCostume(0, 2, readArray(12));
+ smlayer_setActorCostume(0, 0, readArray(14));
+ smlayer_setActorCostume(0, 1, readArray(13));
smlayer_setActorLayer(0, 1, 1);
smlayer_setActorLayer(0, 2, 5);
smlayer_setActorLayer(0, 0, 10);
@@ -682,7 +682,7 @@ void Insane::setEnemyCostumes(void) {
smlayer_putActor(0, 0, _actor[0].x, _actor[0].y1+200, _smlayer_room2);
if (_currEnemy == EN_CAVEFISH) {
- smlayer_setActorCostume(1, 2, readArray(_numberArray, _enemy[_currEnemy].costume4));
+ smlayer_setActorCostume(1, 2, readArray(_enemy[_currEnemy].costume4));
_actor[1].act[2].room = 1;
_actor[1].act[1].room = 0;
_actor[1].act[0].room = 0;
@@ -695,7 +695,7 @@ void Insane::setEnemyCostumes(void) {
smlayer_putActor(1, 2, _actor[1].x + _actor[1].act[2].tilt - 17,
_actor[1].y + _actor[1].y1 - 98, _smlayer_room2);
} else if (_currEnemy == EN_TORQUE) {
- smlayer_setActorCostume(1, 2, readArray(_numberArray, _enemy[_currEnemy].costume4));
+ smlayer_setActorCostume(1, 2, readArray(_enemy[_currEnemy].costume4));
_actor[1].act[2].room = 1;
_actor[1].act[1].room = 0;
_actor[1].act[0].room = 0;
@@ -711,13 +711,13 @@ void Insane::setEnemyCostumes(void) {
_actor[1].act[0].room = 1;
if (_enemy[_currEnemy].costume4)
- smlayer_setActorCostume(1, 2, readArray(_numberArray, _enemy[_currEnemy].costume4));
+ smlayer_setActorCostume(1, 2, readArray(_enemy[_currEnemy].costume4));
if (_enemy[_currEnemy].costume5)
- smlayer_setActorCostume(1, 0, readArray(_numberArray, _enemy[_currEnemy].costume5));
+ smlayer_setActorCostume(1, 0, readArray(_enemy[_currEnemy].costume5));
if (_enemy[_currEnemy].costume6)
- smlayer_setActorCostume(1, 1, readArray(_numberArray, _enemy[_currEnemy].costume6));
+ smlayer_setActorCostume(1, 1, readArray(_enemy[_currEnemy].costume6));
_actor[1].field_8 = 1;
_actor[1].act[2].state = 1;
@@ -1031,11 +1031,11 @@ void Insane::postCase17(byte *renderBitmap, int32 codecparam, int32 setupsan12,
if (_currSceneId == 18) {
queueSceneSwitch(17, _smush_minedrivFlu, "minedriv.san", 64, 0,
_continueFrame1, 1300);
- setWordInString(_numberArray, 9, 1);
+ writeArray(9, 1);
} else {
queueSceneSwitch(1, _smush_minedrivFlu, "minedriv.san", 64, 0,
_continueFrame1, 1300);
- setWordInString(_numberArray, 9, 0);
+ writeArray(9, 0);
}
}
_val119_ = false;
@@ -1145,24 +1145,24 @@ void Insane::postCase3(byte *renderBitmap, int32 codecparam, int32 setupsan12,
if (curFrame >= maxFrame) {
if (_currSceneId == 4) {
if (!_needSceneSwitch) {
- if (readArray(_numberArray, 6)) {
- if (readArray(_numberArray, 4))
+ if (readArray(6)) {
+ if (readArray(4))
queueSceneSwitch(14, 0, "hitdust2.san", 64, 0, 0, 0);
else
queueSceneSwitch(14, 0, "hitdust4.san", 64, 0, 0, 0);
} else {
- if (readArray(_numberArray, 4))
+ if (readArray(4))
queueSceneSwitch(14, 0, "hitdust1.san", 64, 0, 0, 0);
else
queueSceneSwitch(14, 0, "hitdust3.san", 64, 0, 0, 0);
}
}
} else {
- if (readArray(_numberArray, 4)) {
+ if (readArray(4)) {
if (!_needSceneSwitch)
queueSceneSwitch(15, 0, "vistthru.san", 64, 0, 0, 0);
} else {
- setWordInString(_numberArray, 1, _val53d);
+ writeArray(1, _val53d);
smush_setToFinish();
}
}
@@ -1187,12 +1187,12 @@ void Insane::postCase5(byte *renderBitmap, int32 codecparam, int32 setupsan12,
}
if (curFrame >= maxFrame) {
- if (readArray(_numberArray, 4)) {
+ if (readArray(4)) {
if (!_needSceneSwitch)
queueSceneSwitch(15, 0, "chasthru.san", 64, 0, 0, 0);
} else {
- if (readArray(_numberArray, 5)) {
- setWordInString(_numberArray, 1, _val57d);
+ if (readArray(5)) {
+ writeArray(1, _val57d);
smush_setToFinish();
} else {
queueSceneSwitch(15, 0, "chasout.san", 64, 0, 0, 0);
@@ -1263,11 +1263,11 @@ void Insane::postCase10(byte *renderBitmap, int32 codecparam, int32 setupsan12,
switch (_currSceneId) {
case 20:
- setWordInString(_numberArray, 8, 1);
+ writeArray(8, 1);
queueSceneSwitch(12, 0, "liftgog.san", 0, 0, 0, 0);
break;
case 22:
- setWordInString(_numberArray, 1, _val54d);
+ writeArray(1, _val54d);
smush_setToFinish();
break;
default:
@@ -1349,7 +1349,7 @@ void Insane::postCase12(byte *renderBitmap, int32 codecparam, int32 setupsan12,
break;
case EN_TORQUE:
turnBen(false);
- setWordInString(_numberArray, 1, _val51d);
+ writeArray(1, _val51d);
smush_setToFinish();
break;
case EN_ROTT1:
@@ -1397,7 +1397,7 @@ void Insane::postCase23(byte *renderBitmap, int32 codecparam, int32 setupsan12,
if (_currSceneId == 24)
queueSceneSwitch(21, 0, "rottfite.san", 64, 0, 0, 0);
- if (readArray(_numberArray, 6) && readArray(_numberArray, 4))
+ if (readArray(6) && readArray(4))
queueSceneSwitch(16, 0, "limocrsh.san", 64, 0, 0, 0);
queueSceneSwitch(5, 0, "tovista2.san", 64, 0, 0, 290);
@@ -1410,10 +1410,10 @@ void Insane::postCase14(byte *renderBitmap, int32 codecparam, int32 setupsan12,
int32 setupsan13, int32 curFrame, int32 maxFrame) {
if (curFrame >= maxFrame) {
if (_currSceneId == 16) {
- setWordInString(_numberArray, 4, 0);
- setWordInString(_numberArray, 5, 1);
- setWordInString(_numberArray, 1, _val56d);
- setWordInString(_numberArray, 3, _val55d);
+ writeArray(4, 0);
+ writeArray(5, 1);
+ writeArray(1, _val56d);
+ writeArray(3, _val55d);
smush_setToFinish();
} else {
switch (_tempSceneId) {
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index e544be6683..6baf5d1c6f 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -2565,8 +2565,8 @@ void ScummEngine_v6::o6_kernelSetFunctions() {
// PC demo uses different INSANE
if (!(_features & GF_DEMO)) {
- _insane->setSmushParams(speed);
- _insane->runScene(insaneVarNum);
+ _insane->setSmushParams(speed);
+ _insane->runScene(insaneVarNum);
}
}
delete sp;