diff --git a/TR5Main/Objects/TR4/Entity/tr4_ahmet.cpp b/TR5Main/Objects/TR4/Entity/tr4_ahmet.cpp index ace1f756c..2c4ce8efc 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_ahmet.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_ahmet.cpp @@ -68,7 +68,7 @@ static void TriggerAhmetDeathEffect(ITEM_INFO* item) // cant be FALSE here because else it will be local space not world // because of that it cant be GetJointAbsPosition() ! meshCount = GetSpheres(item, CreatureSpheres, SPHERES_SPACE_WORLD, Matrix::Identity); - sphere = &CreatureSpheres[(Wibble >> 3) & 1]; + sphere = &CreatureSpheres[(Wibble / 8) & 1]; for (int i = meshCount; i > 0; i--, sphere += 2) TriggerFireFlame(sphere->x, sphere->y, sphere->z, -1, 1); @@ -369,9 +369,9 @@ bool RespawnAhmet(short itemNumber) FlashFadeB = 0; FlashFader = 32; - item->pos.xPos = (item->itemFlags[0] << 10) + 512; - item->pos.yPos = (item->itemFlags[1] << 8); - item->pos.zPos = (item->itemFlags[2] << 10) + 512; + item->pos.xPos = (item->itemFlags[0] * 1024) + 512; + item->pos.yPos = (item->itemFlags[1] * 256); + item->pos.zPos = (item->itemFlags[2] * 1024) + 512; IsRoomOutside(item->pos.xPos, item->pos.yPos, item->pos.zPos); diff --git a/TR5Main/Objects/TR4/Entity/tr4_baddy.cpp b/TR5Main/Objects/TR4/Entity/tr4_baddy.cpp index 78d12c3fc..71bd7d8de 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_baddy.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_baddy.cpp @@ -1025,7 +1025,7 @@ void BaddyControl(short itemNum) } if (currentCreature->enemy->objectNumber == ID_SMALLMEDI_ITEM) { - item->hitPoints += Objects[item->objectNumber].hitPoints >> 1; + item->hitPoints += Objects[item->objectNumber].hitPoints / 2; } else { diff --git a/TR5Main/Objects/TR4/Entity/tr4_crocodile.cpp b/TR5Main/Objects/TR4/Entity/tr4_crocodile.cpp index 87af30c66..ade7f9055 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_crocodile.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_crocodile.cpp @@ -162,7 +162,7 @@ void CrocodileControl(short itemNumber) AlertAllGuards(itemNumber); } - boneAngle = angle << 2; + boneAngle = angle * 4; switch (item->currentAnimState) { case CROC_IDLE: diff --git a/TR5Main/Objects/TR4/Entity/tr4_demigod.cpp b/TR5Main/Objects/TR4/Entity/tr4_demigod.cpp index c43b42cb3..ad1dede93 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_demigod.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_demigod.cpp @@ -236,8 +236,8 @@ static void DemigodHammerAttack(int x, int y, int z, int something) spark->gravity = -4 - (GetRandomControl() & 3); spark->maxYvel = -4 - (GetRandomControl() & 3); spark->dSize = ((GetRandomControl() & 0x3F) + 64); - spark->sSize = spark->dSize >> 3; - spark->size = spark->dSize >> 3; + spark->sSize = spark->dSize / 8; + spark->size = spark->dSize / 8; angle += deltaAngle; } @@ -349,9 +349,9 @@ void DemigodControl(short itemNumber) dz = abs(dz); if (dx <= dz) - laraInfo.xAngle = phd_atan(dz + (dx >> 1), dy); + laraInfo.xAngle = phd_atan(dz + (dx / 2), dy); else - laraInfo.xAngle = phd_atan(dx + (dz >> 1), dy); + laraInfo.xAngle = phd_atan(dx + (dz / 2), dy); } GetCreatureMood(item, &info, VIOLENT); @@ -361,17 +361,17 @@ void DemigodControl(short itemNumber) if (laraInfo.ahead) { - joint0 = laraInfo.angle >> 1; + joint0 = laraInfo.angle / 2; joint1 = -laraInfo.xAngle; - joint2 = laraInfo.angle >> 1; - joint3 = laraInfo.angle >> 1; + joint2 = laraInfo.angle / 2; + joint3 = laraInfo.angle / 2; } else if (info.ahead) { - joint0 = info.angle >> 1; + joint0 = info.angle / 2; joint1 = -info.xAngle; - joint2 = info.angle >> 1; - joint3 = info.angle >> 1; + joint2 = info.angle / 2; + joint3 = info.angle / 2; } switch (item->currentAnimState) diff --git a/TR5Main/Objects/TR4/Entity/tr4_enemy_jeep.cpp b/TR5Main/Objects/TR4/Entity/tr4_enemy_jeep.cpp index 13126652b..b0bfd4673 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_enemy_jeep.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_enemy_jeep.cpp @@ -397,6 +397,6 @@ void EnemyJeepControl(short itemNumber) item->gravityStatus = false; } - SoundEffect(SFX_TR4_JEEP_MOVE, &item->pos, (item->itemFlags[0] << 10) + 16777220); + SoundEffect(SFX_TR4_JEEP_MOVE, &item->pos, (item->itemFlags[0] * 1024) + 16777220); } } \ No newline at end of file diff --git a/TR5Main/Objects/TR4/Entity/tr4_guide.cpp b/TR5Main/Objects/TR4/Entity/tr4_guide.cpp index 153f9ef47..722dff1c8 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_guide.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_guide.cpp @@ -63,7 +63,7 @@ void GuideControl(short itemNumber) GrenadeLauncherSpecialEffect1(pos.x, pos.y - 40, pos.z, -1, 7); short random = GetRandomControl(); - TriggerDynamicLight(pos.x, pos.y, pos.z, 15, 255 - ((random >> 4) & 0x1F), 192 - ((random >> 6) & 0x1F), random & 0x3F); + TriggerDynamicLight(pos.x, pos.y, pos.z, 15, 255 - ((random / 16) & 0x1F), 192 - ((random / 64) & 0x1F), random & 0x3F); if (item->animNumber == obj->animIndex + 61) { @@ -72,8 +72,8 @@ void GuideControl(short itemNumber) { GrenadeLauncherSpecialEffect1( (random & 0x3F) + pos.x - 32, - ((random >> 3) & 0x3F) + pos.y - 128, - pos.z + ((random >> 6) & 0x3F) - 32, + ((random / 8) & 0x3F) + pos.y - 128, + pos.z + ((random / 64) & 0x3F) - 32, -1, 1); } @@ -109,9 +109,9 @@ void GuideControl(short itemNumber) short rot2 = 0; if (dx <= dz) - laraInfo.xAngle = phd_atan(dz + (dx >> 1), dy); + laraInfo.xAngle = phd_atan(dz + (dx / 2), dy); else - laraInfo.xAngle = phd_atan(dx + (dz >> 1), dy); + laraInfo.xAngle = phd_atan(dx + (dz / 2), dy); ITEM_INFO* foundEnemy = NULL; @@ -183,19 +183,19 @@ void GuideControl(short itemNumber) creature->LOT.isJumping = false; creature->flags = 0; creature->maximumTurn = 0; - joint2 = info.angle >> 1; + joint2 = info.angle / 2; if (laraInfo.ahead) { - joint0 = laraInfo.angle >> 1; - joint1 = laraInfo.xAngle >> 1; - joint2 = laraInfo.angle >> 1; + joint0 = laraInfo.angle / 2; + joint1 = laraInfo.xAngle / 2; + joint2 = laraInfo.angle / 2; } else if (info.ahead) { - joint0 = info.angle >> 1; - joint1 = info.xAngle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint1 = info.xAngle / 2; + joint2 = info.angle / 2; } /*if (Objects[ID_WRAITH1].loaded & 0x10000) @@ -457,8 +457,8 @@ void GuideControl(short itemNumber) { GrenadeLauncherSpecialEffect1( (random & 0x3F) + pos1.x - 64, - ((random >> 5) & 0x3F) + pos1.y - 96, - ((random >> 10) & 0x3F) + pos1.z - 64, + ((random / 32) & 0x3F) + pos1.y - 96, + ((random / 1024) & 0x3F) + pos1.z - 64, -1, 7); @@ -467,8 +467,8 @@ void GuideControl(short itemNumber) pos1.y - 64, pos1.z - 32, 10, - 192 - ((random >> 4) & 0x1F), - 128 - ((random >> 6) & 0x1F), + 192 - ((random / 16) & 0x1F), + 128 - ((random / 64) & 0x1F), random & 0x1F); item->itemFlags[1] = 2; @@ -477,24 +477,24 @@ void GuideControl(short itemNumber) else { TriggerMetalSparks(pos1.x, pos1.y, pos1.z, -1, -1, 0, 1); - TriggerDynamicLight(pos1.x, pos1.y, pos1.z, 10, random & 0x1F, 96 - ((random >> 6) & 0x1F), 128 - ((random >> 4) & 0x1F)); + TriggerDynamicLight(pos1.x, pos1.y, pos1.z, 10, random & 0x1F, 96 - ((random / 64) & 0x1F), 128 - ((random / 16) & 0x1F)); } } else { - TriggerDynamicLight(pos1.x - 32, pos1.y - 64, pos1.z - 32, 10, 192 - ((random >> 4) & 0x1F), 128 - ((random >> 6) & 0x1F), random & 0x1F); + TriggerDynamicLight(pos1.x - 32, pos1.y - 64, pos1.z - 32, 10, 192 - ((random / 16) & 0x1F), 128 - ((random / 64) & 0x1F), random & 0x1F); GrenadeLauncherSpecialEffect1( (random & 0x3F) + pos1.x - 64, - ((random >> 5) & 0x3F) + pos1.y - 96, - ((random >> 10) & 0x3F) + pos1.z - 64, + ((random / 32) & 0x3F) + pos1.y - 96, + ((random / 1024) & 0x3F) + pos1.z - 64, -1, 7); } } else { - TriggerDynamicLight(pos1.x, pos1.y, pos1.z, 10, random & 0x1F, 96 - ((random >> 6) & 0x1F), 128 - ((random >> 4) & 0x1F)); + TriggerDynamicLight(pos1.x, pos1.y, pos1.z, 10, random & 0x1F, 96 - ((random / 64) & 0x1F), 128 - ((random / 16) & 0x1F)); TriggerMetalSparks(pos1.x, pos1.y, pos1.z, -1, -1, 0, 1); } @@ -513,9 +513,9 @@ void GuideControl(short itemNumber) case 31: if (info.ahead) { - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; - joint1 = info.xAngle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; + joint1 = info.xAngle / 2; } creature->maximumTurn = 0; diff --git a/TR5Main/Objects/TR4/Entity/tr4_harpy.cpp b/TR5Main/Objects/TR4/Entity/tr4_harpy.cpp index b221e94ed..19199c7e0 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_harpy.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_harpy.cpp @@ -364,8 +364,8 @@ void HarpyControl(short itemNumber) if (info.ahead) { - joint0 = info.angle >> 1; - joint1 = info.angle >> 1; + joint0 = info.angle / 2; + joint1 = info.angle / 2; joint0 = info.xAngle; } diff --git a/TR5Main/Objects/TR4/Entity/tr4_horseman.cpp b/TR5Main/Objects/TR4/Entity/tr4_horseman.cpp index dafc7a060..b974f016c 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_horseman.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_horseman.cpp @@ -30,7 +30,7 @@ static void HorsemanSparks(PHD_VECTOR* pos, int param1, int num) spark->sB = (r & 0xF) + 16; spark->sR = 0; spark->dG = 96; - spark->dB = ((r >> 4) & 0x1F) + 48; + spark->dB = ((r / 16) & 0x1F) + 48; spark->dR = 0; spark->colFadeSpeed = 2; spark->fadeToBlack = 4; @@ -43,7 +43,7 @@ static void HorsemanSparks(PHD_VECTOR* pos, int param1, int num) spark->friction = 34; spark->yVel = (r & 0xFFF) - 2048; spark->flags = SP_NONE; - spark->gravity = (r >> 7) & 0x1F; + spark->gravity = (r / 128) & 0x1F; spark->maxYvel = 0; spark->zVel = phd_cos((r & 0x7FF) + param1 - 1024) * 4096; spark->xVel = -phd_sin((r & 0x7FF) + param1 - 1024) * 4096; @@ -63,7 +63,7 @@ static void HorsemanSparks(PHD_VECTOR* pos, int param1, int num) spark->dR = 0; spark->colFadeSpeed = 2; spark->fadeToBlack = 4; - spark->dB = ((r >> 4) & 0x1F) + 48; + spark->dB = ((r / 16) & 0x1F) + 48; spark->life = 9; spark->sLife = 9; spark->transType = COLADD; @@ -71,8 +71,8 @@ static void HorsemanSparks(PHD_VECTOR* pos, int param1, int num) spark->y = pos->y; spark->z = pos->z; spark->yVel = (r & 0xFFF) - 2048; - spark->gravity = (r >> 7) & 0x1F; - spark->rotAng = r >> 3; + spark->gravity = (r / 128) & 0x1F; + spark->rotAng = r / 8; if (r & 1) { spark->rotAdd = -16 - (r & 0xF); @@ -83,7 +83,7 @@ static void HorsemanSparks(PHD_VECTOR* pos, int param1, int num) } spark->scalar = 3; spark->friction = 34; - spark->sSize = spark->size = ((r >> 5) & 7) + 4; + spark->sSize = spark->size = ((r / 32) & 7) + 4; spark->dSize = spark->sSize / 2; spark->flags = 26; spark->maxYvel = 0; diff --git a/TR5Main/Objects/TR4/Entity/tr4_knighttemplar.cpp b/TR5Main/Objects/TR4/Entity/tr4_knighttemplar.cpp index 1f4f0444c..99735331e 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_knighttemplar.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_knighttemplar.cpp @@ -85,8 +85,8 @@ void KnightTemplarControl(short itemNumber) if (info.ahead) { - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; joint1 = info.xAngle; } diff --git a/TR5Main/Objects/TR4/Entity/tr4_mummy.cpp b/TR5Main/Objects/TR4/Entity/tr4_mummy.cpp index d97a3bbc4..c67acfd91 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_mummy.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_mummy.cpp @@ -146,8 +146,8 @@ void MummyControl(short itemNumber) if (info.ahead) { - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; joint1 = info.xAngle; } diff --git a/TR5Main/Objects/TR4/Entity/tr4_mutant.cpp b/TR5Main/Objects/TR4/Entity/tr4_mutant.cpp index 26f6fc1dc..f37107c54 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_mutant.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_mutant.cpp @@ -72,11 +72,11 @@ void TriggerMutantRocketEffects(short fxNumber, short xVel, short yVel, short zV color = (GetRandomControl() & 0x3F) - 128; sptr->sB = 0; sptr->sR = color; - sptr->sG = color >> 1; + sptr->sG = color / 2; color = (GetRandomControl() & 0x3F) - 128; sptr->dB = 0; sptr->dR = color; - sptr->dG = color >> 1; + sptr->dG = color / 2; sptr->fadeToBlack = 8; sptr->colFadeSpeed = (GetRandomControl() & 3) + 8; sptr->transType = COLADD; @@ -107,7 +107,7 @@ void TriggerMutantRocketEffects(short fxNumber, short xVel, short yVel, short zV size = (GetRandomControl() & 0xF) + 128; sptr->size = size; sptr->sSize = size; - sptr->dSize = size >> 2; + sptr->dSize = size / 4; } static void ShootFireball(PHD_3DPOS* src, MissileRotationType rotation, short roomNumber, int timer) diff --git a/TR5Main/Objects/TR4/Entity/tr4_sentrygun.cpp b/TR5Main/Objects/TR4/Entity/tr4_sentrygun.cpp index 8cfae7828..a82bc806b 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_sentrygun.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_sentrygun.cpp @@ -70,7 +70,7 @@ static void SentryGunThrowFire(ITEM_INFO* item) } spark->scalar = 3; - spark->dSize = v * ((GetRandomControl() & 7) + 60) >> 8; + spark->dSize = (v * ((GetRandomControl() & 7) + 60)) / 256; spark->sSize = spark->dSize / 8; spark->size = spark->dSize / 8; } @@ -146,7 +146,7 @@ void SentryGunControl(short itemNum) { // Throw fire SentryGunThrowFire(item); - c = phd_sin((GlobalCounter & 0x1F) << 11) * 4096; + c = phd_sin((GlobalCounter & 0x1F) * 2048) * 4096; } else { diff --git a/TR5Main/Objects/TR4/Entity/tr4_skeleton.cpp b/TR5Main/Objects/TR4/Entity/tr4_skeleton.cpp index e1ec2b8a3..be5604a95 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_skeleton.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_skeleton.cpp @@ -31,8 +31,8 @@ static void WakeUpSkeleton(ITEM_INFO* item) fx->pos.zPos = (byte)GetRandomControl() + item->pos.zPos - 128; fx->roomNumber = item->roomNumber; fx->pos.yRot = 2 * GetRandomControl(); - fx->speed = GetRandomControl() >> 11; - fx->fallspeed = -(GetRandomControl() >> 10); + fx->speed = GetRandomControl() / 2048; + fx->fallspeed = -(GetRandomControl() / 1024); fx->frameNumber = Objects[103].meshIndex; fx->objectNumber = ID_BODY_PART; fx->shade = 0x4210; diff --git a/TR5Main/Objects/TR4/Entity/tr4_sphinx.cpp b/TR5Main/Objects/TR4/Entity/tr4_sphinx.cpp index 5ccd56476..2d06296c4 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_sphinx.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_sphinx.cpp @@ -48,7 +48,7 @@ void SphinxControl(short itemNumber) { MESH_INFO* mesh = &room->mesh[i]; - if (mesh->z >> 10 == z >> 10 && mesh->x >> 10 == x >> 10 && mesh->staticNumber >= 50) + if (((mesh->z / 1024) == (z / 1024)) && ((mesh->x / 1024) == (x / 1024)) && mesh->staticNumber >= 50) { ShatterObject(NULL, mesh, -64, item->roomNumber, 0); SoundEffect(SFX_TR4_HIT_ROCK, &item->pos, 0); diff --git a/TR5Main/Objects/TR4/Entity/tr4_von_croy.cpp b/TR5Main/Objects/TR4/Entity/tr4_von_croy.cpp index 0a894a2d1..aad3cb425 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_von_croy.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_von_croy.cpp @@ -252,9 +252,9 @@ void VonCroyControl(short itemNumber) short rot2 = 0; if (dx <= dz) - laraInfo.xAngle = phd_atan(dz + (dx >> 1), dy); + laraInfo.xAngle = phd_atan(dz + (dx / 2), dy); else - laraInfo.xAngle = phd_atan(dx + (dz >> 1), dy); + laraInfo.xAngle = phd_atan(dx + (dz / 2), dy); } if (abs(laraInfo.angle) < 6144 && laraInfo.distance < SQUARE(1024)) @@ -663,8 +663,8 @@ void VonCroyControl(short itemNumber) case STATE_VON_CROY_KNIFE_ATTACK_HIGH: if (info.ahead) { - joint2 = info.angle >> 1; - joint1 = info.xAngle >> 1; + joint2 = info.angle / 2; + joint1 = info.xAngle / 2; joint0 = joint2; } @@ -733,8 +733,8 @@ void VonCroyControl(short itemNumber) case STATE_VON_CROY_KNIFE_ATTACK_LOW: if (info.ahead) { - joint2 = info.angle >> 1; - joint1 = info.xAngle >> 1; + joint2 = info.angle / 2; + joint1 = info.xAngle / 2; joint0 = joint2; } @@ -785,13 +785,13 @@ void VonCroyControl(short itemNumber) case 32: if (info.ahead) { - joint2 = info.angle >> 1; + joint2 = info.angle / 2; joint1 = info.xAngle; joint0 = joint2; } creature->maximumTurn = 0; - ClampRotation(&item->pos, info.angle >> 1, ANGLE(6)); + ClampRotation(&item->pos, info.angle / 2, ANGLE(6)); if (item->animNumber == Objects[item->objectNumber].animIndex + 47) { diff --git a/TR5Main/Objects/TR4/Entity/tr4_wildboar.cpp b/TR5Main/Objects/TR4/Entity/tr4_wildboar.cpp index 0c91af9f6..62b61ae8f 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_wildboar.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_wildboar.cpp @@ -89,8 +89,8 @@ void WildBoarControl(short itemNumber) if (info.ahead) { - joint1 = info.angle >> 1; - joint3 = info.angle >> 1; + joint1 = info.angle / 2; + joint3 = info.angle / 2; } switch (item->currentAnimState) @@ -103,7 +103,7 @@ void WildBoarControl(short itemNumber) } else if (GetRandomControl() & 0x7F) { - joint1 = AIGuard(creature) >> 1; + joint1 = AIGuard(creature) / 2; joint3 = joint1; } else diff --git a/TR5Main/Objects/TR4/Entity/tr4_wraith.cpp b/TR5Main/Objects/TR4/Entity/tr4_wraith.cpp index ad864b0bf..4801319a1 100644 --- a/TR5Main/Objects/TR4/Entity/tr4_wraith.cpp +++ b/TR5Main/Objects/TR4/Entity/tr4_wraith.cpp @@ -64,7 +64,7 @@ void WraithControl(short itemNumber) y = target->pos.yPos; z = target->pos.zPos - item->pos.zPos; distance = SQUARE(x) + SQUARE(z); - dy = abs((distance >> 13) - 512); + dy = abs((distance / 8192) - 512); } else { @@ -74,7 +74,7 @@ void WraithControl(short itemNumber) z = room->z + room->xSize * 1024 / 2 - item->pos.zPos; distance = SQUARE(x) + SQUARE(z); - dy = abs((distance >> 13) - 768); + dy = abs((distance / 8192) - 768); y = room->y + ((room->minfloor - room->maxceiling) / 2); } @@ -327,13 +327,13 @@ void WraithControl(short itemNumber) int j = 0; for (int i = WRAITH_COUNT - 1; i > 0; i--) { - creature[i - 1].xPos += (creature[i - 1].xRot >> 4); - creature[i - 1].yPos += (creature[i - 1].yRot >> 4); - creature[i - 1].zPos += (creature[i - 1].zRot >> 4); + creature[i - 1].xPos += (creature[i - 1].xRot / 16); + creature[i - 1].yPos += (creature[i - 1].yRot / 16); + creature[i - 1].zPos += (creature[i - 1].zRot / 16); - creature[i - 1].xRot -= (creature[i - 1].xRot >> 4); - creature[i - 1].yRot -= (creature[i - 1].yRot >> 4); - creature[i - 1].zRot -= (creature[i - 1].zRot >> 4); + creature[i - 1].xRot -= (creature[i - 1].xRot / 16); + creature[i - 1].yRot -= (creature[i - 1].yRot / 16); + creature[i - 1].zRot -= (creature[i - 1].zRot / 16); creature[i].xPos = creature[i - 1].xPos; creature[i].yPos = creature[i - 1].yPos; @@ -552,7 +552,7 @@ void WraithWallsEffect(int x, int y, int z, short yrot, short objNumber) short size = (GetRandomControl() & 0x1F) + 48; spark->sSize = size; spark->size = size; - spark->dSize = size >> 2; + spark->dSize = size / 4; } } diff --git a/TR5Main/Objects/TR4/Object/tr4_element_puzzle.cpp b/TR5Main/Objects/TR4/Object/tr4_element_puzzle.cpp index 4193c5a29..c7172c2ee 100644 --- a/TR5Main/Objects/TR4/Object/tr4_element_puzzle.cpp +++ b/TR5Main/Objects/TR4/Object/tr4_element_puzzle.cpp @@ -40,8 +40,8 @@ void ElementPuzzleControl(short itemNumber) on = 1; if (on <= 255) { - r = r * on >> 8; - g = g * on >> 8; + r = (r * on) / 256; + g = (g * on) / 256; } } else diff --git a/TR5Main/Objects/TR4/Trap/tr4_blade.cpp b/TR5Main/Objects/TR4/Trap/tr4_blade.cpp index 34d85df43..d18948996 100644 --- a/TR5Main/Objects/TR4/Trap/tr4_blade.cpp +++ b/TR5Main/Objects/TR4/Trap/tr4_blade.cpp @@ -38,7 +38,7 @@ void BladeCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll) DoBloodSplat((GetRandomControl() & 0x3F) + l->pos.xPos - 32, l->pos.yPos - (GetRandomControl() & 0x1FF) - 256, (GetRandomControl() & 0x3F) + l->pos.zPos - 32, - (GetRandomControl() & 3) + (item->itemFlags[3] >> 5) + 2, + (GetRandomControl() & 3) + (item->itemFlags[3] / 32) + 2, 2 * GetRandomControl(), l->roomNumber); } diff --git a/TR5Main/Objects/TR4/Trap/tr4_slicerdicer.cpp b/TR5Main/Objects/TR4/Trap/tr4_slicerdicer.cpp index 9639c1320..9c02b72a1 100644 --- a/TR5Main/Objects/TR4/Trap/tr4_slicerdicer.cpp +++ b/TR5Main/Objects/TR4/Trap/tr4_slicerdicer.cpp @@ -15,9 +15,9 @@ void InitialiseSlicerDicer(short itemNum) item->pos.xPos += dx; item->pos.zPos += dz; - item->itemFlags[0] = item->pos.xPos >> 8; - item->itemFlags[1] = (item->pos.yPos - 4608) >> 8; - item->itemFlags[2] = item->pos.zPos >> 8; + item->itemFlags[0] = item->pos.xPos / 256; + item->itemFlags[1] = (item->pos.yPos - 4608) / 256; + item->itemFlags[2] = item->pos.zPos / 256; item->itemFlags[3] = 50; } @@ -30,9 +30,9 @@ void SlicerDicerControl(short itemNum) int factor = 4608 * phd_cos(item->triggerFlags) * phd_cos(item->pos.yRot); - item->pos.xPos = (item->itemFlags[0] << 8) + factor; - item->pos.yPos = (item->itemFlags[1] << 8) - 4608 * phd_sin(item->triggerFlags); - item->pos.zPos = (item->itemFlags[2] << 8) + factor; + item->pos.xPos = (item->itemFlags[0] * 256) + factor; + item->pos.yPos = (item->itemFlags[1] * 256) - 4608 * phd_sin(item->triggerFlags); + item->pos.zPos = (item->itemFlags[2] * 256) + factor; item->triggerFlags += 170; diff --git a/TR5Main/Objects/TR4/Trap/tr4_stargate.cpp b/TR5Main/Objects/TR4/Trap/tr4_stargate.cpp index 99738bd74..d9d88019d 100644 --- a/TR5Main/Objects/TR4/Trap/tr4_stargate.cpp +++ b/TR5Main/Objects/TR4/Trap/tr4_stargate.cpp @@ -92,9 +92,9 @@ void StargateCollision(short itemNum, ITEM_INFO* l, COLL_INFO* c) } } - result >>= 1; + result /= 2; j++; - flags >>= 1; + flags /= 2; } while (result); } diff --git a/TR5Main/Objects/TR5/Emitter/tr5_bats_emitter.cpp b/TR5Main/Objects/TR5/Emitter/tr5_bats_emitter.cpp index 0710aa1b8..bb2b1243a 100644 --- a/TR5Main/Objects/TR5/Emitter/tr5_bats_emitter.cpp +++ b/TR5Main/Objects/TR5/Emitter/tr5_bats_emitter.cpp @@ -182,10 +182,10 @@ void UpdateBats() if (bat->counter > 90) { - short speed = bat->speed << 7; + short speed = bat->speed * 128; - short xAngle = abs(angles[1] - bat->pos.xRot) >> 3; - short yAngle = abs(angles[0] - bat->pos.yRot) >> 3; + short xAngle = abs(angles[1] - bat->pos.xRot) / 8; + short yAngle = abs(angles[0] - bat->pos.yRot) / 8; if (xAngle < -speed) xAngle = -speed; diff --git a/TR5Main/Objects/TR5/Emitter/tr5_rats_emitter.cpp b/TR5Main/Objects/TR5/Emitter/tr5_rats_emitter.cpp index 30d7b27b4..5b1598bb9 100644 --- a/TR5Main/Objects/TR5/Emitter/tr5_rats_emitter.cpp +++ b/TR5Main/Objects/TR5/Emitter/tr5_rats_emitter.cpp @@ -179,7 +179,7 @@ void UpdateRats() rat->pos.yRot += 512; else rat->pos.yRot -= 512; - rat->speed = 48 - (abs(angle) >> 10); + rat->speed = 48 - (abs(angle) / 1024); } else { diff --git a/TR5Main/Objects/TR5/Emitter/tr5_smoke_emitter.cpp b/TR5Main/Objects/TR5/Emitter/tr5_smoke_emitter.cpp index d87551801..e1fed6fb0 100644 --- a/TR5Main/Objects/TR5/Emitter/tr5_smoke_emitter.cpp +++ b/TR5Main/Objects/TR5/Emitter/tr5_smoke_emitter.cpp @@ -38,7 +38,7 @@ void InitialiseSmokeEmitter(short itemNumber) } else if (item->triggerFlags & 8) { - item->itemFlags[0] = item->triggerFlags >> 4; + item->itemFlags[0] = item->triggerFlags / 16; if (item->pos.yRot > 0) { @@ -59,7 +59,7 @@ void InitialiseSmokeEmitter(short itemNumber) item->pos.xPos -= 256; } - if ((signed short)(item->triggerFlags >> 4) <= 0) + if ((signed short)(item->triggerFlags / 16) <= 0) { item->itemFlags[2] = 4096; item->triggerFlags |= 4; diff --git a/TR5Main/Objects/TR5/Emitter/tr5_spider_emitter.cpp b/TR5Main/Objects/TR5/Emitter/tr5_spider_emitter.cpp index dc897b6c7..558b8b9a5 100644 --- a/TR5Main/Objects/TR5/Emitter/tr5_spider_emitter.cpp +++ b/TR5Main/Objects/TR5/Emitter/tr5_spider_emitter.cpp @@ -175,7 +175,7 @@ void UpdateSpiders() spider->pos.yRot += 512; else spider->pos.yRot -= 512; - spider->speed = 48 - (abs(angle) >> 10); + spider->speed = 48 - (abs(angle) / 1024); } else { diff --git a/TR5Main/Objects/TR5/Entity/tr5_autoguns.cpp b/TR5Main/Objects/TR5/Entity/tr5_autoguns.cpp index 9a143e476..c2d3c2abd 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_autoguns.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_autoguns.cpp @@ -43,8 +43,8 @@ static void TriggerAutoGunSmoke(PHD_VECTOR* pos, char shade) spark->gravity = -4 - (GetRandomControl() & 3); spark->mirror = 0; spark->dSize = (GetRandomControl() & 0xF) + 24; - spark->sSize = spark->dSize >> 2; - spark->size = spark->dSize >> 2; + spark->sSize = spark->dSize / 4; + spark->size = spark->dSize / 4; } void AutoGunsControl(short itemNumber) @@ -166,7 +166,7 @@ void AutoGunsControl(short itemNumber) } if (item->itemFlags[2]) - TriggerAutoGunSmoke((PHD_VECTOR*)&pos1, item->itemFlags[2] >> 4); + TriggerAutoGunSmoke((PHD_VECTOR*)&pos1, item->itemFlags[2] / 16); } else { diff --git a/TR5Main/Objects/TR5/Entity/tr5_chef.cpp b/TR5Main/Objects/TR5/Entity/tr5_chef.cpp index d5a8b0419..177d112bb 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_chef.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_chef.cpp @@ -100,9 +100,9 @@ void ControlChef(short itemNumber) if (info.ahead) { - joint0 = info.angle >> 1; + joint0 = info.angle / 2; //joint1 = info.xAngle; - joint2 = info.angle >> 1; + joint2 = info.angle / 2; } creature->maximumTurn = 0; diff --git a/TR5Main/Objects/TR5/Entity/tr5_cyborg.cpp b/TR5Main/Objects/TR5/Entity/tr5_cyborg.cpp index c9a84a54c..176393b11 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_cyborg.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_cyborg.cpp @@ -65,13 +65,13 @@ static void TriggerHitmanSparks(int x, int y, int z, short xv, short yv, short z spark->scalar = 1; spark->flags = SP_SCALE; spark->x = (rand() & 7) + x - 3; - spark->y = ((rand() >> 3) & 7) + y - 3; - spark->z = ((rand() >> 6) & 7) + z - 3; - spark->xVel = (byte)(rand() >> 2) + xv - 128; - spark->yVel = (byte)(rand() >> 4) + yv - 128; - spark->zVel = (byte)(rand() >> 6) + zv - 128; - spark->sSize = spark->size= ((rand() >> 9) & 3) + 4; - spark->dSize = ((rand() >> 12) & 1) + 1; + spark->y = ((rand() / 8) & 7) + y - 3; + spark->z = ((rand() / 64) & 7) + z - 3; + spark->xVel = (byte)(rand() / 4) + xv - 128; + spark->yVel = (byte)(rand() / 16) + yv - 128; + spark->zVel = (byte)(rand() / 64) + zv - 128; + spark->sSize = spark->size= ((rand() / 512) & 3) + 4; + spark->dSize = ((rand() / 4096) & 1) + 1; spark->maxYvel = 0; spark->gravity = 0; } @@ -278,7 +278,7 @@ void HitmanControl(short itemNumber) if (info.ahead && item->aiBits != GUARD) { - joint0 = info.angle >> 1; + joint0 = info.angle / 2; joint1 = info.xAngle; } @@ -467,8 +467,8 @@ void HitmanControl(short itemNumber) break; case STATE_HITMAN_AIM: - joint0 = laraInfo.angle >> 1; - joint2 = laraInfo.angle >> 1; + joint0 = laraInfo.angle / 2; + joint2 = laraInfo.angle / 2; creature->flags = 0; creature->maximumTurn = 0; @@ -496,8 +496,8 @@ void HitmanControl(short itemNumber) break; case STATE_HITMAN_FIRE: - joint0 = laraInfo.angle >> 1; - joint2 = laraInfo.angle >> 1; + joint0 = laraInfo.angle / 2; + joint2 = laraInfo.angle / 2; if (info.ahead) joint1 = info.xAngle; diff --git a/TR5Main/Objects/TR5/Entity/tr5_dog.cpp b/TR5Main/Objects/TR5/Entity/tr5_dog.cpp index 87ebbfe85..b1f23d422 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_dog.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_dog.cpp @@ -84,7 +84,7 @@ void Tr5DogControl(short itemNumber) CreatureMood(item, &info, VIOLENT); if (!creature->mood) - creature->maximumTurn >>= 1; + creature->maximumTurn /= 2; angle = CreatureTurn(item, creature->maximumTurn); joint0 = 4 * angle; diff --git a/TR5Main/Objects/TR5/Entity/tr5_ghost.cpp b/TR5Main/Objects/TR5/Entity/tr5_ghost.cpp index 423f80c9c..603e6a73c 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_ghost.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_ghost.cpp @@ -63,8 +63,8 @@ void InvisibleGhostControl(short itemNumber) if (info.ahead) { - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; joint1 = info.xAngle; } diff --git a/TR5Main/Objects/TR5/Entity/tr5_gladiator.cpp b/TR5Main/Objects/TR5/Entity/tr5_gladiator.cpp index 804fca981..ad8835926 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_gladiator.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_gladiator.cpp @@ -101,8 +101,8 @@ void ControlGladiator(short itemNumber) if (info.ahead) { - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; joint1 = info.xAngle; } diff --git a/TR5Main/Objects/TR5/Entity/tr5_guard.cpp b/TR5Main/Objects/TR5/Entity/tr5_guard.cpp index 7d1aeee7f..604a5688e 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_guard.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_guard.cpp @@ -368,7 +368,7 @@ void GuardControl(short itemNum) { if (!(item->aiBits & FOLLOW)) { - joint0 = info.angle >> 1; + joint0 = info.angle / 2; joint1 = info.xAngle; } } @@ -458,8 +458,8 @@ void GuardControl(short itemNum) break; case STATE_GUARD_FIRE_SINGLE: case STATE_GUARD_FIRE_FAST: - joint0 = laraInfo.angle >> 1; - joint2 = laraInfo.angle >> 1; + joint0 = laraInfo.angle / 2; + joint2 = laraInfo.angle / 2; if (info.ahead) joint1 = info.xAngle; if (abs(info.angle) >= ANGLE(2)) @@ -502,8 +502,8 @@ void GuardControl(short itemNum) break; case STATE_GUARD_AIM: creature->flags = 0; - joint0 = laraInfo.angle >> 1; - joint2 = laraInfo.angle >> 1; + joint0 = laraInfo.angle / 2; + joint2 = laraInfo.angle / 2; if (info.ahead) joint1 = info.xAngle; if (abs(info.angle) >= ANGLE(2)) @@ -935,8 +935,8 @@ void SniperControl(short itemNumber) angle = CreatureTurn(item, creature->maximumTurn); if (info.ahead) { - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; joint1 = info.xAngle; } creature->maximumTurn = 0; @@ -1107,7 +1107,7 @@ void Mafia2Control(short itemNum) creature->maximumTurn = 0; if (info.ahead && !(item->aiBits & GUARD)) { - joint0 = info.angle >> 1; + joint0 = info.angle / 2; joint1 = info.xAngle; } if (item->aiBits & GUARD) @@ -1191,8 +1191,8 @@ void Mafia2Control(short itemNum) } break; case STATE_MAFIA2_FIRE: - joint0 = laraInfo.angle >> 1; - joint2 = laraInfo.angle >> 1; + joint0 = laraInfo.angle / 2; + joint2 = laraInfo.angle / 2; if (info.ahead) joint1 = info.xAngle; creature->maximumTurn = 0; @@ -1209,14 +1209,14 @@ void Mafia2Control(short itemNum) } if (!creature->flags) { - ShotLara(item, &info, &ArmedBaddy2Gun, laraInfo.angle >> 1, 35); + ShotLara(item, &info, &ArmedBaddy2Gun, laraInfo.angle / 2, 35); creature->flags = 1; item->firedWeapon = 2; } break; case STATE_MAFIA2_AIM: - joint0 = laraInfo.angle >> 1; - joint2 = laraInfo.angle >> 1; + joint0 = laraInfo.angle / 2; + joint2 = laraInfo.angle / 2; creature->flags = 0; creature->maximumTurn = 0; if (info.ahead) diff --git a/TR5Main/Objects/TR5/Entity/tr5_gunship.cpp b/TR5Main/Objects/TR5/Entity/tr5_gunship.cpp index a1d18f9c7..df8c50bc0 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_gunship.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_gunship.cpp @@ -33,24 +33,24 @@ void ControlGunShip(short itemNumber) if (!item->itemFlags[0] && !item->itemFlags[1] && !item->itemFlags[2]) { - item->itemFlags[0] = pos.x >> 4; - item->itemFlags[1] = pos.y >> 4; - item->itemFlags[2] = pos.z >> 4; + item->itemFlags[0] = pos.x / 16; + item->itemFlags[1] = pos.y / 16; + item->itemFlags[2] = pos.z / 16; } pos.x = (pos.x + 80 * item->itemFlags[0]) / 6; pos.y = (pos.y + 80 * item->itemFlags[1]) / 6; pos.z = (pos.z + 80 * item->itemFlags[2]) / 6; - item->itemFlags[0] = pos.x >> 4; - item->itemFlags[1] = pos.y >> 4; - item->itemFlags[2] = pos.z >> 4; + item->itemFlags[0] = pos.x / 16; + item->itemFlags[1] = pos.y / 16; + item->itemFlags[2] = pos.z / 16; if (item->triggerFlags == 1) - item->pos.zPos += (pos.z - item->pos.zPos) >> 5; + item->pos.zPos += (pos.z - item->pos.zPos) / 32; else - item->pos.xPos += (pos.x - item->pos.xPos) >> 5; - item->pos.yPos += (pos.y - item->pos.yPos - 256) >> 5; + item->pos.xPos += (pos.x - item->pos.xPos) / 32; + item->pos.yPos += (pos.y - item->pos.yPos - 256) / 32; GAME_VECTOR start; start.x = GetRandomControl() + item->pos.xPos - 128; @@ -157,7 +157,7 @@ void ControlGunShip(short itemNumber) SPARKS* spark = &Sparks[GetFreeSpark()]; spark->on = 1; spark->sR = spark->dR = (GetRandomControl() & 0x7F) + -128; - spark->sG = (spark->dR >> 1) + (GetRandomControl() & 0x7F); + spark->sG = (spark->dR / 2) + (GetRandomControl() & 0x7F); if (spark->sG > spark->sR) spark->sG = spark->sR; spark->sB = 0; diff --git a/TR5Main/Objects/TR5/Entity/tr5_hydra.cpp b/TR5Main/Objects/TR5/Entity/tr5_hydra.cpp index cee4d6671..45a8bc95c 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_hydra.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_hydra.cpp @@ -72,10 +72,10 @@ void TriggerHydraMissileSparks(PHD_VECTOR* pos, short xv, short yv, short zv) spark->on = true; spark->sB = 0; spark->sR = (GetRandomControl() & 0x3F) - 96; - spark->sG = spark->sR >> 1; + spark->sG = spark->sR / 2; spark->dB = 0; spark->dR = (GetRandomControl() & 0x3F) - 96; - spark->dG = spark->dR >> 1; + spark->dG = spark->dR / 2; spark->fadeToBlack = 8; spark->colFadeSpeed = (GetRandomControl() & 3) + 8; spark->transType = COLADD; @@ -115,11 +115,11 @@ static void TriggerHydraSparks(short itemNumber, int frame) spark->dB = 0; if (frame < 16) { - spark->sR = frame * spark->sR >> 4; - spark->dR = frame * spark->dR >> 4; + spark->sR = frame * spark->sR / 16; + spark->dR = frame * spark->dR / 16; } - spark->sG = spark->sR >> 1; - spark->dG = spark->dR >> 1; + spark->sG = spark->sR / 2; + spark->dG = spark->dR / 2; spark->fadeToBlack = 4; spark->colFadeSpeed = (GetRandomControl() & 3) + 8; spark->transType = COLADD; @@ -141,7 +141,7 @@ static void TriggerHydraSparks(short itemNumber, int frame) spark->gravity = -8 - (GetRandomControl() & 7); spark->scalar = 0; spark->dSize = 4; - spark->sSize = spark->size = frame * ((GetRandomControl() & 0xF) + 16) >> 4; + spark->sSize = spark->size = (frame * ((GetRandomControl() & 0xF) + 16)) / 16; } void HydraControl(short itemNumber) @@ -203,8 +203,8 @@ void HydraControl(short itemNumber) if (item->currentAnimState != 12) { - joint1 = info.angle >> 1; - joint3 = info.angle >> 1; + joint1 = info.angle / 2; + joint3 = info.angle / 2; joint2 = -info.xAngle; } @@ -316,7 +316,7 @@ void HydraControl(short itemNumber) if (!(GlobalCounter & 3)) { - frame = ((g_Level.Anims[item->animNumber].frameBase - item->frameNumber) >> 3) + 1; + frame = ((g_Level.Anims[item->animNumber].frameBase - item->frameNumber) / 8) + 1; if (frame > 16) frame = 16; TriggerHydraSparks(itemNumber, frame); diff --git a/TR5Main/Objects/TR5/Entity/tr5_imp.cpp b/TR5Main/Objects/TR5/Entity/tr5_imp.cpp index 600567977..6a6af1fd2 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_imp.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_imp.cpp @@ -78,8 +78,8 @@ static void ImpThrowStones(ITEM_INFO* item) if (distance < 8) distance = 8; - angles[0] += GetRandomControl() % (distance >> 2) - (distance >> 3); - angles[1] += GetRandomControl() % (distance >> 1) - (distance >> 2); + angles[0] += GetRandomControl() % (distance / 4) - (distance / 8); + angles[1] += GetRandomControl() % (distance / 2) - (distance / 4); short fxNum = CreateNewEffect(item->roomNumber); if (fxNum != NO_ITEM) @@ -89,7 +89,7 @@ static void ImpThrowStones(ITEM_INFO* item) fx->pos.yPos = pos1.y; fx->pos.zPos = pos1.z; fx->roomNumber = item->roomNumber; - fx->pos.xRot = angles[1] + distance >> 1; + fx->pos.xRot = (angles[1] + distance) / 2; fx->pos.yRot = angles[0]; fx->pos.zRot = 0; fx->speed = 4 * sqrt(distance); @@ -166,10 +166,10 @@ void ImpControl(short itemNumber) CreatureMood(item, &info, VIOLENT); angle = CreatureTurn(item, creature->maximumTurn); - joint1 = info.angle >> 1; - joint0 = info.xAngle >> 1; - joint3 = info.angle >> 1; - joint2 = info.xAngle >> 1; + joint1 = info.angle / 2; + joint0 = info.xAngle / 2; + joint3 = info.angle / 2; + joint2 = info.xAngle / 2; if (Wibble & 0x10) item->swapMeshFlags = 1024; diff --git a/TR5Main/Objects/TR5/Entity/tr5_lagoon_witch.cpp b/TR5Main/Objects/TR5/Entity/tr5_lagoon_witch.cpp index 2c65eac83..4cf435315 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_lagoon_witch.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_lagoon_witch.cpp @@ -88,8 +88,8 @@ void LagoonWitchControl(short itemNumber) if (info.ahead) { - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; joint1 = info.xAngle; } diff --git a/TR5Main/Objects/TR5/Entity/tr5_larson.cpp b/TR5Main/Objects/TR5/Entity/tr5_larson.cpp index ce0e72cf4..413e4d2d8 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_larson.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_larson.cpp @@ -159,8 +159,8 @@ void LarsonControl(short itemNumber) switch (item->currentAnimState) { case STATE_TR5_LARSON_STOP: - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; if (info.ahead) joint1 = info.xAngle; @@ -278,8 +278,8 @@ void LarsonControl(short itemNumber) break; case STATE_TR5_LARSON_AIM: - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; if (info.ahead) joint1 = info.xAngle; creature->maximumTurn = 0; @@ -302,8 +302,8 @@ void LarsonControl(short itemNumber) break; case STATE_TR5_LARSON_IDLE: - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; if (info.ahead) joint1 = info.xAngle; @@ -322,8 +322,8 @@ void LarsonControl(short itemNumber) break; case STATE_TR5_LARSON_ATTACK: - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; if (info.ahead) joint1 = info.xAngle; creature->maximumTurn = 0; diff --git a/TR5Main/Objects/TR5/Entity/tr5_laser_head.cpp b/TR5Main/Objects/TR5/Entity/tr5_laser_head.cpp index b0ee038fc..6493fcd3a 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_laser_head.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_laser_head.cpp @@ -65,7 +65,7 @@ static void TriggerLaserHeadSparks(PHD_VECTOR* pos, int count, byte r, byte g, b spark->x = pos->x; spark->y = pos->y; spark->z = pos->z; - spark->gravity = (GetRandomControl() >> 7) & 0x1F; + spark->gravity = (GetRandomControl() / 128) & 0x1F; spark->yVel = ((GetRandomControl() & 0xFFF) - 2048) << unk; spark->xVel = ((GetRandomControl() & 0xFFF) - 2048) << unk; spark->zVel = ((GetRandomControl() & 0xFFF) - 2048) << unk; @@ -84,8 +84,8 @@ static void LaserHeadCharge(ITEM_INFO* item) if (item->itemFlags[3] <= 32) { - g = item->itemFlags[3] * g >> 5; - b = item->itemFlags[3] * b >> 5; + g = (item->itemFlags[3] * g) / 32; + b = (item->itemFlags[3] * b) / 32; } else { @@ -331,7 +331,7 @@ void LaserHeadControl(short itemNumber) if (item->itemFlags[3] <= 0 || condition) { - short xRot = (GetRandomControl() >> 2) - 4096; + short xRot = (GetRandomControl() / 4) - 4096; short yRot; if (condition) yRot = item->pos.yRot + (GetRandomControl() & 0x3FFF) + ANGLE(135); @@ -458,7 +458,7 @@ void LaserHeadControl(short itemNumber) && arc && arc->life < 16) { - g = b = arc->life * g >> 4; + g = b = (arc->life * g) / 16; } for (int i = 0, j = 0; i < 5; i += 4, j++) @@ -546,9 +546,9 @@ void LaserHeadControl(short itemNumber) dest.z = src.z + dl * (dest.z - src.z) / 8192; } - int dx = (dest.x - src.x) >> 5; - int dy = (dest.y - src.y) >> 5; - int dz = (dest.z - src.z) >> 5; + int dx = (dest.x - src.x) / 32; + int dy = (dest.y - src.y) / 32; + int dz = (dest.z - src.z) / 32; int adx = currentArc->pos4.x - src.z; int ady = currentArc->pos4.y - src.y; diff --git a/TR5Main/Objects/TR5/Entity/tr5_roman_statue.cpp b/TR5Main/Objects/TR5/Entity/tr5_roman_statue.cpp index f3891a723..c6b5e06e0 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_roman_statue.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_roman_statue.cpp @@ -141,12 +141,12 @@ static void TriggerRomanStatueScreamingSparks(int x, int y, int z, short xv, sho if (flags) { spark->dG = (GetRandomControl() & 0x3F) - 64; - spark->dB = spark->dG >> 1; + spark->dB = spark->dG / 2; } else { spark->dB = (GetRandomControl() & 0x3F) - 64; - spark->dG = spark->dB >> 1; + spark->dG = spark->dB / 2; } spark->colFadeSpeed = 4; spark->fadeToBlack = 4; @@ -176,11 +176,11 @@ static void TriggerRomanStatueAttackEffect1(short itemNum, int factor) spark->dR = 0; if (factor < 16) { - spark->sB = factor * spark->sB >> 4; - spark->dB = factor * spark->dB >> 4; + spark->sB = (factor * spark->sB) / 16; + spark->dB = (factor * spark->dB) / 16; } - spark->sG = spark->sB >> 1; - spark->dG = spark->dB >> 1; + spark->sG = spark->sB / 2; + spark->dG = spark->dB / 2; spark->fadeToBlack = 4; spark->colFadeSpeed = (GetRandomControl() & 3) + 8; spark->transType = COLADD; @@ -202,7 +202,7 @@ static void TriggerRomanStatueAttackEffect1(short itemNum, int factor) spark->gravity = -8 - (GetRandomControl() & 7); spark->scalar = 2; spark->dSize = 4; - spark->sSize = spark->size = factor * ((GetRandomControl() & 0x1F) + 64) >> 4; + spark->sSize = (spark->size = factor * ((GetRandomControl() & 0x1F) + 64)) / 16; } static void RomanStatueAttack(PHD_3DPOS* pos, short roomNumber, short count) @@ -235,10 +235,10 @@ void TriggerRomanStatueMissileSparks(PHD_VECTOR* pos, char fxObj) spark->on = 1; spark->sR = 0; spark->sG = (GetRandomControl() & 0x3F) - 96; - spark->sB = spark->sG >> 1; + spark->sB = spark->sG / 2; spark->dR = 0; spark->dG = (GetRandomControl() & 0x3F) - 96; - spark->dB = spark->dG >> 1; + spark->dB = spark->dG / 2; spark->fadeToBlack = 8; spark->colFadeSpeed = (GetRandomControl() & 3) + 8; spark->transType = COLADD; @@ -344,8 +344,8 @@ void RomanStatueControl(short itemNumber) if (info.ahead) { - joint0 = info.angle >> 1; - joint2 = info.angle >> 1; + joint0 = info.angle / 2; + joint2 = info.angle / 2; joint1 = info.xAngle; } @@ -449,9 +449,9 @@ void RomanStatueControl(short itemNumber) pos2.z = 490; GetJointAbsPosition(item, &pos2, 14); - pos.x = (pos1.x + pos2.x) >> 1; - pos.y = (pos1.y + pos2.y) >> 1; - pos.z = (pos1.z + pos2.z) >> 1; + pos.x = (pos1.x + pos2.x) / 2; + pos.y = (pos1.y + pos2.y) / 2; + pos.z = (pos1.z + pos2.z) / 2; deltaFrame = item->frameNumber - g_Level.Anims[item->animNumber].frameBase; @@ -468,12 +468,12 @@ void RomanStatueControl(short itemNumber) deltaFrame2 = 4 * (62 - deltaFrame); } - color = deltaFrame2 * ((GetRandomControl() & 0x3F) + 128) >> 4; + color = (deltaFrame2 * ((GetRandomControl() & 0x3F) + 128)) / 16; if (item->triggerFlags) - TriggerDynamicLight(pos.x, pos.y, pos.z, 16, 0, color, color >> 1); + TriggerDynamicLight(pos.x, pos.y, pos.z, 16, 0, color, color / 2); else - TriggerDynamicLight(pos.x, pos.y, pos.z, 16, 0, color >> 1, color); + TriggerDynamicLight(pos.x, pos.y, pos.z, 16, 0, color / 2, color); for (int i = 0; i < 2; i++) { @@ -529,9 +529,9 @@ void RomanStatueControl(short itemNumber) arc->pos4.z = pos2.z; if (item->triggerFlags) - TriggerLightningGlow(pos1.x, pos1.y, pos1.z, 16, 0, color, color >> 1); + TriggerLightningGlow(pos1.x, pos1.y, pos1.z, 16, 0, color, color / 2); else - TriggerLightningGlow(pos1.x, pos1.y, pos1.z, 16, 0, color >> 1, color); + TriggerLightningGlow(pos1.x, pos1.y, pos1.z, 16, 0, color / 2, color); continue; } @@ -553,7 +553,7 @@ void RomanStatueControl(short itemNumber) 48, 5);*/ - TriggerLightningGlow(pos.x, pos.y, pos.z, 16, 0, color, color >> 1); + TriggerLightningGlow(pos.x, pos.y, pos.z, 16, 0, color, color / 2); unk = 1; continue; } @@ -567,7 +567,7 @@ void RomanStatueControl(short itemNumber) 48, 5);*/ - TriggerLightningGlow(pos.x, pos.y, pos.z, 16, 0, color >> 1, color); + TriggerLightningGlow(pos.x, pos.y, pos.z, 16, 0, color / 2, color); unk = 1; } @@ -752,8 +752,8 @@ void RomanStatueControl(short itemNumber) if (RomanStatueData.counter) { RomanStatueData.counter--; - color = RomanStatueData.counter * ((GetRandomControl() & 0x3F) + 128) >> 4; - TriggerDynamicLight(RomanStatueData.pos.x, RomanStatueData.pos.y, RomanStatueData.pos.z, 16, 0, color, color >> 1); + color = (RomanStatueData.counter * ((GetRandomControl() & 0x3F) + 128)) / 16; + TriggerDynamicLight(RomanStatueData.pos.x, RomanStatueData.pos.y, RomanStatueData.pos.z, 16, 0, color, color / 2); } deltaFrame = item->frameNumber - g_Level.Anims[item->animNumber].frameBase; @@ -789,7 +789,7 @@ void RomanStatueControl(short itemNumber) attackPos.yPos, attackPos.zPos, 0, - (((GetRandomControl() & 0x3F) + 128) >> 1), + (((GetRandomControl() & 0x3F) + 128) / 2), (((GetRandomControl() & 0x3F) + 128)), 64); @@ -821,9 +821,9 @@ void RomanStatueControl(short itemNumber) for (i = 0; i < 4; i++) { - r = deltaFrame * ((GetRandomControl() & 0x3F) + 128) >> 5; - g = deltaFrame * ((GetRandomControl() & 0x3F) + 128) >> 4; - b = deltaFrame * ((GetRandomControl() & 0x3F) + 128) >> 5; + r = (deltaFrame * ((GetRandomControl() & 0x3F) + 128)) / 32; + g = (deltaFrame * ((GetRandomControl() & 0x3F) + 128)) / 16; + b = (deltaFrame * ((GetRandomControl() & 0x3F) + 128)) / 32; if (i == 0) { @@ -833,8 +833,8 @@ void RomanStatueControl(short itemNumber) pos2.z, 8, 0, - deltaFrame * ((GetRandomControl() & 0x3F) + 128) >> 5, - deltaFrame * ((GetRandomControl() & 0x3F) + 128) >> 6); + (deltaFrame * ((GetRandomControl() & 0x3F) + 128)) / 32, + (deltaFrame * ((GetRandomControl() & 0x3F) + 128)) / 64); } arc = RomanStatueData.energyArcs[i]; @@ -861,7 +861,7 @@ void RomanStatueControl(short itemNumber) if (deltaFrame == 24) { TriggerEnergyArc(&pos1, &pos2, 0, ((GetRandomControl() & 0x3F) + 128), - (((GetRandomControl() & 0x3F) + 128) >> 1), 256, 32, 32, ENERGY_ARC_NO_RANDOMIZE, + (((GetRandomControl() & 0x3F) + 128) / 2), 256, 32, 32, ENERGY_ARC_NO_RANDOMIZE, ENERGY_ARC_STRAIGHT_LINE); } } diff --git a/TR5Main/Objects/TR5/Entity/tr5_submarine.cpp b/TR5Main/Objects/TR5/Entity/tr5_submarine.cpp index 3800f7b9f..cc6332c0e 100644 --- a/TR5Main/Objects/TR5/Entity/tr5_submarine.cpp +++ b/TR5Main/Objects/TR5/Entity/tr5_submarine.cpp @@ -26,8 +26,8 @@ static void TriggerSubmarineSparks(short itemNumber) spark->colFadeSpeed = 2; spark->dG = (GetRandomControl() & 0x1F) - 32; spark->life = 2; - spark->dR = spark->dG >> 1; - spark->dB = spark->dG >> 1; + spark->dR = spark->dG / 2; + spark->dB = spark->dG / 2; spark->sLife = 2; spark->transType = COLADD; spark->fadeToBlack = 0; @@ -212,7 +212,7 @@ void SubmarineControl(short itemNumber) laraInfo.ahead = true; } - int tilt = item->itemFlags[0] + (angle >> 1); + int tilt = item->itemFlags[0] + (angle / 2); if (tilt > 2048) { @@ -372,8 +372,8 @@ void SubmarineControl(short itemNumber) if (distance < 16384) { distance = 16384 - distance; - byte color = (GetRandomControl() & 0xF) + (distance >> 7) + 64; - TriggerDynamicLight(pos2.x, pos2.y, pos2.z, (GetRandomControl() & 1) + (distance >> 11) + 12, color >> 1, color, color >> 1); + byte color = (GetRandomControl() & 0xF) + (distance / 128) + 64; + TriggerDynamicLight(pos2.x, pos2.y, pos2.z, (GetRandomControl() & 1) + (distance / 2048) + 12, color / 2, color, color / 2); } } @@ -411,8 +411,8 @@ void ChaffFlareControl(short itemNumber) if (g_Level.Rooms[item->roomNumber].flags & ENV_FLAG_WATER) { - item->fallspeed += (5 - item->fallspeed) >> 1; - item->speed += (5 - item->speed) >> 1; + item->fallspeed += (5 - item->fallspeed) / 2; + item->speed += (5 - item->speed) / 2; } else { @@ -499,9 +499,9 @@ void TorpedoControl(short itemNumber) pos.x = chaffItem->pos.xPos; pos.y = chaffItem->pos.yPos; pos.z = chaffItem->pos.zPos; - item->currentAnimState = pos.x >> 2; - item->goalAnimState = pos.y >> 2; - item->requiredAnimState = pos.z >> 2; + item->currentAnimState = pos.x / 4; + item->goalAnimState = pos.y / 4; + item->requiredAnimState = pos.z / 4; } else { @@ -536,8 +536,8 @@ void TorpedoControl(short itemNumber) if (abs(drx) > 0x8000) drx = -drx; - drx >>= 3; - dry >>= 3; + drx /= 8; + dry /= 8; if (drx <= 512) { diff --git a/TR5Main/Objects/TR5/Light/tr5_light.cpp b/TR5Main/Objects/TR5/Light/tr5_light.cpp index e80c9a6d2..7128cff34 100644 --- a/TR5Main/Objects/TR5/Light/tr5_light.cpp +++ b/TR5Main/Objects/TR5/Light/tr5_light.cpp @@ -26,9 +26,9 @@ void PulseLightControl(short itemNumber) item->pos.yPos, item->pos.zPos, 24, - pulse * 8 * (item->triggerFlags & 0x1F) >> 9, - pulse * ((item->triggerFlags >> 2) & 0xF8) >> 9, - pulse * ((item->triggerFlags >> 7) & 0xF8) >> 9); + (pulse * 8 * (item->triggerFlags & 0x1F)) / 512, + (pulse * ((item->triggerFlags / 4) & 0xF8)) / 512, + (pulse * ((item->triggerFlags / 128) & 0xF8)) / 512); } } @@ -57,15 +57,15 @@ void StrobeLightControl(short itemNumber) item->pos.yRot += ANGLE(16.0f); byte r = 8 * (item->triggerFlags & 0x1F); - byte g = (item->triggerFlags >> 2) & 0xF8; - byte b = (item->triggerFlags >> 7) & 0xF8; + byte g = (item->triggerFlags / 4) & 0xF8; + byte b = (item->triggerFlags / 128) & 0xF8; TriggerAlertLight( item->pos.xPos, item->pos.yPos - 512, item->pos.zPos, r, g, b, - ((item->pos.yRot + 22528) >> 4) & 0xFFF, + ((item->pos.yRot + 22528) / 16) & 0xFFF, item->roomNumber, 12); @@ -90,8 +90,8 @@ void ColorLightControl(short itemNumber) item->pos.zPos, 24, 8 * (item->triggerFlags & 0x1F), - (item->triggerFlags >> 2) & 0xF8, - (item->triggerFlags >> 7) & 0xF8); + (item->triggerFlags / 4) & 0xF8, + (item->triggerFlags / 128) & 0xF8); } } @@ -177,9 +177,9 @@ void ElectricalLightControl(short itemNumber) item->pos.yPos, item->pos.zPos, 24, - intensity * 8 * (item->triggerFlags & 0x1F) >> 8, - intensity * ((item->triggerFlags >> 2) & 0xF8) >> 8, - intensity * ((item->triggerFlags >> 7) & 0xF8) >> 8); + (intensity * 8 * (item->triggerFlags & 0x1F)) / 256, + (intensity * ((item->triggerFlags / 4) & 0xF8)) / 256, + (intensity * ((item->triggerFlags / 128) & 0xF8)) / 256); } void BlinkingLightControl(short itemNumber) @@ -208,8 +208,8 @@ void BlinkingLightControl(short itemNumber) pos.z, 16, 8 * (item->triggerFlags & 0x1F), - (item->triggerFlags >> 2) & 0xF8, - (item->triggerFlags >> 7) & 0xF8); + (item->triggerFlags / 4) & 0xF8, + (item->triggerFlags / 128) & 0xF8); item->meshBits = 2; diff --git a/TR5Main/Objects/TR5/Object/tr5_bodypart.cpp b/TR5Main/Objects/TR5/Object/tr5_bodypart.cpp index 98ce59a1e..a9022fec1 100644 --- a/TR5Main/Objects/TR5/Object/tr5_bodypart.cpp +++ b/TR5Main/Objects/TR5/Object/tr5_bodypart.cpp @@ -48,7 +48,7 @@ void ControlBodyPart(short fxNumber) { fx->pos.yPos = ceiling; fx->fallspeed = -fx->fallspeed; - fx->speed -= (fx->speed >> 3); + fx->speed -= (fx->speed / 8); } int height = GetFloorHeight(floor, fx->pos.xPos, fx->pos.yPos, fx->pos.zPos); @@ -76,7 +76,7 @@ void ControlBodyPart(short fxNumber) if (fx->fallspeed <= 32) fx->fallspeed = 0; else - fx->fallspeed = -fx->fallspeed >> 2; + fx->fallspeed = -fx->fallspeed / 4; } else { @@ -85,7 +85,7 @@ void ControlBodyPart(short fxNumber) fx->pos.zPos = z; } - fx->speed -= (fx->speed >> 2); + fx->speed -= (fx->speed / 4); if (abs(fx->speed) < 4) fx->speed = 0; fx->pos.yPos = y; diff --git a/TR5Main/Objects/TR5/Object/tr5_highobject.cpp b/TR5Main/Objects/TR5/Object/tr5_highobject.cpp index 75b0b4da7..037fb8675 100644 --- a/TR5Main/Objects/TR5/Object/tr5_highobject.cpp +++ b/TR5Main/Objects/TR5/Object/tr5_highobject.cpp @@ -23,7 +23,7 @@ void InitialiseHighObject1(short itemNumber) { if (currentItem->objectNumber == ID_PUZZLE_ITEM4_COMBO2) { - item->itemFlags[3] |= (i << 8); + item->itemFlags[3] |= (i * 256); currentItem->pos.yPos = item->pos.yPos - 512; continue; } @@ -39,7 +39,7 @@ void InitialiseHighObject1(short itemNumber) { if (currentItem->objectNumber == ID_PUZZLE_ITEM4_COMBO2) { - item->itemFlags[3] |= (i << 8); + item->itemFlags[3] |= (i * 256); currentItem->pos.yPos = item->pos.yPos - 512; continue; } @@ -102,18 +102,18 @@ void ControlHighObject1(short itemNumber) if (item->itemFlags[1] <= 512) flags = 31; else - flags = (768 - item->itemFlags[1]) >> 3; + flags = (768 - item->itemFlags[1]) / 8; } else { - flags = item->itemFlags[1] >> 3; + flags = item->itemFlags[1] / 8; } - SoundEffect(SFX_BLK_PLAT_RAISE_LOW, &item->pos, (flags << 8) | 8); + SoundEffect(SFX_BLK_PLAT_RAISE_LOW, &item->pos, (flags * 256) | 8); item->pos.yPos += 8; - ITEM_INFO* targetItem = &g_Level.Items[(item->itemFlags[3] >> 8) & 0xFF]; + ITEM_INFO* targetItem = &g_Level.Items[(item->itemFlags[3] / 256) & 0xFF]; targetItem->flags |= 0x20u; targetItem->pos.yPos = item->pos.yPos - 560; } @@ -142,7 +142,7 @@ void ControlHighObject1(short itemNumber) item->itemFlags[0] = 5; item->itemFlags[1] = 0; } - else if (item->itemFlags[0] == 5 && !item->itemFlags[1] && g_Level.Items[(item->itemFlags[3] >> 8) & 0xFF].flags < 0) + else if (item->itemFlags[0] == 5 && !item->itemFlags[1] && g_Level.Items[(item->itemFlags[3] / 256) & 0xFF].flags < 0) { DoFlipMap(3); FlipMap[3] ^= 0x3E00u; @@ -201,12 +201,12 @@ void ControlHighObject1(short itemNumber) flags = item->itemFlags[1]; } - SoundEffect(SFX_BLK_PLAT_RAISE_LOW, &item->pos, (flags << 8) | 8); + SoundEffect(SFX_BLK_PLAT_RAISE_LOW, &item->pos, (flags * 256) | 8); item->itemFlags[1] += 16; item->pos.yPos -= 16; - short targetItemNumber = (item->itemFlags[3] >> 8) & 0xFF; + short targetItemNumber = (item->itemFlags[3] / 256) & 0xFF; ITEM_INFO* targetItem = &g_Level.Items[targetItemNumber]; targetItem->flags |= 0x20; targetItem->pos.yPos = item->pos.yPos - 560; diff --git a/TR5Main/Objects/TR5/Object/tr5_missile.cpp b/TR5Main/Objects/TR5/Object/tr5_missile.cpp index 85917c17a..837030980 100644 --- a/TR5Main/Objects/TR5/Object/tr5_missile.cpp +++ b/TR5Main/Objects/TR5/Object/tr5_missile.cpp @@ -64,12 +64,12 @@ void MissileControl(short itemNumber) int dy = angles[0] - fx->pos.yRot; if (abs(dy) > 0x8000) dy = -dy; - dy >>= 3; + dy /= 8; int dx = angles[1] - fx->pos.xRot; if (abs(dx) > 0x8000) dx = -dx; - dx >>= 3; + dx /= 8; if (dy <= dh) { diff --git a/TR5Main/Objects/TR5/Object/tr5_rollingball.cpp b/TR5Main/Objects/TR5/Object/tr5_rollingball.cpp index 33117f5a8..d76490f31 100644 --- a/TR5Main/Objects/TR5/Object/tr5_rollingball.cpp +++ b/TR5Main/Objects/TR5/Object/tr5_rollingball.cpp @@ -39,9 +39,9 @@ void RollingBallControl(short itemNumber) return; item->fallspeed += GRAVITY; - item->pos.xPos += item->itemFlags[0] >> 5; + item->pos.xPos += item->itemFlags[0] / 32; item->pos.yPos += item->fallspeed; - item->pos.zPos += item->itemFlags[1] >> 5; + item->pos.zPos += item->itemFlags[1] / 32; short roomNumber = item->roomNumber; FLOOR_INFO* floor = GetFloor(item->pos.xPos, item->pos.yPos, item->pos.zPos, &roomNumber); @@ -58,7 +58,7 @@ void RollingBallControl(short itemNumber) SQUARE(Camera.pos.z - item->pos.zPos)); if (distance < 16384) - Camera.bounce = -((16384 - distance) * abs(item->fallspeed) >> 14); + Camera.bounce = -(((16384 - distance) * abs(item->fallspeed)) / 16384); } if (item->pos.yPos - dh < 512) @@ -69,11 +69,11 @@ void RollingBallControl(short itemNumber) if (abs(item->speed) <= 512 || GetRandomControl() & 0x1F) item->fallspeed = 0; else - item->fallspeed = -(short)(GetRandomControl() % (item->speed >> 3)); + item->fallspeed = -(short)(GetRandomControl() % (item->speed / 8)); } else { - item->fallspeed = -(short)(item->fallspeed >> 2); + item->fallspeed = -(short)(item->fallspeed / 4); } } @@ -126,7 +126,7 @@ void RollingBallControl(short itemNumber) } else { - item->itemFlags[1] = -item->itemFlags[1] >> 1; + item->itemFlags[1] = -item->itemFlags[1] / 2; item->pos.zPos = (item->pos.zPos & -512) + 512; } } @@ -136,7 +136,7 @@ void RollingBallControl(short itemNumber) } else { - item->itemFlags[1] += (y1a - dh) >> 1; + item->itemFlags[1] += (y1a - dh) / 2; } } @@ -153,7 +153,7 @@ void RollingBallControl(short itemNumber) } else { - item->itemFlags[1] = -item->itemFlags[1] >> 1; + item->itemFlags[1] = -item->itemFlags[1] / 2; item->pos.zPos = (item->pos.zPos & -512) + 512; } } @@ -163,7 +163,7 @@ void RollingBallControl(short itemNumber) } else { - item->itemFlags[1] -= (y2a - dh) >> 1; + item->itemFlags[1] -= (y2a - dh) / 2; } } @@ -172,7 +172,7 @@ void RollingBallControl(short itemNumber) if (abs(item->itemFlags[1]) <= 64) item->itemFlags[1] = 0; else - item->itemFlags[1] = item->itemFlags[1] - (item->itemFlags[1] >> 6); + item->itemFlags[1] = item->itemFlags[1] - (item->itemFlags[1] / 64); } int counterX = 0; @@ -190,7 +190,7 @@ void RollingBallControl(short itemNumber) } else { - item->itemFlags[0] = -item->itemFlags[0] >> 1; + item->itemFlags[0] = -item->itemFlags[0] / 2; item->pos.xPos = (item->pos.xPos & -512) + 512; } } @@ -200,7 +200,7 @@ void RollingBallControl(short itemNumber) } else { - item->itemFlags[0] -= (y4a - dh) >> 1; + item->itemFlags[0] -= (y4a - dh) / 2; } } @@ -217,7 +217,7 @@ void RollingBallControl(short itemNumber) } else { - item->itemFlags[0] = -item->itemFlags[0] >> 1; + item->itemFlags[0] = -item->itemFlags[0] / 2; item->pos.xPos = (item->pos.xPos & -512) + 512; } } @@ -227,7 +227,7 @@ void RollingBallControl(short itemNumber) } else { - item->itemFlags[0] += (y3a - dh) >> 1; + item->itemFlags[0] += (y3a - dh) / 2; } } @@ -236,7 +236,7 @@ void RollingBallControl(short itemNumber) if (abs(item->itemFlags[0]) <= 64) item->itemFlags[0] = 0; else - item->itemFlags[0] = item->itemFlags[0] - (item->itemFlags[0] >> 6); + item->itemFlags[0] = item->itemFlags[0] - (item->itemFlags[0] / 64); } } @@ -287,7 +287,7 @@ void RollingBallControl(short itemNumber) } } - item->pos.xRot -= (abs(item->itemFlags[0]) + abs(item->itemFlags[1])) >> 1; + item->pos.xRot -= (abs(item->itemFlags[0]) + abs(item->itemFlags[1])) / 2; roomNumber = item->roomNumber; floor = GetFloor(item->pos.xPos, item->pos.yPos, item->pos.zPos, &roomNumber); diff --git a/TR5Main/Objects/TR5/Shatter/tr5_smashobject.cpp b/TR5Main/Objects/TR5/Shatter/tr5_smashobject.cpp index c2466191c..946320fbf 100644 --- a/TR5Main/Objects/TR5/Shatter/tr5_smashobject.cpp +++ b/TR5Main/Objects/TR5/Shatter/tr5_smashobject.cpp @@ -24,7 +24,7 @@ void SmashObject(short itemNumber) { ITEM_INFO* item = &g_Level.Items[itemNumber]; ROOM_INFO* r = &g_Level.Rooms[item->roomNumber]; - int sector = ((item->pos.zPos - r->z) >> 10) + r->xSize * ((item->pos.xPos - r->x) >> 10); + int sector = ((item->pos.zPos - r->z) / 1024) + r->xSize * ((item->pos.xPos - r->x) / 1024); BOX_INFO* box = &g_Level.Boxes[r->floor[sector].box]; if (box->flags & 0x8000) @@ -46,5 +46,5 @@ void SmashObject(short itemNumber) void SmashObjectControl(short itemNumber) { - SmashObject(itemNumber << 16); + SmashObject(itemNumber * 65536); } \ No newline at end of file diff --git a/TR5Main/Objects/TR5/Switch/tr5_raisingcog.cpp b/TR5Main/Objects/TR5/Switch/tr5_raisingcog.cpp index 5821f8b57..9633d30ad 100644 --- a/TR5Main/Objects/TR5/Switch/tr5_raisingcog.cpp +++ b/TR5Main/Objects/TR5/Switch/tr5_raisingcog.cpp @@ -111,7 +111,7 @@ void RaisingCogControl(short itemNumber) flags = item->itemFlags[2]; } - SoundEffect(SFX_BLK_PLAT_RAISE_LOW, &item->pos, (flags << 8) | 8); + SoundEffect(SFX_BLK_PLAT_RAISE_LOW, &item->pos, (flags * 256) | 8); item->itemFlags[2] += 2; item->pos.yPos -= 2; diff --git a/TR5Main/Objects/TR5/Trap/tr5_deathslide.cpp b/TR5Main/Objects/TR5/Trap/tr5_deathslide.cpp index a7488e517..d1f507d3e 100644 --- a/TR5Main/Objects/TR5/Trap/tr5_deathslide.cpp +++ b/TR5Main/Objects/TR5/Trap/tr5_deathslide.cpp @@ -90,7 +90,7 @@ void ControlDeathSlide(short itemNumber) item->pos.zPos += item->fallspeed * c; item->pos.xPos += item->fallspeed * s; - item->pos.yPos += item->fallspeed >> 2; + item->pos.yPos += item->fallspeed / 4; short roomNumber = item->roomNumber; GetFloor(item->pos.xPos, item->pos.yPos, item->pos.zPos, &roomNumber); @@ -118,7 +118,7 @@ void ControlDeathSlide(short itemNumber) AnimateLara(LaraItem); LaraItem->gravityStatus = true; LaraItem->speed = item->fallspeed; - LaraItem->fallspeed = item->fallspeed >> 2; + LaraItem->fallspeed = item->fallspeed / 4; } // TODO: sounds diff --git a/TR5Main/Objects/TR5/Trap/tr5_teethspike.cpp b/TR5Main/Objects/TR5/Trap/tr5_teethspike.cpp index 09a544a96..28af33f10 100644 --- a/TR5Main/Objects/TR5/Trap/tr5_teethspike.cpp +++ b/TR5Main/Objects/TR5/Trap/tr5_teethspike.cpp @@ -108,7 +108,7 @@ void ControlTeethSpikes(short itemNumber) if (TriggerActive(item)) { item->itemFlags[1] -= item->itemFlags[0]; - item->itemFlags[0] += (item->itemFlags[0] >> 3) + 32; + item->itemFlags[0] += (item->itemFlags[0] / 8) + 32; if (item->itemFlags[1] < 0) { @@ -131,7 +131,7 @@ void ControlTeethSpikes(short itemNumber) } else if (!item->timer) { - item->itemFlags[0] += (item->itemFlags[0] >> 3) + 32; + item->itemFlags[0] += (item->itemFlags[0] / 8) + 32; if (item->itemFlags[1] > 0) { @@ -247,7 +247,7 @@ void ControlTeethSpikes(short itemNumber) } else { - item->itemFlags[0] = -item->itemFlags[0] >> 1; + item->itemFlags[0] = -item->itemFlags[0] / 2; } } } diff --git a/TR5Main/Objects/TR5/Trap/tr5_ventilator.cpp b/TR5Main/Objects/TR5/Trap/tr5_ventilator.cpp index 3b3934bb2..65aa532a6 100644 --- a/TR5Main/Objects/TR5/Trap/tr5_ventilator.cpp +++ b/TR5Main/Objects/TR5/Trap/tr5_ventilator.cpp @@ -54,10 +54,10 @@ static void VentilatorEffect(BOUNDING_BOX* bounds, int intensity, short rot, int spark->sR = 0; spark->sG = 0; spark->sB = 0; - spark->dR = spark->dG = 48 * speed >> 7; + spark->dR = spark->dG = (48 * speed) / 128; spark->colFadeSpeed = 4; spark->fadeToBlack = 8; - spark->dB = speed * ((GetRandomControl() & 8) + 48) >> 7; + spark->dB = (speed * ((GetRandomControl() & 8) + 48)) / 128; spark->transType = COLADD; spark->life = spark->sLife = (GetRandomControl() & 3) + 20; @@ -114,9 +114,9 @@ static void VentilatorEffect(BOUNDING_BOX* bounds, int intensity, short rot, int } spark->friction = 85; - spark->xVel = speed * spark->xVel >> 7; - spark->yVel = speed * spark->yVel >> 7; - spark->zVel = speed * spark->zVel >> 7; + spark->xVel = (speed * spark->xVel) / 128; + spark->yVel = (speed * spark->yVel) / 128; + spark->zVel = (speed * spark->zVel) / 128; spark->maxYvel = 0; spark->gravity = 0; spark->flags = SP_NONE;