diff --git a/TR5Main/Game/Lara/lara.cpp b/TR5Main/Game/Lara/lara.cpp index 5f91f3d20..4b835c013 100644 --- a/TR5Main/Game/Lara/lara.cpp +++ b/TR5Main/Game/Lara/lara.cpp @@ -1240,21 +1240,21 @@ void AnimateLara(ITEM_INFO* item) int lateral = anim->Xvelocity; if (anim->Xacceleration) lateral += anim->Xacceleration * (item->frameNumber - anim->frameBase); - lateral >>= 16; + lateral /= 65536; if (item->gravityStatus) // If gravity ON (Do Up/Down movement) { if (g_Level.Rooms[item->roomNumber].flags & ENV_FLAG_SWAMP) { - item->speed -= item->speed >> 3; + item->speed -= item->speed * 8; if (abs(item->speed) < 8) { item->speed = 0; item->gravityStatus = false; } if (item->fallspeed > 128) - item->fallspeed >>= 1; - item->fallspeed -= item->fallspeed >> 2; + item->fallspeed /= 2; + item->fallspeed -= item->fallspeed / 4; if (item->fallspeed < 4) item->fallspeed = 4; item->pos.yPos += item->fallspeed; @@ -1262,8 +1262,8 @@ void AnimateLara(ITEM_INFO* item) else { int velocity = (anim->velocity + anim->acceleration * (item->frameNumber - anim->frameBase - 1)); - item->speed -= velocity >> 16; - item->speed += (velocity + anim->acceleration) >> 16; + item->speed -= (velocity / 65536); + item->speed += ((velocity + anim->acceleration) / 65536); item->fallspeed += (item->fallspeed >= 128 ? 1 : GRAVITY); item->pos.yPos += item->fallspeed; } @@ -1274,9 +1274,9 @@ void AnimateLara(ITEM_INFO* item) if (Lara.waterStatus == LW_WADE && g_Level.Rooms[item->roomNumber].flags & ENV_FLAG_SWAMP) { - velocity = (anim->velocity >> 1); + velocity = (anim->velocity / 2); if (anim->acceleration) - velocity += (anim->acceleration * (item->frameNumber - anim->frameBase)) >> 2; + velocity += ((anim->acceleration * (item->frameNumber - anim->frameBase)) / 4); } else { @@ -1285,7 +1285,7 @@ void AnimateLara(ITEM_INFO* item) velocity += anim->acceleration * (item->frameNumber - anim->frameBase); } - item->speed = velocity >> 16; + item->speed = velocity / 65536; } if (Lara.ropePtr != -1) diff --git a/TR5Main/Game/Lara/lara_basic.cpp b/TR5Main/Game/Lara/lara_basic.cpp index 5a2ad03b9..54cbb5475 100644 --- a/TR5Main/Game/Lara/lara_basic.cpp +++ b/TR5Main/Game/Lara/lara_basic.cpp @@ -1951,27 +1951,27 @@ void lara_as_wade(ITEM_INFO* item, COLL_INFO* coll)//1AF10, 1B044 (F) if (TrInput & IN_LEFT) { Lara.turnRate -= LARA_TURN_RATE; - if (Lara.turnRate < -(LARA_FAST_TURN >> 1)) - Lara.turnRate = -(LARA_FAST_TURN >> 1); + if (Lara.turnRate < -(LARA_FAST_TURN / 2)) + Lara.turnRate = -(LARA_FAST_TURN / 2); if (TestLaraLean(item, coll)) { item->pos.zRot -= LARA_LEAN_RATE; - if (item->pos.zRot < -(LARA_LEAN_MAX >> 1)) - item->pos.zRot = -(LARA_LEAN_MAX >> 1); + if (item->pos.zRot < -(LARA_LEAN_MAX / 2)) + item->pos.zRot = -(LARA_LEAN_MAX / 2); } } else if (TrInput & IN_RIGHT) { Lara.turnRate += LARA_TURN_RATE; - if (Lara.turnRate > (LARA_FAST_TURN >> 1)) - Lara.turnRate = (LARA_FAST_TURN >> 1); + if (Lara.turnRate > (LARA_FAST_TURN / 2)) + Lara.turnRate = (LARA_FAST_TURN / 2); if (TestLaraLean(item, coll)) { item->pos.zRot += LARA_LEAN_RATE; - if (item->pos.zRot > (LARA_LEAN_MAX >> 1)) - item->pos.zRot = (LARA_LEAN_MAX >> 1); + if (item->pos.zRot > (LARA_LEAN_MAX / 2)) + item->pos.zRot = (LARA_LEAN_MAX / 2); } } diff --git a/TR5Main/Game/Lara/lara_fire.cpp b/TR5Main/Game/Lara/lara_fire.cpp index 3c05bd7f2..14f59909c 100644 --- a/TR5Main/Game/Lara/lara_fire.cpp +++ b/TR5Main/Game/Lara/lara_fire.cpp @@ -794,9 +794,9 @@ FireWeaponType FireWeapon(int weaponType, ITEM_INFO* target, ITEM_INFO* src, sho { long dx, dy, dz; - dx = (vDest.x - vSrc.x) >> 5; - dy = (vDest.y - vSrc.y) >> 5; - dz = (vDest.z - vSrc.z) >> 5; + dx = (vDest.x - vSrc.x) / 32; + dy = (vDest.y - vSrc.y) / 32; + dz = (vDest.z - vSrc.z) / 32; FindClosestShieldPoint(vDest.x - dx, vDest.y - dy, vDest.z - dz, target); } else if (target->objectNumber == ID_ARMY_WINSTON || target->objectNumber == ID_LONDONBOSS) //Don't want blood on Winston - never get the stains out @@ -804,7 +804,7 @@ FireWeaponType FireWeapon(int weaponType, ITEM_INFO* target, ITEM_INFO* src, sho short ricochet_angle; target->hitStatus = true; //need to do this to maintain defence state target->hitPoints--; - ricochet_angle = (mGetAngle(LaraItem->pos.zPos, LaraItem->pos.xPos, target->pos.zPos, target->pos.xPos) >> 4) & 4095; + ricochet_angle = (mGetAngle(LaraItem->pos.zPos, LaraItem->pos.xPos, target->pos.zPos, target->pos.xPos) / 16) & 4095; TriggerRicochetSparks(&vDest, ricochet_angle, 16, 0); SoundEffect(SFX_LARA_RICOCHET, &target->pos, 0); // play RICOCHET Sample } @@ -817,7 +817,7 @@ FireWeaponType FireWeapon(int weaponType, ITEM_INFO* target, ITEM_INFO* src, sho if ((target->currentAnimState > 1 && target->currentAnimState < 5) && angle < 0x4000 && angle > -0x4000) { target->hitStatus = true; //need to do this to maintain defence state - ricochet_angle = (mGetAngle(LaraItem->pos.zPos, LaraItem->pos.xPos, target->pos.zPos, target->pos.xPos) >> 4) & 4095; + ricochet_angle = (mGetAngle(LaraItem->pos.zPos, LaraItem->pos.xPos, target->pos.zPos, target->pos.xPos) / 16) & 4095; TriggerRicochetSparks(&vDest, ricochet_angle, 16, 0); SoundEffect(SFX_LARA_RICOCHET, &target->pos, 0); // play RICOCHET Sample } @@ -1117,8 +1117,8 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in /* If last position of item was also below this floor height, we've hit a wall, else we've hit a floor */ if (y > (height + 32) && bs == 0 && - (((x >> WALL_SHIFT) != (item->pos.xPos >> WALL_SHIFT)) || - ((z >> WALL_SHIFT) != (item->pos.zPos >> WALL_SHIFT)))) + (((x / SECTOR(1)) != (item->pos.xPos / SECTOR(1))) || + ((z / SECTOR(1)) != (item->pos.zPos / SECTOR(1))))) { // Need to know which direction the wall is. @@ -1145,7 +1145,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in else // Z crossed boundary. item->pos.yRot = 0x8000 - item->pos.yRot; - item->speed >>= 1; + item->speed /= 2; /* Put item back in its last position */ item->pos.xPos = x; @@ -1156,7 +1156,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in { // Need to know which direction the slope is. - item->speed -= item->speed >> 2; + item->speed -= (item->speed / 4); if (TiltYOffset < 0 && ((abs(TiltYOffset)) - (abs(TiltXOffset)) >= 2)) // Hit angle = 0x4000 { @@ -1164,13 +1164,13 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in { item->pos.yRot = 0x4000 + (0xc000 - (unsigned short)item->pos.yRot - 1); if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); } else { if (item->speed < 32) { - item->speed -= TiltYOffset << 1; + item->speed -= TiltYOffset * 2; if ((unsigned short)item->pos.yRot > 0x4000 && (unsigned short)item->pos.yRot < 0xc000) { item->pos.yRot -= 4096; @@ -1186,7 +1186,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in } if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); else item->fallspeed = 0; } @@ -1197,13 +1197,13 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in { item->pos.yRot = 0xc000 + (0x4000 - (unsigned short)item->pos.yRot - 1); if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); } else { if (item->speed < 32) { - item->speed += TiltYOffset << 1; + item->speed += TiltYOffset * 2; if ((unsigned short)item->pos.yRot > 0xc000 || (unsigned short)item->pos.yRot < 0x4000) { item->pos.yRot -= 4096; @@ -1219,7 +1219,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in } if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); else item->fallspeed = 0; } @@ -1230,13 +1230,13 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in { item->pos.yRot = (0x8000 - item->pos.yRot - 1); if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); } else { if (item->speed < 32) { - item->speed -= TiltXOffset << 1; + item->speed -= TiltXOffset * 2; if ((unsigned short)item->pos.yRot < 0x8000) { @@ -1253,7 +1253,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in } if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); else item->fallspeed = 0; } @@ -1264,13 +1264,13 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in { item->pos.yRot = (0x8000 - item->pos.yRot - 1); if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); } else { if (item->speed < 32) { - item->speed += TiltXOffset << 1; + item->speed += TiltXOffset * 2; if ((unsigned short)item->pos.yRot > 0x8000) { @@ -1287,7 +1287,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in } if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); else item->fallspeed = 0; } @@ -1298,7 +1298,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in { item->pos.yRot = 0x2000 + (0xa000 - (unsigned short)item->pos.yRot - 1); if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); } else { @@ -1320,7 +1320,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in } if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); else item->fallspeed = 0; } @@ -1331,7 +1331,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in { item->pos.yRot = 0x6000 + (0xe000 - (unsigned short)item->pos.yRot - 1); if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); } else { @@ -1353,7 +1353,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in } if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); else item->fallspeed = 0; } @@ -1364,7 +1364,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in { item->pos.yRot = 0xa000 + (0x2000 - (unsigned short)item->pos.yRot - 1); if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); } else { @@ -1386,7 +1386,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in } if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); else item->fallspeed = 0; } @@ -1397,7 +1397,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in { item->pos.yRot = 0xe000 + (0x6000 - (unsigned short)item->pos.yRot - 1); if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); } else { @@ -1419,7 +1419,7 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in } if (item->fallspeed > 0) - item->fallspeed = -(item->fallspeed >> 1); + item->fallspeed = -(item->fallspeed / 2); else item->fallspeed = 0; } @@ -1438,10 +1438,10 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in if (item->fallspeed > 16) { if (item->objectNumber == ID_GRENADE) - item->fallspeed = -(item->fallspeed - (item->fallspeed >> 1)); + item->fallspeed = -(item->fallspeed - (item->fallspeed / 2)); else { - item->fallspeed = -(item->fallspeed >> 2); + item->fallspeed = -(item->fallspeed / 2); if (item->fallspeed < -100) item->fallspeed = -100; } @@ -1487,10 +1487,10 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in if (item->fallspeed > 16) { if (item->objectNumber == ID_GRENADE) - item->fallspeed = -(item->fallspeed - (item->fallspeed >> 1)); + item->fallspeed = -(item->fallspeed - (item->fallspeed / 2)); else { - item->fallspeed = -(item->fallspeed >> 2); + item->fallspeed = -(item->fallspeed / 4); if (item->fallspeed < -100) item->fallspeed = -100; } @@ -1524,8 +1524,8 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in if (item->pos.yPos < ceiling) { if (y < ceiling && - (((x >> WALL_SHIFT) != (item->pos.xPos >> WALL_SHIFT)) || - ((z >> WALL_SHIFT) != (item->pos.zPos >> WALL_SHIFT)))) + (((x / SECTOR(1)) != (item->pos.xPos / SECTOR(1))) || + ((z / SECTOR(1)) != (item->pos.zPos / SECTOR(1))))) { // Need to know which direction the wall is. @@ -1542,9 +1542,9 @@ void DoProperDetection(short itemNumber, int x, int y, int z, int xv, int yv, in } if (item->objectNumber == ID_GRENADE) - item->speed -= item->speed >> 3; + item->speed -= item->speed / 8; else - item->speed >>= 1; + item->speed /= 2; /* Put item back in its last position */ item->pos.xPos = x; diff --git a/TR5Main/Game/Lara/lara_flare.cpp b/TR5Main/Game/Lara/lara_flare.cpp index d71e341a1..befa8750e 100644 --- a/TR5Main/Game/Lara/lara_flare.cpp +++ b/TR5Main/Game/Lara/lara_flare.cpp @@ -359,7 +359,7 @@ void CreateFlare(short objectNum, int thrown) // (F) (D) } if (flag) - item->speed >>= 1; + item->speed /= 2; if (objectNum == ID_FLARE_ITEM) { diff --git a/TR5Main/Game/Lara/lara_objects.cpp b/TR5Main/Game/Lara/lara_objects.cpp index 17f7b672f..3b9590847 100644 --- a/TR5Main/Game/Lara/lara_objects.cpp +++ b/TR5Main/Game/Lara/lara_objects.cpp @@ -486,7 +486,7 @@ void lara_col_rope(ITEM_INFO* item, COLL_INFO* coll) // (F) (D) if (TrInput & IN_SPRINT) { - Lara.ropeDFrame = (g_Level.Anims[LA_ROPE_SWING].frameBase + 32) << 8; + Lara.ropeDFrame = (g_Level.Anims[LA_ROPE_SWING].frameBase + 32) * 256; Lara.ropeFrame = Lara.ropeDFrame; item->goalAnimState = LS_ROPE_SWING; @@ -538,7 +538,7 @@ void lara_col_ropefwd(ITEM_INFO* item, COLL_INFO* coll) // (F) (D) ApplyVelocityToRope(Lara.ropeSegment - 2, item->pos.yRot + (Lara.ropeDirection ? ANGLE(0.0f) : ANGLE(180.0f)), - vel >> 5); + vel / 32); } if (Lara.ropeFrame > Lara.ropeDFrame) @@ -554,7 +554,7 @@ void lara_col_ropefwd(ITEM_INFO* item, COLL_INFO* coll) // (F) (D) Lara.ropeFrame = Lara.ropeDFrame; } - item->frameNumber = Lara.ropeFrame >> 8; + item->frameNumber = Lara.ropeFrame / 256; if (!(TrInput & IN_SPRINT) && item->frameNumber == g_Level.Anims[LA_ROPE_SWING].frameBase + 32 && @@ -768,7 +768,7 @@ void lara_col_poledown(ITEM_INFO* item, COLL_INFO* coll)//171A0, 172D4 (F) else if (item->itemFlags[2] > ANGLE(90.0f)) item->itemFlags[2] = ANGLE(90.0f); - item->pos.yPos += item->itemFlags[2] >> 8; + item->pos.yPos += item->itemFlags[2] / 256; } void lara_as_poleleft(ITEM_INFO* item, COLL_INFO* coll)//17020(<), 17154(<) (F) diff --git a/TR5Main/Game/Lara/lara_one_gun.cpp b/TR5Main/Game/Lara/lara_one_gun.cpp index 5a306ba50..d664109fd 100644 --- a/TR5Main/Game/Lara/lara_one_gun.cpp +++ b/TR5Main/Game/Lara/lara_one_gun.cpp @@ -477,15 +477,15 @@ void ControlGrenade(short itemNumber) if (g_Level.Rooms[item->roomNumber].flags & 1) { aboveWater = false; - item->fallspeed += (5 - item->fallspeed) >> 1; - item->speed -= item->speed >> 2; + item->fallspeed += (5 - item->fallspeed) / 2; + item->speed -= item->speed / 4; if (item->speed) { - item->pos.zRot += (((item->speed >> 4) + 3) * ANGLE(1)); + item->pos.zRot += (((item->speed / 16) + 3) * ANGLE(1)); if (item->requiredAnimState) - item->pos.yRot += (((item->speed >> 2) + 3) * ANGLE(1)); + item->pos.yRot += (((item->speed / 4) + 3) * ANGLE(1)); else - item->pos.xRot += (((item->speed >> 2) + 3) * ANGLE(1)); + item->pos.xRot += (((item->speed / 4) + 3) * ANGLE(1)); } } else @@ -494,11 +494,11 @@ void ControlGrenade(short itemNumber) item->fallspeed += 3; if (item->speed) { - item->pos.zRot += (((item->speed >> 2) + 7) * ANGLE(1)); + item->pos.zRot += (((item->speed / 4) + 7) * ANGLE(1)); if (item->requiredAnimState) - item->pos.yRot += (((item->speed >> 1) + 7) * ANGLE(1)); + item->pos.yRot += (((item->speed / 2) + 7) * ANGLE(1)); else - item->pos.xRot += (((item->speed >> 1) + 7) * ANGLE(1)); + item->pos.xRot += (((item->speed / 2) + 7) * ANGLE(1)); } } @@ -1260,7 +1260,7 @@ void ControlCrossbowBolt(short itemNumber) { PHD_VECTOR bubblePos(item->pos.xPos, item->pos.yPos, item->pos.zPos); if (item->speed > 64) - item->speed -= (item->speed >> 4); + item->speed -= (item->speed / 16); if (GlobalCounter & 1) CreateBubble(&bubblePos, roomNumber, 4, 7, 0, 0, 0, 0); aboveWater = false; @@ -1660,7 +1660,7 @@ void FireRocket() item->pos.yRot += Lara.torsoYrot; } - item->speed = 512 >> 5; + item->speed = 16; item->itemFlags[0] = 0; AddActiveItem(itemNumber); @@ -1720,20 +1720,20 @@ void SomeSparkEffect(int x, int y, int z, int count) spark->colFadeSpeed = 4; spark->fadeToBlack = 8; spark->life = 24; - spark->dR = spark->sR >> 1; - spark->dG = spark->sG >> 1; - spark->dB = spark->sB >> 1; + spark->dR = spark->sR / 2; + spark->dG = spark->sG / 2; + spark->dB = spark->sB / 2; spark->sLife = 24; spark->transType = COLADD; spark->friction = 5; int random = GetRandomControl() & 0xFFF; - spark->xVel = -128 * phd_sin(random << 4); + spark->xVel = -128 * phd_sin(random * 16); spark->yVel = -640 - (byte)GetRandomControl(); - spark->zVel = 128 * phd_cos(random << 4); + spark->zVel = 128 * phd_cos(random * 16); spark->flags = 0; - spark->x = x + (spark->xVel >> 3); - spark->y = y - (spark->yVel >> 5); - spark->z = z + (spark->zVel >> 3); + spark->x = x + (spark->xVel / 8); + spark->y = y - (spark->yVel / 32); + spark->z = z + (spark->zVel / 8); spark->maxYvel = 0; spark->gravity = (GetRandomControl() & 0xF) + 64; } diff --git a/TR5Main/Game/Lara/lara_swim.cpp b/TR5Main/Game/Lara/lara_swim.cpp index 68c49b6ac..ac594e19a 100644 --- a/TR5Main/Game/Lara/lara_swim.cpp +++ b/TR5Main/Game/Lara/lara_swim.cpp @@ -36,7 +36,7 @@ void LaraWaterCurrent(COLL_INFO* coll) // (F) (D) Lara.currentXvel += (sink->data * 1024 * phd_sin(angle - ANGLE(90)) - Lara.currentXvel) / 16; Lara.currentZvel += (sink->data * 1024 * phd_cos(angle - ANGLE(90)) - Lara.currentZvel) / 16; - LaraItem->pos.yPos += (sink->y - LaraItem->pos.yPos) >> 4; + LaraItem->pos.yPos += ((sink->y - LaraItem->pos.yPos) / 16); } else { @@ -64,8 +64,8 @@ void LaraWaterCurrent(COLL_INFO* coll) // (F) (D) return; } - LaraItem->pos.xPos += Lara.currentXvel >> 8; - LaraItem->pos.zPos += Lara.currentZvel >> 8; + LaraItem->pos.xPos += (Lara.currentXvel / 256); + LaraItem->pos.zPos += (Lara.currentZvel / 256); Lara.currentActive = 0; coll->facing = phd_atan(LaraItem->pos.zPos - coll->old.z, LaraItem->pos.xPos - coll->old.x); @@ -116,8 +116,8 @@ int GetWaterDepth(int x, int y, int z, short roomNumber)//4CA38, 4CE9C short roomIndex = NO_ROOM; do { - int zFloor = (z - r->z) >> WALL_SHIFT; - int xFloor = (x - r->x) >> WALL_SHIFT; + int zFloor = (z - r->z) / SECTOR(1); + int xFloor = (x - r->x) / SECTOR(1); if (zFloor <= 0) { @@ -156,7 +156,7 @@ int GetWaterDepth(int x, int y, int z, short roomNumber)//4CA38, 4CE9C r = &g_Level.Rooms[floor->skyRoom]; if (!(r->flags & (ENV_FLAG_WATER|ENV_FLAG_SWAMP))) { - int wh = floor->ceiling << 8; + int wh = floor->ceiling * 256; floor = GetFloor(x, y, z, &roomNumber); return (GetFloorHeight(floor, x, y, z) - wh); } @@ -171,7 +171,7 @@ int GetWaterDepth(int x, int y, int z, short roomNumber)//4CA38, 4CE9C r = &g_Level.Rooms[floor->pitRoom]; if (r->flags & (ENV_FLAG_WATER|ENV_FLAG_SWAMP)) { - int wh = floor->floor << 8; + int wh = floor->floor * 256; floor = GetFloor(x, y, z, &roomNumber); return (GetFloorHeight(floor, x, y, z) - wh); } @@ -405,7 +405,7 @@ void UpdateSubsuitAngles()//4BD20, 4C184 (F) if (Subsuit.dXRot != 0) { - short rot = Subsuit.dXRot >> 3; + short rot = Subsuit.dXRot / 8; if (rot < -ANGLE(2)) rot = -ANGLE(2); else if (rot > ANGLE(2)) @@ -413,8 +413,8 @@ void UpdateSubsuitAngles()//4BD20, 4C184 (F) LaraItem->pos.xRot += rot; } - Subsuit.Vel[0] += abs(Subsuit.XRot >> 3); - Subsuit.Vel[1] += abs(Subsuit.XRot >> 3); + Subsuit.Vel[0] += abs(Subsuit.XRot / 8); + Subsuit.Vel[1] += abs(Subsuit.XRot / 8); if (Lara.turnRate > 0) { @@ -440,7 +440,7 @@ void UpdateSubsuitAngles()//4BD20, 4C184 (F) void SwimTurnSubsuit(ITEM_INFO* item)//4BBDC, 4C040 (F) { if (item->pos.yPos < 14080) - Subsuit.YVel += (14080 - item->pos.yPos) >> 4; + Subsuit.YVel += ((14080 - item->pos.yPos) / 16); if (TrInput & IN_FORWARD && item->pos.xRot > -ANGLE(85)) { @@ -525,8 +525,8 @@ void LaraSwimCollision(ITEM_INFO* item, COLL_INFO* coll)//4B608, 4BA6C short height = 762 * phd_sin(item->pos.xRot); height = abs(height); - if (height < ((LaraDrawType == LARA_DIVESUIT) << 6) + 200) - height = ((LaraDrawType == LARA_DIVESUIT) << 6) + 200; + if (height < ((LaraDrawType == LARA_DIVESUIT) * 64) + 200) + height = ((LaraDrawType == LARA_DIVESUIT) * 64) + 200; coll->badNeg = -64; @@ -651,7 +651,7 @@ void LaraSwimCollision(ITEM_INFO* item, COLL_INFO* coll)//4B608, 4BA6C { if (LaraDrawType == 5) { - SoundEffect(SFX_SWIMSUIT_METAL_CLASH, &LaraItem->pos, ((2 * GetRandomControl() + 0x8000) << 8) | 6); + SoundEffect(SFX_SWIMSUIT_METAL_CLASH, &LaraItem->pos, ((2 * GetRandomControl() + 0x8000) * 256) | 6); } if (Lara.anxiety < 96)