diff --git a/TR5Main/Game/Lara/lara.cpp b/TR5Main/Game/Lara/lara.cpp index f2fe44353..7b94ac335 100644 --- a/TR5Main/Game/Lara/lara.cpp +++ b/TR5Main/Game/Lara/lara.cpp @@ -756,14 +756,6 @@ void LaraControl(short itemNumber) } } } - else if (Lara.gassed) - { - if (item->hitPoints >= 0 && --Lara.air < 0) - { - Lara.air = -1; - item->hitPoints -= 5; - } - } else if (Lara.air < 1800 && item->hitPoints >= 0) { if (Lara.Vehicle == NO_ITEM) // only for the upv !! @@ -924,7 +916,7 @@ void LaraAboveWater(ITEM_INFO* item, COLL_INFO* coll) //hmmmm lara_collision_routines[item->currentAnimState](item, coll); } - UpdateLaraRoom(item, -LARA_HITE / 2); + UpdateLaraRoom(item, -LARA_HEIGHT / 2); //if (Lara.gunType == WEAPON_CROSSBOW && !LaserSight) // TrInput &= ~IN_ACTION; @@ -1164,7 +1156,7 @@ void AnimateLara(ITEM_INFO* item) { case COMMAND_MOVE_ORIGIN: TranslateItem(item, cmd[0], cmd[1], cmd[2]); - UpdateLaraRoom(item, -LARA_HITE / 2); + UpdateLaraRoom(item, -LARA_HEIGHT / 2); cmd += 3; break; diff --git a/TR5Main/Game/Lara/lara.h b/TR5Main/Game/Lara/lara.h index 0f3e7293e..e33bb07f7 100644 --- a/TR5Main/Game/Lara/lara.h +++ b/TR5Main/Game/Lara/lara.h @@ -10,7 +10,7 @@ #define LARA_MED_TURN ANGLE(6.0f) #define LARA_FAST_TURN ANGLE(8.0f) -constexpr auto LARA_HITE = 762; // The size of lara (from the floor to the top of the head) +constexpr auto LARA_HEIGHT = 762; // The size of lara (from the floor to the top of the head) constexpr auto LARA_HEADROOM = 160; // Amount of reasonable space above Lara's head constexpr auto LARA_FREEFALL_SPEED = 131; constexpr auto LARA_RAD = 100; diff --git a/TR5Main/Game/Lara/lara_basic.cpp b/TR5Main/Game/Lara/lara_basic.cpp index 89d0500a0..12f00ba6b 100644 --- a/TR5Main/Game/Lara/lara_basic.cpp +++ b/TR5Main/Game/Lara/lara_basic.cpp @@ -28,7 +28,7 @@ void lara_default_col(ITEM_INFO* item, COLL_INFO* coll) coll->slopesArePits = true; coll->slopesAreWalls = true; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); } void lara_as_special(ITEM_INFO* item, COLL_INFO* coll) @@ -132,7 +132,7 @@ void lara_col_walk(ITEM_INFO* item, COLL_INFO* coll) coll->lavaIsPit = 1; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (!LaraHitCeiling(item, coll) && !TestLaraVault(item, coll)) { @@ -308,7 +308,7 @@ void lara_col_run(ITEM_INFO* item, COLL_INFO* coll) coll->slopesAreWalls = true; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (!LaraHitCeiling(item, coll) && !TestLaraVault(item, coll)) { @@ -429,7 +429,7 @@ void lara_as_stop(ITEM_INFO* item, COLL_INFO* coll) if (TrInput & IN_LSTEP) { auto collFloorResult = LaraCollisionFront(item, item->pos.yRot - ANGLE(90.0f), LARA_RAD + 48); - auto collCeilingResult = LaraCeilingCollisionFront(item, item->pos.yRot - ANGLE(90.0f), LARA_RAD + 48, LARA_HITE); + auto collCeilingResult = LaraCeilingCollisionFront(item, item->pos.yRot - ANGLE(90.0f), LARA_RAD + 48, LARA_HEIGHT); if ((collFloorResult.FloorHeight < 128 && collFloorResult.FloorHeight > -128) && collFloorResult.HeightType != BIG_SLOPE && collCeilingResult.CeilingHeight <= 0) item->goalAnimState = LS_STEP_LEFT; @@ -437,7 +437,7 @@ void lara_as_stop(ITEM_INFO* item, COLL_INFO* coll) else if (TrInput & IN_RSTEP) { auto collFloorResult = LaraCollisionFront(item, item->pos.yRot + ANGLE(90.0f), LARA_RAD + 48); - auto collCeilingResult = LaraCeilingCollisionFront(item, item->pos.yRot + ANGLE(90.0f), LARA_RAD + 48, LARA_HITE); + auto collCeilingResult = LaraCeilingCollisionFront(item, item->pos.yRot + ANGLE(90.0f), LARA_RAD + 48, LARA_HEIGHT); if ((collFloorResult.FloorHeight < 128 && collFloorResult.FloorHeight > -128) && collFloorResult.HeightType != BIG_SLOPE && collCeilingResult.CeilingHeight <= 0) item->goalAnimState = LS_STEP_RIGHT; @@ -488,7 +488,7 @@ void lara_as_stop(ITEM_INFO* item, COLL_INFO* coll) coll->radius = LARA_RAD + 2; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (TestLaraVault(item, coll)) return; @@ -510,7 +510,7 @@ void lara_as_stop(ITEM_INFO* item, COLL_INFO* coll) else if (TrInput & IN_FORWARD) { auto collFloorResult = LaraCollisionFront(item, item->pos.yRot, LARA_RAD + 4); - auto collCeilingResult = LaraCeilingCollisionFront(item, item->pos.yRot, LARA_RAD + 4, LARA_HITE); + auto collCeilingResult = LaraCeilingCollisionFront(item, item->pos.yRot, LARA_RAD + 4, LARA_HEIGHT); if ((collFloorResult.HeightType == BIG_SLOPE || collFloorResult.HeightType == DIAGONAL) && (collFloorResult.FloorHeight < 0 || collCeilingResult.CeilingHeight > 0)) { @@ -550,7 +550,7 @@ void lara_col_stop(ITEM_INFO* item, COLL_INFO* coll) coll->slopesArePits = true; coll->slopesAreWalls = true; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (LaraHitCeiling(item, coll)) return; @@ -629,7 +629,7 @@ void lara_col_forwardjump(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = BAD_JUMP_CEILING; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); LaraDeflectEdgeJump(item, coll); if (item->speed < 0) @@ -710,7 +710,7 @@ void lara_col_fastback(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = 0; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (!LaraHitCeiling(item, coll)) { @@ -799,7 +799,7 @@ void lara_col_turn_r(ITEM_INFO* item, COLL_INFO* coll) coll->slopesAreWalls = true; coll->slopesArePits = true; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); #if 1 if (coll->middle.Floor > 100) @@ -916,7 +916,7 @@ void lara_col_death(ITEM_INFO* item, COLL_INFO* coll) coll->radius = 400; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); ShiftItem(item, coll); item->hitPoints = -1; @@ -946,7 +946,7 @@ void lara_col_fastfall(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = BAD_JUMP_CEILING; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); LaraSlideEdgeJump(item, coll); if (coll->middle.Floor <= 0) @@ -996,7 +996,7 @@ void lara_col_reach(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = BAD_JUMP_CEILING; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); short angle; bool result = false; @@ -1049,7 +1049,7 @@ void lara_col_reach(ITEM_INFO* item, COLL_INFO* coll) { LaraSlideEdgeJump(item, coll); coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); ShiftItem(item, coll); if (item->fallspeed > 0 && coll->middle.Floor <= 0) @@ -1164,7 +1164,7 @@ void lara_col_splat(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = 0; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); ShiftItem(item, coll); if (coll->middle.Floor >= -256 && coll->middle.Floor <= 256) @@ -1184,22 +1184,22 @@ void lara_as_compress(ITEM_INFO* item, COLL_INFO* coll) /*collision: lara_col_compress*/ if (Lara.waterStatus != LW_WADE) { - if (TrInput & IN_FORWARD && LaraFloorFront(item, item->pos.yRot, 256) >= -384) + if (TrInput & IN_FORWARD && !LaraFacingCorner(item, item->pos.yRot, 256) && LaraFloorFront(item, item->pos.yRot, 256) >= -384) { item->goalAnimState = LS_JUMP_FORWARD; Lara.moveAngle = item->pos.yRot; } - else if (TrInput & IN_LEFT && LaraFloorFront(item, item->pos.yRot - ANGLE(90.0f), 256) >= -384) + else if (TrInput & IN_LEFT && !LaraFacingCorner(item, item->pos.yRot - ANGLE(90.0f), 256) && LaraFloorFront(item, item->pos.yRot - ANGLE(90.0f), 256) >= -384) { item->goalAnimState = LS_JUMP_LEFT; Lara.moveAngle = item->pos.yRot - ANGLE(90); } - else if (TrInput & IN_RIGHT && LaraFloorFront(item, item->pos.yRot + ANGLE(90.0f), 256) >= -384) + else if (TrInput & IN_RIGHT && !LaraFacingCorner(item, item->pos.yRot + ANGLE(90.0f), 256) && LaraFloorFront(item, item->pos.yRot + ANGLE(90.0f), 256) >= -384) { item->goalAnimState = LS_JUMP_RIGHT; Lara.moveAngle = item->pos.yRot + ANGLE(90); } - else if (TrInput & IN_BACK && LaraFloorFront(item, item->pos.yRot - ANGLE(180.0f), 256) >= -384) + else if (TrInput & IN_BACK && !LaraFacingCorner(item, item->pos.yRot - ANGLE(180.0f), 256) && LaraFloorFront(item, item->pos.yRot - ANGLE(180.0f), 256) >= -384) { item->goalAnimState = LS_JUMP_BACK; Lara.moveAngle = item->pos.yRot + ANGLE(180); @@ -1222,7 +1222,7 @@ void lara_col_compress(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = 0; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (!LaraFallen(item, coll)) { @@ -1296,7 +1296,7 @@ void lara_col_back(ITEM_INFO* item, COLL_INFO* coll) coll->slopesArePits = true; coll->slopesAreWalls = true; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (LaraHitCeiling(item, coll)) return; @@ -1418,7 +1418,7 @@ void lara_col_stepright(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = 0; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (!LaraHitCeiling(item, coll)) { @@ -1487,7 +1487,7 @@ void lara_col_roll2(ITEM_INFO* item, COLL_INFO* coll) item->fallspeed = 0; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (LaraHitCeiling(item, coll)) return; @@ -1588,7 +1588,7 @@ void lara_col_jumper(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = BAD_JUMP_CEILING; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); LaraDeflectEdgeJump(item, coll); if (item->fallspeed > 0 && coll->middle.Floor <= 0) @@ -1803,7 +1803,7 @@ void lara_col_fallback(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = BAD_JUMP_CEILING; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); LaraDeflectEdgeJump(item, coll); if (item->fallspeed > 0 && coll->middle.Floor <= 0) @@ -1837,7 +1837,7 @@ void lara_col_roll(ITEM_INFO* item, COLL_INFO* coll) item->fallspeed = 0; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (LaraHitCeiling(item, coll)) return; @@ -1881,7 +1881,7 @@ void lara_col_swandive(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = BAD_JUMP_CEILING; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); LaraDeflectEdgeJump(item, coll); if (coll->middle.Floor <= 0 && item->fallspeed > 0) @@ -1917,7 +1917,7 @@ void lara_col_fastdive(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = BAD_JUMP_CEILING; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); LaraDeflectEdgeJump(item, coll); if (coll->middle.Floor <= 0 && item->fallspeed > 0) @@ -2069,7 +2069,7 @@ void lara_col_wade(ITEM_INFO* item, COLL_INFO* coll) coll->slopesAreWalls = true; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (LaraHitCeiling(item, coll)) return; @@ -2189,7 +2189,7 @@ void lara_col_dash(ITEM_INFO* item, COLL_INFO* coll) coll->slopesAreWalls = true; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (!LaraHitCeiling(item, coll) && !TestLaraVault(item, coll)) { @@ -2265,7 +2265,7 @@ void lara_col_dashdive(ITEM_INFO* item, COLL_INFO* coll) coll->slopesAreWalls = true; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); LaraDeflectEdgeJump(item, coll); if (!LaraFallen(item, coll)) diff --git a/TR5Main/Game/Lara/lara_climb.cpp b/TR5Main/Game/Lara/lara_climb.cpp index ad592cb56..3bfb5278f 100644 --- a/TR5Main/Game/Lara/lara_climb.cpp +++ b/TR5Main/Game/Lara/lara_climb.cpp @@ -965,7 +965,7 @@ int LaraTestClimbUpPos(ITEM_INFO* item, int front, int right, int* shift, int* l ceiling = GetCeiling(floor, x + xFront, y, z + zFront) - y; if (ceiling < 512) { - if (height - ceiling <= 762) + if (height - ceiling <= LARA_HEIGHT) { if (height - ceiling < 512) return 0; diff --git a/TR5Main/Game/Lara/lara_initialise.cpp b/TR5Main/Game/Lara/lara_initialise.cpp index 491c89f85..9bf1d7ed9 100644 --- a/TR5Main/Game/Lara/lara_initialise.cpp +++ b/TR5Main/Game/Lara/lara_initialise.cpp @@ -34,7 +34,6 @@ void InitialiseLara(int restore) Lara.air = 1800; Lara.weaponItem = NO_ITEM; PoisonFlag = 0; - Lara.dpoisoned = 0; Lara.poisoned = 0; Lara.waterSurfaceDist = 100; if (Lara.Weapons[static_cast(LARA_WEAPON_TYPE::WEAPON_PISTOLS)].Present) { diff --git a/TR5Main/Game/Lara/lara_objects.cpp b/TR5Main/Game/Lara/lara_objects.cpp index 6a44ae628..6d985c2bb 100644 --- a/TR5Main/Game/Lara/lara_objects.cpp +++ b/TR5Main/Game/Lara/lara_objects.cpp @@ -641,7 +641,7 @@ void lara_col_polestat(ITEM_INFO* item, COLL_INFO* coll) coll->radius = 100; coll->slopesAreWalls = true; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (TrInput & IN_ACTION) { @@ -736,13 +736,13 @@ void lara_col_poledown(ITEM_INFO* item, COLL_INFO* coll) coll->facing = Lara.moveAngle; coll->radius = 100; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (coll->middle.Floor < 0) { short roomNumber = item->roomNumber; item->floor = GetFloorHeight(GetFloor(item->pos.xPos, item->pos.yPos, item->pos.zPos, &roomNumber), - item->pos.xPos, item->pos.yPos - 762, item->pos.zPos); + item->pos.xPos, item->pos.yPos - LARA_HEIGHT, item->pos.zPos); item->goalAnimState = LS_POLE_IDLE; item->itemFlags[2] = 0; diff --git a/TR5Main/Game/Lara/lara_slide.cpp b/TR5Main/Game/Lara/lara_slide.cpp index be0781201..00549b9ee 100644 --- a/TR5Main/Game/Lara/lara_slide.cpp +++ b/TR5Main/Game/Lara/lara_slide.cpp @@ -65,7 +65,7 @@ void lara_slide_slope(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = 0; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (!LaraHitCeiling(item, coll)) { diff --git a/TR5Main/Game/Lara/lara_struct.h b/TR5Main/Game/Lara/lara_struct.h index 83ab04675..afa45018b 100644 --- a/TR5Main/Game/Lara/lara_struct.h +++ b/TR5Main/Game/Lara/lara_struct.h @@ -1008,7 +1008,6 @@ struct LaraInfo HolsterInfo holsterInfo; short flareFrame; short poisoned; - short dpoisoned; byte wet[NUM_LARA_MESHES]; bool flareControlLeft; bool look; @@ -1017,7 +1016,6 @@ struct LaraInfo bool isMoving; bool canMonkeySwing; byte burnBlue; - bool gassed; bool burnSmoke; bool isDucked; bool hasFired; diff --git a/TR5Main/Game/Lara/lara_surface.cpp b/TR5Main/Game/Lara/lara_surface.cpp index 63a273291..b6551bc10 100644 --- a/TR5Main/Game/Lara/lara_surface.cpp +++ b/TR5Main/Game/Lara/lara_surface.cpp @@ -314,7 +314,7 @@ int LaraTestWaterClimbOut(ITEM_INFO* item, COLL_INFO* coll) item->pos.yPos += frontFloor - 5; - UpdateLaraRoom(item, -LARA_HITE / 2); + UpdateLaraRoom(item, -LARA_HEIGHT / 2); /*if (coll->middle.SplitFloor) { diff --git a/TR5Main/Game/Lara/lara_swim.cpp b/TR5Main/Game/Lara/lara_swim.cpp index 81dc81a09..6b46481db 100644 --- a/TR5Main/Game/Lara/lara_swim.cpp +++ b/TR5Main/Game/Lara/lara_swim.cpp @@ -522,7 +522,7 @@ void LaraSwimCollision(ITEM_INFO* item, COLL_INFO* coll) coll->facing = item->pos.yRot; } - short height = 762 * phd_sin(item->pos.xRot); + short height = LARA_HEIGHT * phd_sin(item->pos.xRot); height = abs(height); if (height < ((LaraDrawType == LARA_TYPE::DIVESUIT) * 64) + 200) diff --git a/TR5Main/Game/Lara/lara_tests.cpp b/TR5Main/Game/Lara/lara_tests.cpp index 7e5db2866..b90ae2a1a 100644 --- a/TR5Main/Game/Lara/lara_tests.cpp +++ b/TR5Main/Game/Lara/lara_tests.cpp @@ -321,7 +321,7 @@ int LaraHangTest(ITEM_INFO* item, COLL_INFO* coll) coll->badCeiling = 0; Lara.moveAngle = item->pos.yRot; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); result = 0; if (Lara.climbStatus) { @@ -796,7 +796,7 @@ int IsValidHangPos(ITEM_INFO* item, COLL_INFO* coll) Lara.moveAngle = item->pos.yRot; coll->facing = Lara.moveAngle; - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); if (coll->middle.Ceiling >= 0 || coll->collType != CT_FRONT || coll->hitStatic) return 0; @@ -1112,6 +1112,32 @@ void SetCornerAnimFeet(ITEM_INFO* item, COLL_INFO* coll, short rot, short flip) } } +bool LaraFacingCorner(ITEM_INFO* item, short ang, int dist) +{ + auto angle1 = ang + ANGLE(15); + auto angle2 = ang - ANGLE(15); + + auto vec1 = GAME_VECTOR(item->pos.xPos + dist * phd_sin(angle1), + item->pos.yPos - (LARA_HEIGHT / 2), + item->pos.zPos + dist * phd_cos(angle1), + item->roomNumber); + + auto vec2 = GAME_VECTOR(item->pos.xPos + dist * phd_sin(angle2), + item->pos.yPos - (LARA_HEIGHT / 2), + item->pos.zPos + dist * phd_cos(angle2), + item->roomNumber); + + auto pos = GAME_VECTOR(item->pos.xPos, + item->pos.yPos, + item->pos.zPos, + item->roomNumber); + + auto result1 = LOS(&pos, &vec1); + auto result2 = LOS(&pos, &vec2); + + return (result1 == 0 && result2 == 0); +} + int LaraFloorFront(ITEM_INFO* item, short ang, int dist) { return LaraCollisionFront(item, ang, dist).FloorHeight; @@ -1120,7 +1146,7 @@ int LaraFloorFront(ITEM_INFO* item, short ang, int dist) COLL_RESULT LaraCollisionFront(ITEM_INFO* item, short ang, int dist) { int x = item->pos.xPos + dist * phd_sin(ang); - int y = item->pos.yPos - 762; + int y = item->pos.yPos - LARA_HEIGHT; int z = item->pos.zPos + dist * phd_cos(ang); auto collResult = GetCollisionResult(x, y, z, item->roomNumber); diff --git a/TR5Main/Game/Lara/lara_tests.h b/TR5Main/Game/Lara/lara_tests.h index 1bd0ef398..27b8e1fa7 100644 --- a/TR5Main/Game/Lara/lara_tests.h +++ b/TR5Main/Game/Lara/lara_tests.h @@ -15,6 +15,7 @@ bool TestHangFeet(ITEM_INFO* item, short angle); int CanLaraHangSideways(ITEM_INFO* item, COLL_INFO* coll, short angle); void SetCornerAnim(ITEM_INFO* item, COLL_INFO* coll, short rot, short flip); void SetCornerAnimFeet(ITEM_INFO* item, COLL_INFO* coll, short rot, short flip); +bool LaraFacingCorner(ITEM_INFO* item, short ang, int dist); int LaraFloorFront(ITEM_INFO* item, short ang, int dist); COLL_RESULT LaraCollisionFront(ITEM_INFO* item, short ang, int dist); int LaraCeilingFront(ITEM_INFO* item, short ang, int dist, int h); diff --git a/TR5Main/Game/camera.cpp b/TR5Main/Game/camera.cpp index e3a4b71ed..3bc1e1adc 100644 --- a/TR5Main/Game/camera.cpp +++ b/TR5Main/Game/camera.cpp @@ -44,7 +44,6 @@ int TargetSnaps = 0; GAME_VECTOR LookCamPosition; GAME_VECTOR LookCamTarget; int LSHKTimer = 0; -int ExittingBinos = 0; int LSHKShotsFired = 0; PHD_VECTOR CamOldPos; int TLFlag = 0; @@ -58,7 +57,6 @@ int BinocularOn; CAMERA_TYPE BinocularOldCamera; int LaserSight; int SniperCount; -int ExitingBinocular; int PhdPerspective; short CurrentFOV; int GetLaraOnLOS; @@ -1155,6 +1153,8 @@ void BounceCamera(ITEM_INFO* item, short bounce, short maxDistance) void BinocularCamera(ITEM_INFO* item) { + static int exittingBinos = 0; + if (LSHKTimer) --LSHKTimer; @@ -1162,11 +1162,11 @@ void BinocularCamera(ITEM_INFO* item) { if (InputBusy & IN_DRAW) { - ExittingBinos = 1; + exittingBinos = 1; } - else if (ExittingBinos) + else if (exittingBinos) { - ExittingBinos = 0; + exittingBinos = 0; BinocularRange = 0; AlterFOV(14560); LaraItem->meshBits = -1; @@ -1440,6 +1440,7 @@ void BinocularCamera(ITEM_INFO* item) if (!(InputBusy & IN_ACTION) || Infrared) { + // Reimplement this mode? } else { diff --git a/TR5Main/Game/camera.h b/TR5Main/Game/camera.h index ed8c31efe..1b21b6251 100644 --- a/TR5Main/Game/camera.h +++ b/TR5Main/Game/camera.h @@ -64,7 +64,6 @@ extern int BinocularOn; extern CAMERA_TYPE BinocularOldCamera; extern int LaserSight; extern int SniperCount; -extern int ExitingBinocular; extern int PhdPerspective; extern short CurrentFOV; extern int GetLaraOnLOS; diff --git a/TR5Main/Game/collide.cpp b/TR5Main/Game/collide.cpp index 8863434b5..ee83efbfd 100644 --- a/TR5Main/Game/collide.cpp +++ b/TR5Main/Game/collide.cpp @@ -439,11 +439,11 @@ int ItemPushLaraStatic(ITEM_INFO* item, BOUNDING_BOX* bounds, PHD_3DPOS* pos, CO coll->facing = phd_atan(item->pos.zPos - coll->old.z, item->pos.xPos - coll->old.x); if (item == LaraItem) { - GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); } else { - GetObjectCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HITE); + GetObjectCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT); } coll->facing = oldFacing; @@ -569,11 +569,11 @@ int ItemPushLara(ITEM_INFO* item, ITEM_INFO* l, COLL_INFO* coll, int spazon, cha if (l == LaraItem) { - GetCollisionInfo(coll, l->pos.xPos, l->pos.yPos, l->pos.zPos, l->roomNumber, LARA_HITE); + GetCollisionInfo(coll, l->pos.xPos, l->pos.yPos, l->pos.zPos, l->roomNumber, LARA_HEIGHT); } else { - GetObjectCollisionInfo(coll, l->pos.xPos, l->pos.yPos, l->pos.zPos, l->roomNumber, LARA_HITE); + GetObjectCollisionInfo(coll, l->pos.xPos, l->pos.yPos, l->pos.zPos, l->roomNumber, LARA_HEIGHT); } coll->facing = facing; diff --git a/TR5Main/Game/control.cpp b/TR5Main/Game/control.cpp index b74f360de..8bd4d9932 100644 --- a/TR5Main/Game/control.cpp +++ b/TR5Main/Game/control.cpp @@ -76,7 +76,6 @@ int ClosestDist; PHD_VECTOR ClosestCoord; int RumbleTimer = 0; int InGameCnt = 0; -byte IsAtmospherePlaying = 0; byte FlipStatus = 0; int FlipStats[MAX_FLIPMAP]; int FlipMap[MAX_FLIPMAP]; @@ -102,7 +101,6 @@ short CurrentRoom; int GameTimer; short GlobalCounter; byte LevelComplete; -short DelCutSeqPlayer; #ifndef NEW_INV int LastInventoryItem; #endif @@ -112,27 +110,21 @@ int InitialiseGame; int RequiredStartPos; int WeaponDelay; int WeaponEnemyTimer; -int HeavyTriggered; short SkyPos1; short SkyPos2; CVECTOR SkyColor1; CVECTOR SkyColor2; int CutSeqNum; -int CutSeqTriggered; -int GlobalPlayingCutscene; int CurrentLevel; -bool SoundActive; bool DoTheGame; bool ThreadEnded; int OnFloor; int SmokeWindX; int SmokeWindZ; -int KillEverythingFlag; int FlipTimer; int FlipEffect; int TriggerTimer; int JustLoaded; -int PoisonFlags; int OldLaraBusy; int Infrared; short FlashFadeR; @@ -196,17 +188,13 @@ GAME_STATUS ControlPhase(int numFrames, int demoMode) TrInput &= IN_LOOK; } - // If cutscene has been triggered then clear input - if (CutSeqTriggered) - TrInput = IN_NONE; - // Does the player want to enter inventory? SetDebounce = false; #ifdef NEW_INV if (CurrentLevel != 0 && !g_Renderer.isFading()) { - if (TrInput & IN_PAUSE && GLOBAL_invMode != IM_PAUSE && LaraItem->hitPoints > 0 && !CutSeqTriggered) + if (TrInput & IN_PAUSE && GLOBAL_invMode != IM_PAUSE && LaraItem->hitPoints > 0) { SOUND_Stop(); g_Renderer.DumpGameScene(); @@ -214,7 +202,7 @@ GAME_STATUS ControlPhase(int numFrames, int demoMode) pause_menu_to_display = pause_main_menu; pause_selected_option = 1; } - else if ((DbInput & IN_DESELECT || GLOBAL_enterinventory != NO_ITEM) && !CutSeqTriggered && LaraItem->hitPoints > 0) + else if ((DbInput & IN_DESELECT || GLOBAL_enterinventory != NO_ITEM) && LaraItem->hitPoints > 0) { // Stop all sounds SOUND_Stop(); @@ -237,7 +225,7 @@ GAME_STATUS ControlPhase(int numFrames, int demoMode) #else if (CurrentLevel != 0 && !g_Renderer.isFading()) { - if ((DbInput & IN_DESELECT || g_Inventory.GetEnterObject() != NO_ITEM) && !CutSeqTriggered && LaraItem->hitPoints > 0) + if ((DbInput & IN_DESELECT || g_Inventory.GetEnterObject() != NO_ITEM) && LaraItem->hitPoints > 0) { // Stop all sounds SOUND_Stop(); @@ -435,23 +423,10 @@ GAME_STATUS ControlPhase(int numFrames, int demoMode) { if (Lara.poisoned > 4096) Lara.poisoned = 4096; - else if (Lara.dpoisoned) - Lara.dpoisoned++; - - if (!Lara.gassed) - { - if (Lara.dpoisoned) - { - Lara.dpoisoned -= 8; - if (Lara.dpoisoned < 0) - Lara.dpoisoned = 0; - } - } if (Lara.poisoned >= 256 && !(Wibble & 0xFF)) { - LaraItem->hitPoints -= Lara.poisoned >> (8 - Lara.gassed); - PoisonFlags = 16; + LaraItem->hitPoints -= Lara.poisoned >> 8; } } @@ -575,6 +550,9 @@ GAME_STATUS ControlPhase(int numFrames, int demoMode) if (FlipEffect != -1) effect_routines[FlipEffect](NULL); + // Clear savegame loaded flag + JustLoaded = false; + // Update timers HealthBarTimer--; GameTimer++; @@ -657,7 +635,6 @@ GAME_STATUS DoTitle(int index) #ifndef NEW_INV LastInventoryItem = -1; #endif - DelCutSeqPlayer = 0; // Initialise flyby cameras InitSpotCamSequences(); @@ -669,7 +646,6 @@ GAME_STATUS DoTitle(int index) // Play background music //CurrentAtmosphere = ambient; S_CDPlay(CurrentAtmosphere, 1); - IsAtmospherePlaying = true; // Initialise ponytails InitialiseHair(); @@ -797,7 +773,6 @@ GAME_STATUS DoLevel(int index, std::string ambient, bool loadFromSavegame) #ifndef NEW_INV LastInventoryItem = -1; #endif - DelCutSeqPlayer = 0; #ifdef NEW_INV GLOBAL_inventoryitemchosen = NO_ITEM; @@ -813,7 +788,6 @@ GAME_STATUS DoLevel(int index, std::string ambient, bool loadFromSavegame) // Play background music CurrentAtmosphere = ambient; S_CDPlay(CurrentAtmosphere, 1); - IsAtmospherePlaying = true; // Initialise ponytails InitialiseHair(); @@ -925,8 +899,6 @@ void TestTriggers(short *data, bool heavy, int heavyFlags) } } - HeavyTriggered = false; - if (!data) return; @@ -1196,7 +1168,6 @@ void TestTriggers(short *data, bool heavy, int heavyFlags) item->touchBits = 0; AddActiveItem(value); item->status = ITEM_ACTIVE; - HeavyTriggered = heavy; } } } diff --git a/TR5Main/Game/control.h b/TR5Main/Game/control.h index 0acb47c07..6ce66ea16 100644 --- a/TR5Main/Game/control.h +++ b/TR5Main/Game/control.h @@ -62,7 +62,6 @@ enum COMMAND_TYPES #define OUTSIDE_SIZE 108 extern int KeyTriggerActive; -extern byte IsAtmospherePlaying; extern byte FlipStatus; constexpr auto MAX_FLIPMAP = 255; @@ -89,7 +88,6 @@ extern short CurrentRoom; extern int GameTimer; extern short GlobalCounter; extern byte LevelComplete; -extern short DelCutSeqPlayer; #ifndef NEW_INV extern int LastInventoryItem; #endif @@ -99,27 +97,21 @@ extern int InitialiseGame; extern int RequiredStartPos; extern int WeaponDelay; extern int WeaponEnemyTimer; -extern int HeavyTriggered; extern short SkyPos1; extern short SkyPos2; extern CVECTOR SkyColor1; extern CVECTOR SkyColor2; extern int CutSeqNum; -extern int CutSeqTriggered; -extern int GlobalPlayingCutscene; extern int CurrentLevel; -extern bool SoundActive; extern bool DoTheGame; extern bool ThreadEnded; extern int OnFloor; extern int SmokeWindX; extern int SmokeWindZ; -extern int KillEverythingFlag; extern int FlipTimer; extern int FlipEffect; extern int TriggerTimer; extern int JustLoaded; -extern int PoisonFlags; extern int OldLaraBusy; extern int Infrared; extern short FlashFadeR; diff --git a/TR5Main/Game/effect2.cpp b/TR5Main/Game/effect2.cpp index 598ce9c7e..f91bbe8c7 100644 --- a/TR5Main/Game/effect2.cpp +++ b/TR5Main/Game/effect2.cpp @@ -1275,7 +1275,7 @@ void TriggerDartSmoke(int x, int y, int z, int xv, int zv, int hit) void KillAllCurrentItems(short itemNumber) { - KillEverythingFlag = 1; + // TODO: Reimplement this functionality } void TriggerDynamicLight(int x, int y, int z, short falloff, byte r, byte g, byte b) @@ -1865,9 +1865,4 @@ void TriggerMetalSparks(int x, int y, int z, int xv, int yv, int zv, int additio spark->dSize = ((r / 256) & 0xF) + 24; } } -} - -void KillEverything() -{ - KillEverythingFlag = 0; } \ No newline at end of file diff --git a/TR5Main/Game/health.cpp b/TR5Main/Game/health.cpp index da43c09f7..30fd7e4f7 100644 --- a/TR5Main/Game/health.cpp +++ b/TR5Main/Game/health.cpp @@ -32,11 +32,11 @@ void DrawHealthBarOverlay(int value) if (CurrentLevel) { int color2 = 0; - if (Lara.poisoned || Lara.gassed) + if (Lara.poisoned) color2 = 0xA0A000; else color2 = 0xA00000; - g_Renderer.drawBar(value, ::g_HealthBar, ID_HEALTH_BAR_TEXTURE, GlobalCounter,Lara.poisoned || Lara.gassed); + g_Renderer.drawBar(value, ::g_HealthBar, ID_HEALTH_BAR_TEXTURE, GlobalCounter, Lara.poisoned); } } @@ -44,7 +44,7 @@ void DrawHealthBar(float value) { if (CurrentLevel) { - g_Renderer.drawBar(value, ::g_HealthBar, ID_HEALTH_BAR_TEXTURE,GlobalCounter,Lara.poisoned || Lara.gassed); + g_Renderer.drawBar(value, ::g_HealthBar, ID_HEALTH_BAR_TEXTURE, GlobalCounter, Lara.poisoned); } } @@ -170,13 +170,6 @@ void UpdateAirBar(int flash) } else DrawAirBar(air / 1800.0f); - - if (Lara.gassed) - { - if (Lara.dpoisoned < 2048) - Lara.dpoisoned += 2; - Lara.gassed = false; - } } void DrawDashBar(int value) diff --git a/TR5Main/Game/inventory.cpp b/TR5Main/Game/inventory.cpp index 16655bae4..ba7bc93df 100644 --- a/TR5Main/Game/inventory.cpp +++ b/TR5Main/Game/inventory.cpp @@ -1879,7 +1879,6 @@ int Inventory::DoTitleInventory() } CurrentAtmosphere = CDA_XA11_FLYBY1; - IsAtmospherePlaying = true; S_CDPlay(CurrentAtmosphere, 1); OpenRing(INV_RING_OPTIONS, true); diff --git a/TR5Main/Game/sphere.cpp b/TR5Main/Game/sphere.cpp index b07866d80..57e14d872 100644 --- a/TR5Main/Game/sphere.cpp +++ b/TR5Main/Game/sphere.cpp @@ -6,8 +6,9 @@ #include "setup.h" #include "Renderer11.h" #include "trmath.h" + using namespace ten::renderer; -int NumLaraSpheres; + bool GotLaraSpheres; SPHERE LaraSpheres[MAX_SPHERES]; SPHERE CreatureSpheres[MAX_SPHERES]; @@ -37,19 +38,14 @@ int TestCollision(ITEM_INFO* item, ITEM_INFO* l) { int flags = 0; - int num1 = GetSpheres(item, CreatureSpheres, SPHERES_SPACE_WORLD, Matrix::Identity); - int num2 = 0; + int creatureSphereCount = GetSpheres(item, CreatureSpheres, SPHERES_SPACE_WORLD, Matrix::Identity); + int laraSphereCount = 0; if (l == LaraItem) { - if (GotLaraSpheres) + if (!GotLaraSpheres) { - num2 = NumLaraSpheres; - } - else - { - num2 = GetSpheres(l, LaraSpheres, SPHERES_SPACE_WORLD, Matrix::Identity); - NumLaraSpheres = num2; + laraSphereCount = GetSpheres(l, LaraSpheres, SPHERES_SPACE_WORLD, Matrix::Identity); if (l == LaraItem) GotLaraSpheres = true; } @@ -58,22 +54,21 @@ int TestCollision(ITEM_INFO* item, ITEM_INFO* l) { GotLaraSpheres = false; - num2 = GetSpheres(l, LaraSpheres, SPHERES_SPACE_WORLD, Matrix::Identity); - NumLaraSpheres = num2; + laraSphereCount = GetSpheres(l, LaraSpheres, SPHERES_SPACE_WORLD, Matrix::Identity); if (l == LaraItem) GotLaraSpheres = true; } l->touchBits = 0; - if (num1 <= 0) + if (creatureSphereCount <= 0) { item->touchBits = 0; return 0; } else { - for (int i = 0; i < num1; i++) + for (int i = 0; i < creatureSphereCount; i++) { SPHERE* ptr1 = &CreatureSpheres[i]; @@ -84,7 +79,7 @@ int TestCollision(ITEM_INFO* item, ITEM_INFO* l) if (r1 > 0) { - for (int j = 0; j < num2; j++) + for (int j = 0; j < laraSphereCount; j++) { SPHERE* ptr2 = &LaraSpheres[j]; diff --git a/TR5Main/Game/sphere.h b/TR5Main/Game/sphere.h index 8646f946a..ea3703d46 100644 --- a/TR5Main/Game/sphere.h +++ b/TR5Main/Game/sphere.h @@ -14,7 +14,6 @@ struct SPHERE int r; }; -extern int NumLaraSpheres; extern bool GotLaraSpheres; extern SPHERE LaraSpheres[MAX_SPHERES]; extern SPHERE CreatureSpheres[MAX_SPHERES]; diff --git a/TR5Main/Game/traps.cpp b/TR5Main/Game/traps.cpp index 737e7c7ce..686fbd351 100644 --- a/TR5Main/Game/traps.cpp +++ b/TR5Main/Game/traps.cpp @@ -565,15 +565,8 @@ void WreckingBallControl(short itemNumber) } if (item->itemFlags[2] < 900) ++item->itemFlags[2]; - if (GlobalPlayingCutscene) - { - room = item->roomNumber; - item->goalAnimState = 0; - item->pos.xPos = 47616; - item->pos.zPos = 34816; - item->pos.yPos = GetCeiling(GetFloor(item->pos.xPos, item->pos.yPos, item->pos.zPos, &room), item->pos.xPos, item->pos.yPos, item->pos.zPos) + 1664; - } - else if (item->itemFlags[1] <= 0) + + if (item->itemFlags[1] <= 0) { oldX = item->pos.xPos; oldZ = item->pos.zPos; diff --git a/TR5Main/Objects/TR2/Vehicles/boat.cpp b/TR5Main/Objects/TR2/Vehicles/boat.cpp index 2453d3bbe..5e82cd176 100644 --- a/TR5Main/Objects/TR2/Vehicles/boat.cpp +++ b/TR5Main/Objects/TR2/Vehicles/boat.cpp @@ -220,7 +220,7 @@ bool SpeedBoatCanGetOff(int direction) if (collResult.HeightType == BIG_SLOPE || collResult.HeightType == DIAGONAL) return false; - if ((collResult.CeilingHeight - v->pos.yPos > -LARA_HITE) || (collResult.FloorHeight - collResult.CeilingHeight < LARA_HITE)) + if ((collResult.CeilingHeight - v->pos.yPos > -LARA_HEIGHT) || (collResult.FloorHeight - collResult.CeilingHeight < LARA_HEIGHT)) return false; return true; diff --git a/TR5Main/Objects/TR2/Vehicles/snowmobile.cpp b/TR5Main/Objects/TR2/Vehicles/snowmobile.cpp index 90b020fea..6c91929eb 100644 --- a/TR5Main/Objects/TR2/Vehicles/snowmobile.cpp +++ b/TR5Main/Objects/TR2/Vehicles/snowmobile.cpp @@ -240,7 +240,7 @@ bool SkidooCheckGetOffOK(int direction) if (abs(collResult.FloorHeight - skidoo->pos.yPos) > WALL_SIZE / 2) return false; - if (collResult.CeilingHeight - skidoo->pos.yPos > -LARA_HITE || collResult.FloorHeight - collResult.CeilingHeight < LARA_HITE) + if (collResult.CeilingHeight - skidoo->pos.yPos > -LARA_HEIGHT || collResult.FloorHeight - collResult.CeilingHeight < LARA_HEIGHT) return false; return true; diff --git a/TR5Main/Objects/TR3/Entity/tr3_scuba.cpp b/TR5Main/Objects/TR3/Entity/tr3_scuba.cpp index 869b49ff4..adf5437da 100644 --- a/TR5Main/Objects/TR3/Entity/tr3_scuba.cpp +++ b/TR5Main/Objects/TR3/Entity/tr3_scuba.cpp @@ -110,7 +110,7 @@ void ScubaControl(short itemNumber) start.roomNumber = item->roomNumber; target.x = LaraItem->pos.xPos; - target.y = LaraItem->pos.yPos - (LARA_HITE - 150); + target.y = LaraItem->pos.yPos - (LARA_HEIGHT - 150); target.z = LaraItem->pos.zPos; shoot = LOS(&start, &target); diff --git a/TR5Main/Objects/TR3/Vehicles/minecart.cpp b/TR5Main/Objects/TR3/Vehicles/minecart.cpp index 5cf23d491..343508f3e 100644 --- a/TR5Main/Objects/TR3/Vehicles/minecart.cpp +++ b/TR5Main/Objects/TR3/Vehicles/minecart.cpp @@ -93,7 +93,7 @@ static short GetCollision(ITEM_INFO* v, short ang, int dist, short* ceiling) short roomNumber; x = v->pos.xPos + phd_sin(ang) * dist; - y = v->pos.yPos - LARA_HITE; + y = v->pos.yPos - LARA_HEIGHT; z = v->pos.zPos + phd_cos(ang) * dist; roomNumber = v->roomNumber; @@ -163,7 +163,7 @@ static bool CanGetOut(int direction) if (abs(collResult.FloorHeight - v->pos.yPos) > WALL_SIZE / 2) return false; - if ((collResult.CeilingHeight - v->pos.yPos > -LARA_HITE) || (collResult.FloorHeight - collResult.CeilingHeight < LARA_HITE)) + if ((collResult.CeilingHeight - v->pos.yPos > -LARA_HEIGHT) || (collResult.FloorHeight - collResult.CeilingHeight < LARA_HEIGHT)) return false; return true; diff --git a/TR5Main/Objects/TR3/Vehicles/quad.cpp b/TR5Main/Objects/TR3/Vehicles/quad.cpp index d6d37105c..e48799b23 100644 --- a/TR5Main/Objects/TR3/Vehicles/quad.cpp +++ b/TR5Main/Objects/TR3/Vehicles/quad.cpp @@ -185,7 +185,7 @@ static int CanQuadbikeGetOff(int direction) if (abs(collResult.FloorHeight - item->pos.yPos) > 512) return false; - if ((collResult.CeilingHeight - item->pos.yPos > -LARA_HITE) || (collResult.FloorHeight - collResult.CeilingHeight < LARA_HITE)) + if ((collResult.CeilingHeight - item->pos.yPos > -LARA_HEIGHT) || (collResult.FloorHeight - collResult.CeilingHeight < LARA_HEIGHT)) return false; return true; diff --git a/TR5Main/Objects/TR3/Vehicles/rubberboat.cpp b/TR5Main/Objects/TR3/Vehicles/rubberboat.cpp index 157325c70..4735d7d42 100644 --- a/TR5Main/Objects/TR3/Vehicles/rubberboat.cpp +++ b/TR5Main/Objects/TR3/Vehicles/rubberboat.cpp @@ -668,7 +668,7 @@ static int CanGetOffRubberBoat(int direction) if (collResult.HeightType == BIG_SLOPE || collResult.HeightType == DIAGONAL) return 0; - if ((collResult.CeilingHeight - boat->pos.yPos > -762) || (collResult.FloorHeight - collResult.CeilingHeight < 762)) + if ((collResult.CeilingHeight - boat->pos.yPos > -LARA_HEIGHT) || (collResult.FloorHeight - collResult.CeilingHeight < LARA_HEIGHT)) return 0; return 1; diff --git a/TR5Main/Objects/TR3/Vehicles/upv.cpp b/TR5Main/Objects/TR3/Vehicles/upv.cpp index 85844e203..b5ea4ccc0 100644 --- a/TR5Main/Objects/TR3/Vehicles/upv.cpp +++ b/TR5Main/Objects/TR3/Vehicles/upv.cpp @@ -732,7 +732,7 @@ static void UserInput(ITEM_INFO* v, ITEM_INFO* l, SUB_INFO* sub) l->gravityStatus = false; l->pos.xRot = l->pos.zRot = 0; - UpdateLaraRoom(l, -LARA_HITE / 2); + UpdateLaraRoom(l, -LARA_HEIGHT / 2); Lara.waterStatus = LW_SURFACE; Lara.waterSurfaceDist = -hfw; diff --git a/TR5Main/Objects/TR4/Vehicles/jeep.cpp b/TR5Main/Objects/TR4/Vehicles/jeep.cpp index b24fc7d34..fd4c374c4 100644 --- a/TR5Main/Objects/TR4/Vehicles/jeep.cpp +++ b/TR5Main/Objects/TR4/Vehicles/jeep.cpp @@ -305,8 +305,8 @@ static int JeepCanGetOff() int ceiling = GetCeiling(floor, x, y, z); - if ((ceiling - item->pos.yPos > -LARA_HITE) - || (height - ceiling < LARA_HITE)) + if ((ceiling - item->pos.yPos > -LARA_HEIGHT) + || (height - ceiling < LARA_HEIGHT)) return 0; return 1; @@ -418,7 +418,6 @@ static int JeepCheckGetOff() Lara.Vehicle = NO_ITEM; Lara.gunStatus = LG_NO_ARMS; CurrentAtmosphere = 110; - IsAtmospherePlaying = true; S_CDPlay(110, 1); return false; } @@ -1607,7 +1606,6 @@ void JeepCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* coll) item->flags |= 0x20; CurrentAtmosphere = 98; - IsAtmospherePlaying = 1; S_CDPlay(98, 1); } else diff --git a/TR5Main/Objects/TR4/Vehicles/motorbike.cpp b/TR5Main/Objects/TR4/Vehicles/motorbike.cpp index 4baf7b3b7..c854b8c9b 100644 --- a/TR5Main/Objects/TR4/Vehicles/motorbike.cpp +++ b/TR5Main/Objects/TR4/Vehicles/motorbike.cpp @@ -976,9 +976,9 @@ static BOOL MotorbikeCanGetOff(void) return false; if (abs(collResult.FloorHeight - item->pos.yPos) > STEP_SIZE) return false; - if ((collResult.CeilingHeight - item->pos.yPos) > -LARA_HITE) + if ((collResult.CeilingHeight - item->pos.yPos) > -LARA_HEIGHT) return false; - if ((collResult.FloorHeight - collResult.CeilingHeight) < LARA_HITE) + if ((collResult.FloorHeight - collResult.CeilingHeight) < LARA_HEIGHT) return false; return true; diff --git a/TR5Main/Objects/TR5/Object/tr5_expandingplatform.cpp b/TR5Main/Objects/TR5/Object/tr5_expandingplatform.cpp index d3fcd9319..c38e103d7 100644 --- a/TR5Main/Objects/TR5/Object/tr5_expandingplatform.cpp +++ b/TR5Main/Objects/TR5/Object/tr5_expandingplatform.cpp @@ -143,7 +143,7 @@ void ShiftLaraOnPlatform(short itemNumber, bool isExpanding) xShift = lara_coll.radius / 6; } auto coll = lara_coll; - GetCollisionInfo(&coll, LaraItem->pos.xPos + xShift, LaraItem->pos.yPos, LaraItem->pos.zPos + zShift, LaraItem->roomNumber, LARA_HITE); + GetCollisionInfo(&coll, LaraItem->pos.xPos + xShift, LaraItem->pos.yPos, LaraItem->pos.zPos + zShift, LaraItem->roomNumber, LARA_HEIGHT); if (coll.middle.Ceiling >= 0 || coll.hitStatic) return; diff --git a/TR5Main/Objects/TR5/Object/tr5_pushableblock.cpp b/TR5Main/Objects/TR5/Object/tr5_pushableblock.cpp index b68c31002..2eb8755de 100644 --- a/TR5Main/Objects/TR5/Object/tr5_pushableblock.cpp +++ b/TR5Main/Objects/TR5/Object/tr5_pushableblock.cpp @@ -737,7 +737,7 @@ int TestBlockPull(ITEM_INFO* item, int blockhite, short quadrant) roomNum = LaraItem->roomNumber; - collResult = GetCollisionResult(x, y - LARA_HITE, z, LaraItem->roomNumber); + collResult = GetCollisionResult(x, y - LARA_HEIGHT, z, LaraItem->roomNumber); r = &g_Level.Rooms[roomNum]; if (XZ_GET_SECTOR(r, x - r->x, z - r->z).stopper) @@ -746,7 +746,7 @@ int TestBlockPull(ITEM_INFO* item, int blockhite, short quadrant) if (collResult.FloorHeight != y) return 0; - if (collResult.Block->ceiling * 256 > y - LARA_HITE) + if (collResult.Block->ceiling * 256 > y - LARA_HEIGHT) return 0; oldX = LaraItem->pos.xPos; diff --git a/TR5Main/Objects/TR5/Object/tr5_teleporter.cpp b/TR5Main/Objects/TR5/Object/tr5_teleporter.cpp index c9be70ce2..229402000 100644 --- a/TR5Main/Objects/TR5/Object/tr5_teleporter.cpp +++ b/TR5Main/Objects/TR5/Object/tr5_teleporter.cpp @@ -179,7 +179,6 @@ void ControlTeleporter(short itemNumber) { if (item->itemFlags[0] == 15) { - IsAtmospherePlaying = 0; //S_CDPlay("xa12_z_10", 0); } else if (item->itemFlags[0] == 70) diff --git a/TR5Main/Specific/setup.cpp b/TR5Main/Specific/setup.cpp index 8638d3527..230e1e022 100644 --- a/TR5Main/Specific/setup.cpp +++ b/TR5Main/Specific/setup.cpp @@ -46,7 +46,6 @@ void InitialiseGameFlags() FlipEffect = -1; FlipStatus = 0; - IsAtmospherePlaying = 0; Camera.underwater = 0; } diff --git a/TR5Main/Specific/winmain.cpp b/TR5Main/Specific/winmain.cpp index e9f5c6027..34f1cf23d 100644 --- a/TR5Main/Specific/winmain.cpp +++ b/TR5Main/Specific/winmain.cpp @@ -285,7 +285,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine //g_Renderer->Test(); - SoundActive = false; DoTheGame = true; ThreadEnded = false;