diff options
author | Eugene Sandulenko | 2004-01-30 02:14:29 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-01-30 02:14:29 +0000 |
commit | 6dec294de5cc77cbdd7f341d3b6db6735a2669c0 (patch) | |
tree | 68edaa520daaa93ea30f8bb6cb22e51dec367f40 | |
parent | 81ff879a9daf101a51be72c838ca6885f93746d9 (diff) | |
download | scummvm-rg350-6dec294de5cc77cbdd7f341d3b6db6735a2669c0.tar.gz scummvm-rg350-6dec294de5cc77cbdd7f341d3b6db6735a2669c0.tar.bz2 scummvm-rg350-6dec294de5cc77cbdd7f341d3b6db6735a2669c0.zip |
o Renamed more variables/structures to reflect their functionality
o Fixed bug with only caveman approaching
o Extended smush player to process FT-specific overlays in videos.
They're used to draw broken truck & car approaching and opponents on the
mineroad
svn-id: r12670
-rw-r--r-- | scumm/insane/insane.cpp | 77 | ||||
-rw-r--r-- | scumm/insane/insane.h | 29 | ||||
-rw-r--r-- | scumm/insane/insane_ben.cpp | 166 | ||||
-rw-r--r-- | scumm/insane/insane_enemy.cpp | 178 | ||||
-rw-r--r-- | scumm/insane/insane_iact.cpp | 45 | ||||
-rw-r--r-- | scumm/insane/insane_scenes.cpp | 66 | ||||
-rw-r--r-- | scumm/smush/codec1.cpp | 5 | ||||
-rw-r--r-- | scumm/smush/smush_player.cpp | 21 |
8 files changed, 298 insertions, 289 deletions
diff --git a/scumm/insane/insane.cpp b/scumm/insane/insane.cpp index 23b9ee7ae6..e69df9d2bd 100644 --- a/scumm/insane/insane.cpp +++ b/scumm/insane/insane.cpp @@ -148,24 +148,22 @@ void Insane::initvars(void) { _beenCheated = 0; _posBrokenTruck = 0; _posBrokenCar = 0; + _posFatherTorque = 0; + _posCave = 0; + _posVista = 0; _roadLeftBranch = false; _roadRightBranch = false; _carIsBroken = false; - _val11d = 0; + _benHasGoggles = false; + _mineCaveIsNear = false; + _objectDetected = false; _val32d = -1; - _val51d = 0; - _val52d = 0; - _val53d = 0; _val54d = 0; _val57d = 0; _val115_ = false; _val121_ = false; - _val122_ = false; - _val123_ = false; - _val124_ = false; _val211d = 0; _val213d = 0; - _val214d = -1; _val215d = 0; _smlayer_room = 0; _smlayer_room2 = 0; @@ -375,10 +373,10 @@ void Insane::initvars(void) { _actor[0].animWeaponClass = 0; _actor[0].field_34 = 2; _actor[0].field_38 = 0; - _actor[0].lost = 0; - _actor[0].kicking = 0; - _actor[0].field_44 = 0; - _actor[0].field_48 = 0; + _actor[0].lost = false; + _actor[0].kicking = false; + _actor[0].field_44 = false; + _actor[0].field_48 = false; _actor[0].defunct = 0; _actor[0].scenePropSubIdx = 0; _actor[0].field_54 = 0; @@ -414,10 +412,10 @@ void Insane::initvars(void) { _actor[1].animWeaponClass = 0; _actor[1].field_34 = 0; _actor[1].field_38 = 0; - _actor[1].lost = 0; - _actor[1].kicking = 0; - _actor[1].field_44 = 0; - _actor[1].field_48 = 0; + _actor[1].lost = false; + _actor[1].kicking = false; + _actor[1].field_44 = false; + _actor[1].field_48 = false; _actor[1].defunct = 0; _actor[1].scenePropSubIdx = 0; _actor[1].field_54 = 0; @@ -455,7 +453,7 @@ void Insane::init_actStruct(int actornum, int actnum, int32 actorval, byte state } void Insane::init_enemyStruct(int n, int32 handler, int32 initializer, - int32 field_8, int32 maxdamage, int32 field_10, + int16 occurences, int32 maxdamage, int32 field_10, int32 weapon, int32 sound, const char *filename, int32 costume4, int32 costume6, int32 costume5, int16 costumevar, int32 maxframe, int32 field_34) { @@ -463,7 +461,7 @@ void Insane::init_enemyStruct(int n, int32 handler, int32 initializer, _enemy[n].handler = handler; _enemy[n].initializer = initializer; - _enemy[n].field_8 = field_8; + _enemy[n].occurences = occurences; _enemy[n].maxdamage = maxdamage; _enemy[n].field_10 = field_10; _enemy[n].weapon = weapon; @@ -672,21 +670,21 @@ void Insane::readState(void) { _smlayer_room = readArray(320); _smlayer_room2 = readArray(321); _posBrokenTruck = readArray(322); - _val53d = readArray(323); + _posVista = readArray(323); _val57d = readArray(324); - _val52d = readArray(325); + _posCave = readArray(325); _posBrokenCar = 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); + _posFatherTorque = readArray(328); + _enemy[EN_TORQUE].occurences = readArray(337); + _enemy[EN_ROTT1].occurences = readArray(329); + _enemy[EN_ROTT2].occurences = readArray(330); + _enemy[EN_ROTT3].occurences = readArray(331); + _enemy[EN_VULTF1].occurences = readArray(332); + _enemy[EN_VULTM1].occurences = readArray(333); + _enemy[EN_VULTF2].occurences = readArray(334); + _enemy[EN_VULTM2].occurences = readArray(335); + _enemy[EN_CAVEFISH].occurences = readArray(336); _enemy[EN_VULTM2].field_10 = readArray(340); _enemy[EN_CAVEFISH].field_10 = readArray(56); _enemy[EN_VULTF2].field_10 = readArray(339); @@ -705,7 +703,7 @@ void Insane::setupValues(void) { _actor[0].act[1].room = 0; _actor[0].act[0].room = 0; _actor[0].cursorX = 0; - _actor[0].lost = 0; + _actor[0].lost = false; _currEnemy = -1; _val32d = -1; smush_warpMouse(160, 100, -1); @@ -715,8 +713,6 @@ void Insane::setupValues(void) { void Insane::mainLoop(void) { int32 resid; - _val11d++; - while (!idx2Compare()) { if(!(resid = idx2Tweak())) continue; @@ -1026,7 +1022,7 @@ void Insane::escapeKeyHandler(void) { return; queueSceneSwitch(15, 0, "vistthru.san", 64, 0, 0, 0); } else { - writeArray(1, _val53d); + writeArray(1, _posVista); smush_setToFinish(); } break; @@ -1325,30 +1321,31 @@ void Insane::procSKIP(Chunk &b) { if (!par2) { if (isBitSet(par1)) _player->_skipNext = true; - return; } - if (isBitSet(par1) != isBitSet(par2)) + if (isBitSet(par1) != isBitSet(par2)) { _player->_skipNext = true; + return; + } } bool Insane::isBitSet(int n) { - if (n >= 0x80) + if (n >= 0x80 * 8) return false; - return (_iactBits[n / 8] & (0x80 >> (n % 8))) != 0; + return ((_iactBits[n / 8] & (0x80 >> (n % 8))) != 0); } void Insane::setBit(int n) { - if (n >= 0x80) + if (n >= 0x80 * 8) return; _iactBits[n / 8] |= 0x80 >> (n % 8); } void Insane::clearBit(int n) { - if (n >= 0x80) + if (n >= 0x80 * 8) return; _iactBits[n / 8] &= ~(0x80 >> (n % 8)); diff --git a/scumm/insane/insane.h b/scumm/insane/insane.h index 4bf8197a30..f8f03e0e35 100644 --- a/scumm/insane/insane.h +++ b/scumm/insane/insane.h @@ -160,32 +160,29 @@ class Insane { int16 _mainRoadPos; int16 _posBrokenCar; int16 _posBrokenTruck; + int16 _posFatherTorque; + int16 _posCave; + int16 _posVista; bool _roadLeftBranch; bool _roadRightBranch; bool _carIsBroken; - int32 _val11d; + bool _benHasGoggles; + bool _mineCaveIsNear; + bool _objectDetected; int32 _val32d; - int32 _val51d; - int32 _val52d; - int32 _val53d; int32 _val54d; int32 _val57d; - int32 _val114d16[16]; bool _val115_; bool _val121_; - bool _val122_; - bool _val123_; - bool _val124_; int32 _val211d; int32 _val213d; - int32 _val214d; int32 _val215d; int32 _val216d[12]; struct enemy { int32 handler; int32 initializer; - int32 field_8; + int16 occurences; int32 maxdamage; int32 field_10; int32 weapon; @@ -246,14 +243,14 @@ class Insane { int32 y; int32 y1; int32 x1; - int32 weaponClass; - int32 animWeaponClass; - int32 field_34; - int32 field_38; + int16 weaponClass; + int16 animWeaponClass; + int16 field_34; + int16 field_38; bool lost; bool kicking; bool field_44; - int32 field_48; + bool field_48; bool defunct; int32 scenePropSubIdx; int32 field_54; @@ -343,7 +340,7 @@ class Insane { void init_actStruct(int actornum, int actnum, int32 actorval, byte state, int32 room, int32 animtilt, int32 tilt, int32 frame); void init_enemyStruct(int n, int32 handler, int32 initializer, - int32 field_8, int32 maxdamage, int32 field_10, + int16 occurences, int32 maxdamage, int32 field_10, int32 field_14, int32 sound, const char *filename, int32 costume4, int32 costume6, int32 costume5, int16 field_2C, int32 field_30, int32 field_34); diff --git a/scumm/insane/insane_ben.cpp b/scumm/insane/insane_ben.cpp index ee55c34ebe..2427556fab 100644 --- a/scumm/insane/insane_ben.cpp +++ b/scumm/insane/insane_ben.cpp @@ -61,10 +61,10 @@ void Insane::turnBen(bool controllable) { case 3: case 13: if (_actor[0].damage < _actor[0].maxdamage) { - _actor[0].lost = 0; + _actor[0].lost = false; } else { if (!_actor[0].lost && !_actor[1].lost) { - _actor[0].lost = 1; + _actor[0].lost = true; _actor[0].act[2].state = 36; _actor[0].act[1].state = 36; _actor[0].act[1].room = 0; @@ -95,11 +95,11 @@ void Insane::turnBen(bool controllable) { break; default: if (_actor[0].damage < _actor[0].maxdamage) { - _actor[0].lost = 0; + _actor[0].lost = false; } else { if (!_actor[0].lost && !_actor[1].lost) { queueSceneSwitch(10, 0, "wr2_ben.san", 64, 0, 0, 0); - _actor[0].lost = 1; + _actor[0].lost = true; _actor[0].act[2].state = 36; _actor[0].act[2].room = 0; _actor[0].act[0].state = 36; @@ -249,8 +249,8 @@ void Insane::mineChooseRoad(int32 buttons) { switch (_currSceneId) { case 17: if (buttons & 1) { - if (_val123_) { - writeArray(1, _val52d); + if (_mineCaveIsNear) { + writeArray(1, _posCave); smush_setToFinish(); } @@ -280,7 +280,7 @@ void Insane::mineChooseRoad(int32 buttons) { queueSceneSwitch(2, 0, "mineexit.san", 64, 0, 0, 0); } - if ((buttons & 2) == 0 || !_val122_) + if ((buttons & 2) == 0 || !_benHasGoggles) return; _actor[0].frame = 0; @@ -351,7 +351,7 @@ void Insane::mineChooseRoad(int32 buttons) { if (_roadRightBranch) { writeArray(1, _posBrokenTruck); - writeArray(3, _val53d); + writeArray(3, _posVista); smush_setToFinish(); } @@ -359,7 +359,7 @@ void Insane::mineChooseRoad(int32 buttons) { return; writeArray(1, _posBrokenCar); - writeArray(3, _val53d); + writeArray(3, _posVista); smush_setToFinish(); break; default: @@ -507,7 +507,7 @@ void Insane::actor02Reaction(int32 buttons) { case 106: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; smlayer_setActorFacing(0, 2, 29, 180); _actor[0].act[2].state = 107; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); @@ -515,7 +515,7 @@ void Insane::actor02Reaction(int32 buttons) { case 107: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 9) { _actor[0].act[2].state = 1; _actor[0].inventory[INV_MACE] = 0; @@ -527,7 +527,7 @@ void Insane::actor02Reaction(int32 buttons) { case 104: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; smlayer_setActorFacing(0, 2, 28, 180); _actor[0].act[2].state = 105; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); @@ -535,7 +535,7 @@ void Insane::actor02Reaction(int32 buttons) { case 105: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 5) { _actor[0].act[2].state = 1; _actor[0].inventory[INV_MACE] = 0; @@ -547,7 +547,7 @@ void Insane::actor02Reaction(int32 buttons) { case 108: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; smlayer_setActorFacing(0, 2, 28, 180); _actor[0].act[2].state = 109; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); @@ -555,7 +555,7 @@ void Insane::actor02Reaction(int32 buttons) { case 109: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 5) { _actor[0].act[2].state = 1; _actor[0].inventory[INV_CHAIN] = 0; // Chain @@ -567,8 +567,8 @@ void Insane::actor02Reaction(int32 buttons) { case 73: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; - _actor[0].field_44 = 1; + _actor[0].kicking = false; + _actor[0].field_44 = true; if (_actor[0].act[2].frame >= 2 && !_kickBenProgress) { smlayer_setActorFacing(0, 2, 19, 180); _actor[0].act[2].state = 74; @@ -578,8 +578,8 @@ void Insane::actor02Reaction(int32 buttons) { case 74: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; - _actor[0].field_44 = 0; + _actor[0].kicking = false; + _actor[0].field_44 = false; if (_actor[0].act[2].frame >= 2) { smlayer_setActorFacing(0, 2, 9, 180); _actor[0].act[2].state = 1; @@ -590,8 +590,8 @@ void Insane::actor02Reaction(int32 buttons) { case 79: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; - _actor[0].field_44 = 1; + _actor[0].kicking = false; + _actor[0].field_44 = true; if (_actor[0].act[2].frame >= 2) { smlayer_setActorFacing(0, 2, 23, 180); _actor[0].act[2].state = 80; @@ -601,8 +601,8 @@ void Insane::actor02Reaction(int32 buttons) { case 80: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; - _actor[0].field_44 = 0; + _actor[0].kicking = false; + _actor[0].field_44 = false; if (_actor[0].act[2].frame >= 6) { smlayer_setActorFacing(0, 2, 25, 180); _actor[0].act[2].state = 63; @@ -612,8 +612,8 @@ void Insane::actor02Reaction(int32 buttons) { case 81: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; - _actor[0].field_44 = 1; + _actor[0].kicking = false; + _actor[0].field_44 = true; if (_actor[0].act[2].frame >= 2 && !_kickBenProgress) { smlayer_setActorFacing(0, 2, 23, 180); _actor[0].act[2].state = 82; @@ -623,8 +623,8 @@ void Insane::actor02Reaction(int32 buttons) { case 82: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; - _actor[0].field_44 = 0; + _actor[0].kicking = false; + _actor[0].field_44 = false; if (_actor[0].act[2].frame >= 3) { smlayer_setActorFacing(0, 2, 26, 180); _actor[0].act[2].state = 64; @@ -634,8 +634,8 @@ void Insane::actor02Reaction(int32 buttons) { case 77: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; - _actor[0].field_44 = 1; + _actor[0].kicking = false; + _actor[0].field_44 = true; if (_actor[0].act[2].frame >= 2) { smlayer_setActorFacing(0, 2, 23, 180); _actor[0].act[2].state = 78; @@ -645,8 +645,8 @@ void Insane::actor02Reaction(int32 buttons) { case 78: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; - _actor[0].field_44 = 0; + _actor[0].kicking = false; + _actor[0].field_44 = false; if (_actor[0].act[2].frame >= 5) { smlayer_setActorFacing(0, 2, 25, 180); _actor[0].act[2].state = 65; @@ -656,8 +656,8 @@ void Insane::actor02Reaction(int32 buttons) { case 83: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 0; - _actor[0].kicking = 0; - _actor[0].field_44 = 1; + _actor[0].kicking = false; + _actor[0].field_44 = true; if (_actor[0].act[2].frame >= 2 && !_kickBenProgress) { smlayer_setActorFacing(0, 2, 23, 180); _actor[0].act[2].state = 84; @@ -667,8 +667,8 @@ void Insane::actor02Reaction(int32 buttons) { case 84: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 0; - _actor[0].kicking = 0; - _actor[0].field_44 = 0; + _actor[0].kicking = false; + _actor[0].field_44 = false; if (_actor[0].act[2].frame >= 5) { smlayer_setActorFacing(0, 2, 25, 180); _actor[0].act[2].state = 66; @@ -678,8 +678,8 @@ void Insane::actor02Reaction(int32 buttons) { case 75: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; - _actor[0].field_44 = 1; + _actor[0].kicking = false; + _actor[0].field_44 = true; if (_actor[0].act[2].frame >= 4 && !_kickBenProgress) { smlayer_setActorFacing(0, 2, 23, 180); _actor[0].act[2].state = 76; @@ -689,8 +689,8 @@ void Insane::actor02Reaction(int32 buttons) { case 76: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; - _actor[0].field_44 = 0; + _actor[0].kicking = false; + _actor[0].field_44 = false; if (_actor[0].act[2].frame >= 4) { smlayer_setActorFacing(0, 2, 25, 180); _actor[0].act[2].state = 62; @@ -700,7 +700,7 @@ void Insane::actor02Reaction(int32 buttons) { case 2: smlayer_setActorLayer(0, 2, 4); smlayer_setActorFacing(0, 2, 17, 180); - _actor[0].kicking = 1; + _actor[0].kicking = true; _actor[0].weaponClass = 1; _actor[0].act[2].state = 3; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); @@ -728,13 +728,13 @@ void Insane::actor02Reaction(int32 buttons) { _actor[0].act[2].state = 4; } - _actor[0].kicking = 1; + _actor[0].kicking = true; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); break; case 4: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 2) { smlayer_setActorFacing(0, 2, 9, 180); _actor[0].act[2].state = 1; @@ -749,7 +749,7 @@ void Insane::actor02Reaction(int32 buttons) { case 10: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; smlayer_setActorFacing(0, 2, 19, 180); _actor[0].act[2].state = 11; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); @@ -758,7 +758,7 @@ void Insane::actor02Reaction(int32 buttons) { case 11: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; if (_actor[0].act[2].frame >= 2) { if (_currEnemy == EN_VULTM2) { if ((_actor[1].x - _actor[0].x <= weaponMaxRange(0)) && @@ -774,7 +774,7 @@ void Insane::actor02Reaction(int32 buttons) { smlayer_setActorFacing(1, 2, 6, 180); smlayer_startSfx(101); _actor[1].act[2].state = 97; - _actor[1].lost = 1; + _actor[1].lost = true; _actor[1].act[2].room = 1; _actor[1].act[1].room = 0; _actor[1].act[0].room = 0; @@ -792,7 +792,7 @@ void Insane::actor02Reaction(int32 buttons) { case 97: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; if (_actor[0].act[2].frame >= 5) { _actor[0].act[2].room = 1; _actor[0].act[1].room = 1; @@ -806,7 +806,7 @@ void Insane::actor02Reaction(int32 buttons) { case 12: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; if (_actor[0].act[2].frame >= 1) { if (_currEnemy != EN_CAVEFISH) { switch (_actor[1].weapon) { @@ -843,7 +843,7 @@ void Insane::actor02Reaction(int32 buttons) { case 13: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 3) { smlayer_setActorFacing(0, 2, 25, 180); _actor[0].act[2].state = 63; @@ -854,7 +854,7 @@ void Insane::actor02Reaction(int32 buttons) { smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 2; _actor[0].field_34 = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; smlayer_setActorCostume(0, 2, readArray(22)); smlayer_setActorFacing(0, 2, 19, 180); _actor[0].act[2].state = 7; @@ -865,7 +865,7 @@ void Insane::actor02Reaction(int32 buttons) { smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 2; _actor[0].field_34 = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 1) { smlayer_setActorFacing(0, 2, 20, 180); _actor[0].act[2].state = 8; @@ -876,7 +876,7 @@ void Insane::actor02Reaction(int32 buttons) { smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 2; _actor[0].field_34 = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if ((_actor[0].act[2].frame == 3) && (calcEnemyDamage(0, 0) == 1)) { _actor[1].damage = weaponDamage(0); smlayer_startSfx(64); @@ -892,7 +892,7 @@ void Insane::actor02Reaction(int32 buttons) { smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 2; _actor[0].field_34 = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 3) { smlayer_setActorCostume(0, 2, readArray(12)); _actor[0].field_34 = 2; @@ -903,7 +903,7 @@ void Insane::actor02Reaction(int32 buttons) { case 14: smlayer_setActorLayer(0, 2, 8); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; smlayer_setActorFacing(0, 2, 19, 180); _actor[0].act[2].state = 15; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); @@ -912,7 +912,7 @@ void Insane::actor02Reaction(int32 buttons) { case 15: smlayer_setActorLayer(0, 2, 8); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; if (_actor[0].act[2].frame >= 2) { switch (_actor[1].weapon) { case INV_CHAIN: @@ -943,7 +943,7 @@ void Insane::actor02Reaction(int32 buttons) { case 16: smlayer_setActorLayer(0, 2, 8); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; if (_actor[0].act[2].frame >= 1) { switch (_actor[1].weapon) { case INV_CHAIN: @@ -977,7 +977,7 @@ void Insane::actor02Reaction(int32 buttons) { case 17: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 2) { smlayer_setActorFacing(0, 2, 26, 180); _actor[0].act[2].state = 64; @@ -988,7 +988,7 @@ void Insane::actor02Reaction(int32 buttons) { case 18: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; smlayer_setActorFacing(0, 2, 19, 180); _actor[0].act[2].state = 19; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); @@ -997,7 +997,7 @@ void Insane::actor02Reaction(int32 buttons) { case 19: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; if (_actor[0].act[2].frame >= 1) { switch (_actor[1].weapon) { case INV_CHAIN: @@ -1037,7 +1037,7 @@ void Insane::actor02Reaction(int32 buttons) { case 20: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; if (_actor[0].act[2].frame >= 1) { if (_currEnemy != EN_CAVEFISH) { switch (_actor[1].weapon) { @@ -1070,7 +1070,7 @@ void Insane::actor02Reaction(int32 buttons) { case 21: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 6) { smlayer_setActorFacing(0, 2, 25, 180); _actor[0].act[2].state = 65; @@ -1080,7 +1080,7 @@ void Insane::actor02Reaction(int32 buttons) { case 110: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; smlayer_setActorFacing(0, 2, 30, 180); _actor[0].act[2].state = 111; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); @@ -1088,7 +1088,7 @@ void Insane::actor02Reaction(int32 buttons) { case 111: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 7) { smlayer_setActorFacing(0, 2, 25, 180); _actor[0].act[2].state = 65; @@ -1099,7 +1099,7 @@ void Insane::actor02Reaction(int32 buttons) { case 22: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 0; - _actor[0].kicking = 1; + _actor[0].kicking = true; smlayer_setActorFacing(0, 2, 19, 180); _actor[0].act[2].state = 23; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); @@ -1108,7 +1108,7 @@ void Insane::actor02Reaction(int32 buttons) { case 23: smlayer_setActorLayer(0, 2, 6); _actor[0].weaponClass = 0; - _actor[0].kicking = 1; + _actor[0].kicking = true; if (_actor[0].act[2].frame >= 4) { switch (_actor[1].weapon) { case INV_CHAIN: @@ -1135,7 +1135,7 @@ void Insane::actor02Reaction(int32 buttons) { case 24: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 0; - _actor[0].kicking = 1; + _actor[0].kicking = true; if (_actor[0].act[2].frame >= 1) { switch (_actor[1].weapon) { case INV_CHAIN: @@ -1147,7 +1147,7 @@ void Insane::actor02Reaction(int32 buttons) { tmp = calcEnemyDamage(1, 1); if (tmp == 1) { if (_currEnemy == EN_CAVEFISH) { - _actor[1].lost = 1; + _actor[1].lost = true; _actor[1].act[2].state = 102; _actor[1].damage = _actor[1].maxdamage + 10; } @@ -1169,7 +1169,7 @@ void Insane::actor02Reaction(int32 buttons) { case 25: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 0; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 6) { smlayer_setActorFacing(0, 2, 25, 180); _actor[0].act[2].state = 66; @@ -1180,7 +1180,7 @@ void Insane::actor02Reaction(int32 buttons) { case 26: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; smlayer_setActorFacing(0, 2, 19, 180); _actor[0].act[2].state = 27; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); @@ -1189,7 +1189,7 @@ void Insane::actor02Reaction(int32 buttons) { case 27: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; if (_actor[0].act[2].frame >= 1) { switch (_actor[1].weapon) { case INV_HAND: @@ -1218,7 +1218,7 @@ void Insane::actor02Reaction(int32 buttons) { case 28: smlayer_setActorLayer(0, 2, 4); _actor[0].weaponClass = 1; - _actor[0].kicking = 1; + _actor[0].kicking = true; if (_actor[0].act[2].frame >= 3) { if (_currEnemy != EN_CAVEFISH) { switch (_actor[1].weapon) { @@ -1255,7 +1255,7 @@ void Insane::actor02Reaction(int32 buttons) { case 29: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 6) { smlayer_setActorFacing(0, 2, 25, 180); _actor[0].act[2].state = 62; @@ -1309,7 +1309,7 @@ void Insane::actor02Reaction(int32 buttons) { case 33: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 5) { smlayer_setActorCostume(0, 2, readArray(12)); _actor[0].act[2].state = 1; @@ -1318,7 +1318,7 @@ void Insane::actor02Reaction(int32 buttons) { break; case 36: smlayer_setActorLayer(0, 2, 5); - _actor[0].kicking = 0; + _actor[0].kicking = false; smlayer_setActorCostume(0, 2, readArray(18)); smlayer_setActorFacing(0, 2, 6, 180); smlayer_startSfx(96); @@ -1351,7 +1351,7 @@ void Insane::actor02Reaction(int32 buttons) { case 37: smlayer_setActorLayer(0, 2, 25); _actor[0].cursorX = 0; - _actor[0].kicking = 0; + _actor[0].kicking = false; if (_actor[0].act[2].frame >= 18 || (_actor[0].x < 50 && _actor[0].act[2].frame >= 10) || (_actor[0].x > 270 && _actor[0].act[2].frame >= 10)) { @@ -1412,7 +1412,7 @@ void Insane::actor02Reaction(int32 buttons) { break; case 34: smlayer_setActorLayer(0, 2, 5); - _actor[0].kicking = 0; + _actor[0].kicking = false; if (!smlayer_actorNeedRedraw(0, 2)) { setBenState(); @@ -1424,7 +1424,7 @@ void Insane::actor02Reaction(int32 buttons) { break; case 35: smlayer_setActorLayer(0, 2, 5); - _actor[0].kicking = 0; + _actor[0].kicking = false; if (!smlayer_actorNeedRedraw(0, 2)) { switchBenWeapon(); @@ -1439,7 +1439,7 @@ void Insane::actor02Reaction(int32 buttons) { _actor[0].act[2].animTilt = 0; } _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); break; case 64: @@ -1449,7 +1449,7 @@ void Insane::actor02Reaction(int32 buttons) { _actor[0].act[2].animTilt = 0; } _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); break; case 65: @@ -1459,7 +1459,7 @@ void Insane::actor02Reaction(int32 buttons) { _actor[0].act[2].animTilt = 0; } _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); break; case 66: @@ -1469,7 +1469,7 @@ void Insane::actor02Reaction(int32 buttons) { _actor[0].act[2].animTilt = 0; } _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); break; case 62: @@ -1479,13 +1479,13 @@ void Insane::actor02Reaction(int32 buttons) { _actor[0].act[2].animTilt = 0; } _actor[0].weaponClass = 1; - _actor[0].kicking = 0; + _actor[0].kicking = false; _actor[0].act[2].tilt = calcTilt(_actor[0].tilt); break; case 1: smlayer_setActorLayer(0, 2, 5); _actor[0].weaponClass = 2; - _actor[0].kicking = 0; + _actor[0].kicking = false; switch (_actor[0].tilt) { case -3: @@ -1830,7 +1830,7 @@ void Insane::chooseBenWeaponAnim(int buttons) { default: break; } - _actor[0].kicking = 1; + _actor[0].kicking = true; _kickBenProgress = true; } } else { diff --git a/scumm/insane/insane_enemy.cpp b/scumm/insane/insane_enemy.cpp index eeb2dd1903..510eec51f3 100644 --- a/scumm/insane/insane_enemy.cpp +++ b/scumm/insane/insane_enemy.cpp @@ -212,7 +212,7 @@ int32 Insane::enemy0handler(int32 actor1, int32 actor2, int32 probability) { case 6: if (!_enemyState[EN_ROTT1][7]) { _enemyState[EN_ROTT1][7] = 1; - if (_enemy[EN_ROTT1].field_8) + if (_enemy[EN_ROTT1].occurences) prepareScenePropScene(55, 0, 0); } break; @@ -1334,10 +1334,10 @@ void Insane::turnEnemy(bool battle) { int buttons; if (_actor[1].damage < _actor[1].maxdamage) { - _actor[1].lost = 0; + _actor[1].lost = false; } else { if (!_actor[1].lost && !_actor[1].lost) { - _actor[1].lost = 1; + _actor[1].lost = true; _actor[1].act[2].state = 36; _actor[1].act[1].state = 36; _actor[1].act[0].state = 36; @@ -1636,7 +1636,7 @@ void Insane::actor12Reaction(int32 buttons) { case 106: smlayer_setActorLayer(1, 2, 5); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; smlayer_setActorFacing(1, 2, 29, 180); _actor[1].act[2].state = 107; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); @@ -1644,7 +1644,7 @@ void Insane::actor12Reaction(int32 buttons) { case 107: smlayer_setActorLayer(1, 2, 5); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 8) _actor[1].damage = _actor[1].maxdamage + 10; @@ -1653,7 +1653,7 @@ void Insane::actor12Reaction(int32 buttons) { case 108: smlayer_setActorLayer(1, 2, 5); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; smlayer_setActorFacing(1, 2, 28, 180); _actor[1].act[2].state = 109; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); @@ -1661,7 +1661,7 @@ void Insane::actor12Reaction(int32 buttons) { case 109: smlayer_setActorLayer(1, 2, 5); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 6) _actor[1].damage = _actor[1].maxdamage + 10; @@ -1670,8 +1670,8 @@ void Insane::actor12Reaction(int32 buttons) { case 73: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; - _actor[1].field_44 = 1; + _actor[1].kicking = false; + _actor[1].field_44 = true; if (_actor[1].act[2].frame >= 2 && !_kickEnemyProgress) { smlayer_setActorFacing(1, 2, 19, 180); _actor[1].act[2].state = 74; @@ -1682,8 +1682,8 @@ void Insane::actor12Reaction(int32 buttons) { case 74: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; - _actor[1].field_44 = 0; + _actor[1].kicking = false; + _actor[1].field_44 = false; if (_actor[1].act[2].frame >= 2) { smlayer_setActorFacing(1, 2, 9, 180); _actor[1].act[2].state = 1; @@ -1694,8 +1694,8 @@ void Insane::actor12Reaction(int32 buttons) { case 79: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; - _actor[1].field_44 = 1; + _actor[1].kicking = false; + _actor[1].field_44 = true; if (_actor[1].act[2].frame >= 1 && !_kickEnemyProgress) { smlayer_setActorFacing(1, 2, 23, 180); _actor[1].act[2].state = 80; @@ -1705,8 +1705,8 @@ void Insane::actor12Reaction(int32 buttons) { case 80: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; - _actor[1].field_44 = 0; + _actor[1].kicking = false; + _actor[1].field_44 = false; if (_actor[1].act[2].frame >= 6) { smlayer_setActorFacing(1, 2, 25, 180); _actor[1].act[2].state = 63; @@ -1716,8 +1716,8 @@ void Insane::actor12Reaction(int32 buttons) { case 81: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; - _actor[1].field_44 = 1; + _actor[1].kicking = false; + _actor[1].field_44 = true; if (_actor[1].act[2].frame >= 2 && !_kickEnemyProgress) { smlayer_setActorFacing(1, 2, 23, 180); _actor[1].act[2].state = 82; @@ -1727,8 +1727,8 @@ void Insane::actor12Reaction(int32 buttons) { case 82: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; - _actor[1].field_44 = 0; + _actor[1].kicking = false; + _actor[1].field_44 = false; if (_actor[1].act[2].frame >= 3) { smlayer_setActorFacing(1, 2, 26, 180); _actor[1].act[2].state = 64; @@ -1738,8 +1738,8 @@ void Insane::actor12Reaction(int32 buttons) { case 77: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; - _actor[1].field_44 = 1; + _actor[1].kicking = false; + _actor[1].field_44 = true; if (_actor[1].act[2].frame >= 1 && !_kickEnemyProgress) { smlayer_setActorFacing(1, 2, 23, 180); _actor[1].act[2].state = 78; @@ -1749,8 +1749,8 @@ void Insane::actor12Reaction(int32 buttons) { case 78: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; - _actor[1].field_44 = 0; + _actor[1].kicking = false; + _actor[1].field_44 = false; if (_actor[1].act[2].frame >= 5) { smlayer_setActorFacing(1, 2, 25, 180); _actor[1].act[2].state = 65; @@ -1760,8 +1760,8 @@ void Insane::actor12Reaction(int32 buttons) { case 83: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 0; - _actor[1].kicking = 0; - _actor[1].field_44 = 1; + _actor[1].kicking = false; + _actor[1].field_44 = true; if (_actor[1].act[2].frame >= 2 && !_kickEnemyProgress) { smlayer_setActorFacing(1, 2, 23, 180); _actor[1].act[2].state = 84; @@ -1771,8 +1771,8 @@ void Insane::actor12Reaction(int32 buttons) { case 84: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 0; - _actor[1].kicking = 0; - _actor[1].field_44 = 0; + _actor[1].kicking = false; + _actor[1].field_44 = false; if (_actor[1].act[2].frame >= 5) { smlayer_setActorFacing(1, 2, 25, 180); _actor[1].act[2].state = 66; @@ -1782,8 +1782,8 @@ void Insane::actor12Reaction(int32 buttons) { case 75: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; - _actor[1].field_44 = 1; + _actor[1].kicking = false; + _actor[1].field_44 = true; if (_actor[1].act[2].frame >= 4 && !_kickEnemyProgress) { smlayer_setActorFacing(1, 2, 23, 180); _actor[1].act[2].state = 76; @@ -1793,8 +1793,8 @@ void Insane::actor12Reaction(int32 buttons) { case 76: smlayer_setActorLayer(1, 2, 6); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; - _actor[1].field_44 = 0; + _actor[1].kicking = false; + _actor[1].field_44 = false; if (_actor[1].act[2].frame >= 4) { smlayer_setActorFacing(1, 2, 25, 180); _actor[1].act[2].state = 62; @@ -1804,7 +1804,7 @@ void Insane::actor12Reaction(int32 buttons) { case 2: smlayer_setActorLayer(1, 2, 4); smlayer_setActorFacing(1, 2, 17, 180); - _actor[1].kicking = 1; + _actor[1].kicking = true; _actor[1].weaponClass = 1; _actor[1].act[2].state = 3; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); @@ -1822,19 +1822,19 @@ void Insane::actor12Reaction(int32 buttons) { smlayer_setActorFacing(1, 2, 20, 180); _actor[1].act[2].state = 4; } - _actor[1].kicking = 1; + _actor[1].kicking = true; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); break; case 4: smlayer_setActorLayer(1, 2, 5); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; if (_actor[1].act[2].frame >= 2) { smlayer_setActorFacing(1, 2, 9, 180); _actor[1].act[2].state = 1; _actor[1].act[2].animTilt = -1000; _actor[1].weaponClass = 2; - _actor[1].kicking = 0; + _actor[1].kicking = false; } _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); break; @@ -1844,7 +1844,7 @@ void Insane::actor12Reaction(int32 buttons) { case 10: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; smlayer_setActorFacing(1, 2, 19, 180); _actor[1].act[2].state = 11; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); @@ -1853,7 +1853,7 @@ void Insane::actor12Reaction(int32 buttons) { case 11: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; if (_actor[1].act[2].frame >= 2) { if (weaponEnemyIsEffective()) { smlayer_setActorFacing(1, 2, 22, 180); @@ -1868,7 +1868,7 @@ void Insane::actor12Reaction(int32 buttons) { case 12: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; if (_actor[1].act[2].frame >= 1) { switch (_actor[0].weapon) { case INV_CHAIN: @@ -1897,7 +1897,7 @@ void Insane::actor12Reaction(int32 buttons) { case 13: smlayer_setActorLayer(1, 2, 5); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 3) { smlayer_setActorFacing(1, 2, 25, 180); _actor[1].act[2].state = 63; @@ -1907,7 +1907,7 @@ void Insane::actor12Reaction(int32 buttons) { case 14: smlayer_setActorLayer(1, 2, 8); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; smlayer_setActorFacing(1, 2, 19, 180); _actor[1].act[2].state = 15; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); @@ -1916,7 +1916,7 @@ void Insane::actor12Reaction(int32 buttons) { case 15: smlayer_setActorLayer(1, 2, 8); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; if (_actor[1].act[2].frame >= 5) { switch (_actor[0].weapon) { case INV_CHAIN: @@ -1943,7 +1943,7 @@ void Insane::actor12Reaction(int32 buttons) { case 16: smlayer_setActorLayer(1, 2, 8); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; if (_actor[1].act[2].frame >= 3) { switch (_actor[0].weapon) { case INV_CHAIN: @@ -1969,7 +1969,7 @@ void Insane::actor12Reaction(int32 buttons) { case 17: smlayer_setActorLayer(1, 2, 5); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 1) { smlayer_setActorFacing(1, 2, 26, 180); _actor[1].act[2].state = 64; @@ -1980,7 +1980,7 @@ void Insane::actor12Reaction(int32 buttons) { case 18: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; smlayer_setActorFacing(1, 2, 19, 180); _actor[1].act[2].state = 19; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); @@ -2035,7 +2035,7 @@ void Insane::actor12Reaction(int32 buttons) { case 20: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; if (_actor[1].act[2].frame >= 1) { switch (_actor[1].weapon) { case INV_CHAINSAW: @@ -2060,7 +2060,7 @@ void Insane::actor12Reaction(int32 buttons) { case 21: smlayer_setActorLayer(1, 2, 5); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 5) { smlayer_setActorFacing(1, 2, 25, 180); _actor[1].act[2].state = 65; @@ -2070,7 +2070,7 @@ void Insane::actor12Reaction(int32 buttons) { case 110: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; smlayer_setActorFacing(1, 2, 30, 180); _actor[1].act[2].state = 111; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); @@ -2078,7 +2078,7 @@ void Insane::actor12Reaction(int32 buttons) { case 111: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 7) { smlayer_setActorFacing(1, 2, 25, 180); _actor[1].act[2].state = 65; @@ -2089,7 +2089,7 @@ void Insane::actor12Reaction(int32 buttons) { case 22: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 0; - _actor[1].kicking = 1; + _actor[1].kicking = true; smlayer_setActorFacing(1, 2, 19, 180); _actor[1].act[2].state = 23; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); @@ -2098,7 +2098,7 @@ void Insane::actor12Reaction(int32 buttons) { case 23: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 0; - _actor[1].kicking = 1; + _actor[1].kicking = true; if (weaponEnemyIsEffective()) { smlayer_setActorFacing(1, 2, 22, 180); _actor[1].act[2].state = 83; @@ -2114,7 +2114,7 @@ void Insane::actor12Reaction(int32 buttons) { case 24: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 0; - _actor[1].kicking = 1; + _actor[1].kicking = true; if (_actor[1].act[2].frame >= 1) { tmp = calcBenDamage(1, 1); @@ -2133,7 +2133,7 @@ void Insane::actor12Reaction(int32 buttons) { case 25: smlayer_setActorLayer(1, 2, 5); _actor[1].weaponClass = 0; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 3) { smlayer_setActorFacing(1, 2, 25, 180); _actor[1].act[2].state = 66; @@ -2144,7 +2144,7 @@ void Insane::actor12Reaction(int32 buttons) { case 26: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; smlayer_setActorFacing(1, 2, 19, 180); _actor[1].act[2].state = 27; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); @@ -2153,7 +2153,7 @@ void Insane::actor12Reaction(int32 buttons) { case 27: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; if (_actor[1].act[2].frame >= 1) { if (weaponEnemyIsEffective()) { smlayer_setActorFacing(1, 2, 22, 180); @@ -2169,7 +2169,7 @@ void Insane::actor12Reaction(int32 buttons) { case 28: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 1; + _actor[1].kicking = true; if (_actor[1].act[2].frame >= 3) { tmp = calcBenDamage(1, 1); if (tmp == 1) @@ -2185,18 +2185,18 @@ void Insane::actor12Reaction(int32 buttons) { case 29: smlayer_setActorLayer(1, 2, 5); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 6) { smlayer_setActorFacing(1, 2, 25, 180); _actor[1].act[2].state = 62; - _actor[1].kicking = 0; + _actor[1].kicking = false; } _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); break; case 93: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; smlayer_setActorFacing(1, 2, 18, 180); _actor[1].act[2].state = 94; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); @@ -2204,7 +2204,7 @@ void Insane::actor12Reaction(int32 buttons) { case 94: smlayer_setActorLayer(1, 2, 4); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 15) { smlayer_setActorCostume(1, 2, readArray(44)); smlayer_setActorFacing(1, 2, 6, 180); @@ -2216,7 +2216,7 @@ void Insane::actor12Reaction(int32 buttons) { break; case 95: smlayer_setActorLayer(1, 2, 4); - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 19) { queueSceneSwitch(1, _smush_minedrivFlu, "minedriv.san", 64, 0, _continueFrame1, 1300); @@ -2225,7 +2225,7 @@ void Insane::actor12Reaction(int32 buttons) { break; case 92: smlayer_setActorLayer(1, 2, 5); - _actor[1].kicking = 0; + _actor[1].kicking = false; break; case 97: smlayer_setActorLayer(1, 2, 25); @@ -2239,7 +2239,7 @@ void Insane::actor12Reaction(int32 buttons) { case 89: smlayer_setActorLayer(1, 2, 26); _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_val121_) smlayer_setActorFacing(1, 2, 13, 180); else @@ -2252,13 +2252,13 @@ void Insane::actor12Reaction(int32 buttons) { case 90: smlayer_setActorLayer(1, 2, 26); _actor[1].weaponClass = 2; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 5) if (_actor[1].x - _actor[0].x <= 125) _actor[0].damage += 90; if (_actor[1].act[2].frame >= 12) { - _actor[1].kicking = 0; + _actor[1].kicking = false; setEnemyState(); smlayer_setActorLayer(1, 2, 5); } @@ -2266,13 +2266,13 @@ void Insane::actor12Reaction(int32 buttons) { break; case 91: smlayer_setActorLayer(1, 2, 26); - _actor[1].kicking = 0; + _actor[1].kicking = false; break; case 36: - _actor[1].lost = 1; + _actor[1].lost = true; _actor[1].field_54 = 1; _actor[1].cursorX = 0; - _actor[1].kicking = 0; + _actor[1].kicking = false; smlayer_setActorCostume(1, 2, readArray(_enemy[_currEnemy].costumevar)); smlayer_setActorFacing(1, 2, 6, 180); smlayer_setActorLayer(1, 2, 25); @@ -2297,7 +2297,7 @@ void Insane::actor12Reaction(int32 buttons) { } case 37: _actor[1].cursorX = 0; - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame < _enemy[_currEnemy].maxframe) { if (_actor[1].x >= 50 && _actor[1].x <= 270) @@ -2315,15 +2315,15 @@ void Insane::actor12Reaction(int32 buttons) { } break; case 102: - _actor[1].lost = 1; + _actor[1].lost = true; _actor[1].cursorX = 0; - _actor[1].kicking = 0; + _actor[1].kicking = false; smlayer_setActorCostume(1, 2, readArray(40)); smlayer_setActorFacing(1, 2, 6, 180); smlayer_setActorLayer(1, 2, 25); _actor[1].act[2].state = 103; case 103: - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 18 || ((_actor[1].x < 50 || _actor[1].x > 270) && _actor[1].act[2].frame >= 9)) { @@ -2333,8 +2333,8 @@ void Insane::actor12Reaction(int32 buttons) { } break; case 113: - _actor[1].lost = 1; - _actor[1].kicking = 0; + _actor[1].lost = true; + _actor[1].kicking = false; smlayer_setActorCostume(1, 2, readArray(46)); smlayer_setActorFacing(1, 2, 6, 180); smlayer_setActorLayer(1, 2, 25); @@ -2347,7 +2347,7 @@ void Insane::actor12Reaction(int32 buttons) { break; case 114: smlayer_setActorLayer(1, 2, 25); - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 16) { if (_actor[1].x >= 50 && _actor[1].x <= 270) @@ -2361,8 +2361,8 @@ void Insane::actor12Reaction(int32 buttons) { } break; case 115: - _actor[1].lost = 1; - _actor[1].kicking = 0; + _actor[1].lost = true; + _actor[1].kicking = false; smlayer_setActorCostume(1, 2, readArray(47)); smlayer_setActorFacing(1, 2, 6, 180); smlayer_setActorLayer(1, 2, 25); @@ -2374,7 +2374,7 @@ void Insane::actor12Reaction(int32 buttons) { break; case 116: smlayer_setActorLayer(1, 2, 25); - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame >= 17) { if (_actor[1].x >= 50 && _actor[1].x <= 270) @@ -2389,7 +2389,7 @@ void Insane::actor12Reaction(int32 buttons) { break; case 38: smlayer_setActorLayer(1, 2, 25); - _actor[1].kicking = 0; + _actor[1].kicking = false; if (_actor[1].act[2].frame < _enemy[_currEnemy].maxframe + 20) break; @@ -2406,7 +2406,7 @@ void Insane::actor12Reaction(int32 buttons) { break; case 34: smlayer_setActorLayer(1, 2, 5); - _actor[1].kicking = 0; + _actor[1].kicking = false; if (!smlayer_actorNeedRedraw(1, 2)) { setEnemyState(); @@ -2418,7 +2418,7 @@ void Insane::actor12Reaction(int32 buttons) { break; case 35: smlayer_setActorLayer(1, 2, 5); - _actor[1].kicking = 0; + _actor[1].kicking = false; if (!smlayer_actorNeedRedraw(1, 2)) { switchEnemyWeapon(); @@ -2433,7 +2433,7 @@ void Insane::actor12Reaction(int32 buttons) { _actor[1].act[2].animTilt = 0; } _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); break; case 64: @@ -2443,7 +2443,7 @@ void Insane::actor12Reaction(int32 buttons) { _actor[1].act[2].animTilt = 0; } _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); break; case 65: @@ -2453,7 +2453,7 @@ void Insane::actor12Reaction(int32 buttons) { _actor[1].act[2].animTilt = 0; } _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); break; case 66: @@ -2463,7 +2463,7 @@ void Insane::actor12Reaction(int32 buttons) { _actor[1].act[2].animTilt = 0; } _actor[1].weaponClass = 1; - _actor[1].kicking = 0; + _actor[1].kicking = false; _actor[1].act[2].tilt = calcTilt(_actor[1].tilt); break; case 98: @@ -2476,7 +2476,7 @@ void Insane::actor12Reaction(int32 buttons) { smlayer_setActorFacing(1, 2, 7, 180); _actor[1].act[2].state = 100; } - _actor[1].kicking = 0; + _actor[1].kicking = false; break; case 99: smlayer_setActorLayer(1, 2, 5); @@ -2488,7 +2488,7 @@ void Insane::actor12Reaction(int32 buttons) { smlayer_setActorFacing(1, 2, 8, 180); _actor[1].act[2].state = 101; } - _actor[1].kicking = 0; + _actor[1].kicking = false; break; case 100: smlayer_setActorLayer(1, 2, 5); @@ -2496,7 +2496,7 @@ void Insane::actor12Reaction(int32 buttons) { smlayer_setActorFacing(1, 2, 9, 180); _actor[1].act[2].state = 99; } - _actor[1].kicking = 0; + _actor[1].kicking = false; break; case 101: smlayer_setActorLayer(1, 2, 5); @@ -2504,12 +2504,12 @@ void Insane::actor12Reaction(int32 buttons) { smlayer_setActorFacing(1, 2, 6, 180); _actor[1].act[2].state = 98; } - _actor[1].kicking = 0; + _actor[1].kicking = false; break; case 1: smlayer_setActorLayer(1, 2, 5); _actor[1].weaponClass = 2; - _actor[1].kicking = 0; + _actor[1].kicking = false; switch (_actor[1].tilt) { case -3: diff --git a/scumm/insane/insane_iact.cpp b/scumm/insane/insane_iact.cpp index a0ff7153e0..6a83e79f5c 100644 --- a/scumm/insane/insane_iact.cpp +++ b/scumm/insane/insane_iact.cpp @@ -89,6 +89,7 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12, proc62(); _val32d = _enemy[_currEnemy].field_34; } + if (_val32d == par4) clearBit(par5); else @@ -101,7 +102,7 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12, } break; case 4: - if (par3 == 1 || _val32d < 0 || _val32d > 4) + if (par3 == 1 && (_val32d < 0 || _val32d > 4)) setBit(b.getWord()); break; case 5: @@ -115,7 +116,7 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12, par9 = b.getWord(); // +16 bx tmp = b.getWord(); // +18 par11 = b.getWord(); // +20 cx - tmp = b.getWord(); // +12 + tmp = b.getWord(); // +22 par13 = b.getWord(); // +24 ax if (par13 > _actor[0].x || par11 < _actor[0].x) { @@ -195,7 +196,7 @@ void Insane::iactScene1(byte *renderBitmap, int32 codecparam, int32 setupsan12, if (readArray(8)) { smlayer_drawSomething(renderBitmap, codecparam, 270, 20, 3, _smush_iconsNut, 20, 0, 0); - _val122_ = true; + _benHasGoggles = true; } } @@ -203,11 +204,10 @@ void Insane::proc62(void) { if (readArray(58) != 0) _enemy[EN_TORQUE].field_10 = 1; - if (_enemy[EN_TORQUE].field_8 == 0) { + if (_enemy[EN_TORQUE].occurences == 0) { _currEnemy = EN_TORQUE; _val215d++; _val216d[_val215d] = EN_TORQUE; - _val214d = _currEnemy; return; } @@ -235,7 +235,7 @@ void Insane::proc62(void) { if (edi >= 14) goto loc5; - edx = rand() / 11; + edx = rand() % 11; esi = edx; @@ -320,14 +320,12 @@ void Insane::proc62(void) { goto loc6; loc12: - if (ebx != 0) - goto loc13; - - _val215d = ebp; - edi = ebp; - goto _loop1; + if (ebx == 0) { + _val215d = ebp; + edi = ebp; + goto _loop1; + } - loc13: edx = _val215d; edx++; _val216d[edx] = esi; @@ -344,7 +342,6 @@ void Insane::proc62(void) { goto _loop1; _currEnemy = esi; - _val214d = _currEnemy; } void Insane::proc63(void) { @@ -488,9 +485,19 @@ void Insane::iactScene6(byte *renderBitmap, int32 codecparam, int32 setupsan12, par4 = b.getWord(); switch (par1) { + case 7: + par5 = b.getWord(); + if (par4 != 3) + break; + + if (par5 >= _actor[0].x) + break; + + _actor[0].x = par5; + break; case 2: case 4: - par5 = b.getWord(); // si + par5 = b.getWord(); switch (par3) { case 1: if (par4 == 1) { @@ -534,7 +541,7 @@ void Insane::iactScene6(byte *renderBitmap, int32 codecparam, int32 setupsan12, return; writeArray(1, _posBrokenTruck); - writeArray(3, _val53d); + writeArray(3, _posVista); smush_setToFinish(); break; @@ -590,7 +597,7 @@ void Insane::iactScene17(byte *renderBitmap, int32 codecparam, int32 setupsan12, smlayer_showStatusMsg(-1, renderBitmap, codecparam, 24, 167, 1, 2, 0, "%s", handleTrsTag(5000)); } - _val124_ = true; + _objectDetected = true; break; case 11: smlayer_drawSomething(renderBitmap, codecparam, 28, 48, 1, @@ -602,8 +609,8 @@ void Insane::iactScene17(byte *renderBitmap, int32 codecparam, int32 setupsan12, smlayer_showStatusMsg(-1, renderBitmap, codecparam, 24, 167, 1, 2, 0, "%s", handleTrsTag(5001)); } - _val124_ = true; - _val123_ = true; + _objectDetected = true; + _mineCaveIsNear = true; break; } break; diff --git a/scumm/insane/insane_scenes.cpp b/scumm/insane/insane_scenes.cpp index aca375ce63..797783681c 100644 --- a/scumm/insane/insane_scenes.cpp +++ b/scumm/insane/insane_scenes.cpp @@ -145,15 +145,15 @@ void Insane::runScene(int arraynum) { 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(337, _enemy[EN_TORQUE].occurences); + writeArray(329, _enemy[EN_ROTT1].occurences); + writeArray(330, _enemy[EN_ROTT2].occurences); + writeArray(331, _enemy[EN_ROTT3].occurences); + writeArray(332, _enemy[EN_VULTF1].occurences); + writeArray(333, _enemy[EN_VULTM1].occurences); + writeArray(334, _enemy[EN_VULTF2].occurences); + writeArray(335, _enemy[EN_VULTM2].occurences); + writeArray(336, _enemy[EN_CAVEFISH].occurences); writeArray(339, _enemy[EN_VULTF2].field_10); writeArray(56, _enemy[EN_CAVEFISH].field_10); writeArray(340, _enemy[EN_VULTM2].field_10); @@ -600,7 +600,6 @@ int Insane::loadSceneData(int scene, int flag, int phase) { } if (phase == 1) { _sceneData1Loaded = 1; - _val11d = 0; } return retvalue; } @@ -736,7 +735,7 @@ void Insane::setEnemyCostumes(void) { _actor[1].tilt = 0; _actor[1].weapon = -1; _actor[1].weaponClass = 2; - _enemy[_currEnemy].field_8++; + _enemy[_currEnemy].occurences++; _actor[1].maxdamage = _enemy[_currEnemy].maxdamage; _actor[1].enemyHandler = _enemy[_currEnemy].handler; _actor[1].animWeaponClass = 0; @@ -764,20 +763,19 @@ void Insane::setEnemyCostumes(void) { _actor[0].scenePropSubIdx = 0; _actor[0].field_54 = 0; _actor[0].runningSound = 0; - _actor[0].lost = 0; - _actor[0].kicking = 0; - _actor[0].field_44 = 0; + _actor[0].lost = false; + _actor[0].kicking = false; + _actor[0].field_44 = false; _actor[1].inventory[_enemy[_currEnemy].weapon] = 1; - _actor[0].field_44 = 0; - _actor[0].field_48 = 0; + _actor[0].field_48 = false; _actor[1].defunct = 0; _actor[1].scenePropSubIdx = 0; _actor[1].field_54 = 0; _actor[1].runningSound = 0; - _actor[1].lost = 0; - _actor[1].kicking = 0; - _actor[1].field_44 = 0; - _actor[1].field_48 = 0; + _actor[1].lost = false; + _actor[1].kicking = false; + _actor[1].field_44 = false; + _actor[1].field_48 = false; if (_enemy[_currEnemy].initializer != -1) enemyInitializer(_enemy[_currEnemy].initializer, _actor[1].damage, _actor[0].damage, _actor[1].probability); @@ -791,7 +789,7 @@ void Insane::procPreRendering(void) { switchSceneIfNeeded(); if (_sceneData1Loaded) { - _val115_ = 1; + _val115_ = true; if (!_keyboardDisable) { smush_changeState(1); _smush_isPauseImuse = true; @@ -799,7 +797,7 @@ void Insane::procPreRendering(void) { _keyboardDisable = 1; } } else { - _val115_ = 0; + _val115_ = false; if (_keyboardDisable) { smush_changeState(0); _smush_isPauseImuse = false; @@ -1010,8 +1008,8 @@ void Insane::postCase0(byte *renderBitmap, int32 codecparam, int32 setupsan12, _val121_ = false; _roadLeftBranch = false; _roadRightBranch = false; - _val122_ = false; - _val123_ = false; + _benHasGoggles = false; + _mineCaveIsNear = false; _continueFrame1 = curFrame; } @@ -1055,7 +1053,7 @@ void Insane::postCase16(byte *renderBitmap, int32 codecparam, int32 setupsan12, // FIXME: it should be transparent, so now it is disabled //smlayer_drawSomething(renderBitmap, codecparam, 0, 0, 1, _smush_bensgoggNut, 0, 0, 0); - if (!_val124_) + if (!_objectDetected) smlayer_drawSomething(renderBitmap, codecparam, 24, 170, 1, _smush_iconsNut, 23, 0, 0); @@ -1067,10 +1065,10 @@ void Insane::postCase16(byte *renderBitmap, int32 codecparam, int32 setupsan12, smlayer_setFluPalette(_smush_goglpaltRip, 0); } _val121_ = false; - _val123_ = false; + _mineCaveIsNear = false; _roadLeftBranch = false; _roadRightBranch = false; - _val124_ = false; + _objectDetected = false; _counter1++; _continueFrame1 = curFrame; if (_counter1 >= 10) @@ -1153,7 +1151,7 @@ void Insane::postCase3(byte *renderBitmap, int32 codecparam, int32 setupsan12, if (!_needSceneSwitch) queueSceneSwitch(15, 0, "vistthru.san", 64, 0, 0, 0); } else { - writeArray(1, _val53d); + writeArray(1, _posVista); smush_setToFinish(); } } @@ -1307,7 +1305,7 @@ void Insane::postCase12(byte *renderBitmap, int32 codecparam, int32 setupsan12, case EN_ROTT2: turnBen(true); - if (_enemy[1].field_8 <= 1) + if (_enemy[EN_ROTT2].occurences <= 1) prepareScenePropScene(32, 0, 1); else prepareScenePropScene(33, 0, 1); @@ -1315,19 +1313,19 @@ void Insane::postCase12(byte *renderBitmap, int32 codecparam, int32 setupsan12, case EN_ROTT3: turnBen(true); - if (_enemy[1].field_8 <= 1) + if (_enemy[EN_ROTT3].occurences <= 1) prepareScenePropScene(25, 0, 1); break; case EN_VULTF1: turnBen(true); - if (_enemy[1].field_8 <= 1) + if (_enemy[EN_VULTF1].occurences <= 1) prepareScenePropScene(2, 0, 1); break; case EN_VULTF2: turnBen(true); - if (_enemy[1].field_8 <= 1) + if (_enemy[EN_VULTF2].occurences <= 1) prepareScenePropScene(9, 0, 1); else prepareScenePropScene(16, 0, 1); @@ -1340,7 +1338,7 @@ void Insane::postCase12(byte *renderBitmap, int32 codecparam, int32 setupsan12, break; case EN_TORQUE: turnBen(false); - writeArray(1, _val51d); + writeArray(1, _posFatherTorque); smush_setToFinish(); break; case EN_ROTT1: @@ -1353,7 +1351,7 @@ void Insane::postCase12(byte *renderBitmap, int32 codecparam, int32 setupsan12, } else { switch (_currEnemy) { case EN_VULTM2: - if (_enemy[EN_VULTM2].field_8 <= 1) + if (_enemy[EN_VULTM2].occurences <= 1) turnBen(false); else turnBen(true); diff --git a/scumm/smush/codec1.cpp b/scumm/smush/codec1.cpp index 8feadc338e..be26600759 100644 --- a/scumm/smush/codec1.cpp +++ b/scumm/smush/codec1.cpp @@ -24,14 +24,16 @@ namespace Scumm { -void smush_decode_codec1(byte *dst, byte *src, int height) { +void smush_decode_codec1(byte *dst, byte *src, int left, int top, int height, int width, int dstWidth) { byte val, code; int32 length; int h = height, size_line; + dst += top * dstWidth; for (h = 0; h < height; h++) { size_line = READ_LE_UINT16(src); src += 2; + dst += left; while (size_line > 0) { code = *src++; size_line--; @@ -52,6 +54,7 @@ void smush_decode_codec1(byte *dst, byte *src, int height) { } } } + dst += dstWidth - left - width; } } diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index 227f3b601c..0d57d5d666 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -661,7 +661,7 @@ void SmushPlayer::handleNewPalette(Chunk &b) { setPalette(_pal); } -void smush_decode_codec1(byte *dst, byte *src, int height); +void smush_decode_codec1(byte *dst, byte *src, int left, int top, int height, int width, int dstWidth); void SmushPlayer::handleFrameObject(Chunk &b) { checkBlock(b, TYPE_FOBJ, 14); @@ -671,12 +671,12 @@ void SmushPlayer::handleFrameObject(Chunk &b) { } int codec = b.getWord(); - b.getWord(); // left - b.getWord(); // top + int left = b.getWord(); // left + int top = b.getWord(); // top int width = b.getWord(); int height = b.getWord(); - if ((height != _vm->_screenHeight) || (width != _vm->_screenWidth)) + if ((height > _vm->_screenHeight) || (width > _vm->_screenWidth)) return; if (!_alreadyInit) { @@ -685,8 +685,8 @@ void SmushPlayer::handleFrameObject(Chunk &b) { _alreadyInit = true; } - _width = width; - _height = height; + _width = _vm->_screenWidth; + _height = _vm->_screenHeight; b.getWord(); b.getWord(); @@ -699,7 +699,7 @@ void SmushPlayer::handleFrameObject(Chunk &b) { switch (codec) { case 1: case 3: - smush_decode_codec1(_dst, chunk_buffer, _height); + smush_decode_codec1(_dst, chunk_buffer, left, top, height, width, _vm->_screenWidth); break; case 37: _codec37.decode(_dst, chunk_buffer); @@ -972,6 +972,13 @@ void SmushPlayer::seekSan(const char *file, const char *directory, int32 pos, in delete _base; _base = new FileChunk(file, directory); + // In this case we need to get palette and number of frames + if (pos > 8) { + Chunk *sub = _base->subBlock(); + checkBlock(*sub, TYPE_AHDR); + handleAnimHeader(*sub); + delete sub; + } if (pos >= 8) pos -= 8; } else { |