mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-08 03:28:03 +03:00
Globals cleanup, remove wrecking ball hack, remove gassed property, fix diagonal block jump bug
This commit is contained in:
parent
5fde174058
commit
21df1e84f1
37 changed files with 120 additions and 172 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<int>(LARA_WEAPON_TYPE::WEAPON_PISTOLS)].Present) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
@ -1866,8 +1866,3 @@ void TriggerMetalSparks(int x, int y, int z, int xv, int yv, int zv, int additio
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KillEverything()
|
||||
{
|
||||
KillEverythingFlag = 0;
|
||||
}
|
|
@ -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)
|
||||
|
|
|
@ -1879,7 +1879,6 @@ int Inventory::DoTitleInventory()
|
|||
}
|
||||
|
||||
CurrentAtmosphere = CDA_XA11_FLYBY1;
|
||||
IsAtmospherePlaying = true;
|
||||
S_CDPlay(CurrentAtmosphere, 1);
|
||||
|
||||
OpenRing(INV_RING_OPTIONS, true);
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ struct SPHERE
|
|||
int r;
|
||||
};
|
||||
|
||||
extern int NumLaraSpheres;
|
||||
extern bool GotLaraSpheres;
|
||||
extern SPHERE LaraSpheres[MAX_SPHERES];
|
||||
extern SPHERE CreatureSpheres[MAX_SPHERES];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -46,7 +46,6 @@ void InitialiseGameFlags()
|
|||
|
||||
FlipEffect = -1;
|
||||
FlipStatus = 0;
|
||||
IsAtmospherePlaying = 0;
|
||||
Camera.underwater = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -285,7 +285,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||
|
||||
//g_Renderer->Test();
|
||||
|
||||
SoundActive = false;
|
||||
DoTheGame = true;
|
||||
|
||||
ThreadEnded = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue