mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-10 20:46:47 +03:00
Clarify function names
# Conflicts: # TR5Main/Game/collide.cpp
This commit is contained in:
parent
e73aaf14e9
commit
cccd7a048b
14 changed files with 41 additions and 41 deletions
|
@ -388,7 +388,7 @@ int TestBoundsCollideStatic(BOUNDING_BOX* bounds, PHD_3DPOS* pos, int radius)
|
|||
}
|
||||
}
|
||||
|
||||
int ItemPushLaraStatic(ITEM_INFO* item, BOUNDING_BOX* bounds, PHD_3DPOS* pos, COLL_INFO* coll)
|
||||
int ItemPushStatic(ITEM_INFO* l, BOUNDING_BOX* bounds, PHD_3DPOS* pos, COLL_INFO* coll)
|
||||
{
|
||||
float c, s;
|
||||
int dx, dz, rx, rz, minX, maxX, minZ, maxZ;
|
||||
|
@ -397,8 +397,8 @@ int ItemPushLaraStatic(ITEM_INFO* item, BOUNDING_BOX* bounds, PHD_3DPOS* pos, CO
|
|||
|
||||
c = phd_cos(pos->yRot);
|
||||
s = phd_sin(pos->yRot);
|
||||
dx = LaraItem->pos.xPos - pos->xPos;
|
||||
dz = LaraItem->pos.zPos - pos->zPos;
|
||||
dx = l->pos.xPos - pos->xPos;
|
||||
dz = l->pos.zPos - pos->zPos;
|
||||
rx = c * dx - s * dz;
|
||||
rz = c * dz + s * dx;
|
||||
minX = bounds->X1 - coll->radius;
|
||||
|
@ -428,40 +428,40 @@ int ItemPushLaraStatic(ITEM_INFO* item, BOUNDING_BOX* bounds, PHD_3DPOS* pos, CO
|
|||
else
|
||||
rz -= bottom;
|
||||
|
||||
item->pos.xPos = pos->xPos + c * rx + s * rz;
|
||||
item->pos.zPos = pos->zPos + c * rz - s * rx;
|
||||
l->pos.xPos = pos->xPos + c * rx + s * rz;
|
||||
l->pos.zPos = pos->zPos + c * rz - s * rx;
|
||||
|
||||
coll->badPos = NO_BAD_POS;
|
||||
coll->badNeg = -STEPUP_HEIGHT;
|
||||
coll->badCeiling = 0;
|
||||
|
||||
oldFacing = coll->facing;
|
||||
coll->facing = phd_atan(item->pos.zPos - coll->old.z, item->pos.xPos - coll->old.x);
|
||||
if (item == LaraItem)
|
||||
coll->facing = phd_atan(l->pos.zPos - coll->old.z, l->pos.xPos - coll->old.x);
|
||||
if (l == LaraItem)
|
||||
{
|
||||
GetCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT);
|
||||
GetCollisionInfo(coll, l->pos.xPos, l->pos.yPos, l->pos.zPos, l->roomNumber, LARA_HEIGHT);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetObjectCollisionInfo(coll, item->pos.xPos, item->pos.yPos, item->pos.zPos, item->roomNumber, LARA_HEIGHT);
|
||||
GetObjectCollisionInfo(coll, l->pos.xPos, l->pos.yPos, l->pos.zPos, l->roomNumber, LARA_HEIGHT);
|
||||
}
|
||||
coll->facing = oldFacing;
|
||||
|
||||
if (coll->collType == CT_NONE)
|
||||
{
|
||||
coll->old.x = item->pos.xPos;
|
||||
coll->old.y = item->pos.yPos;
|
||||
coll->old.z = item->pos.zPos;
|
||||
coll->old.x = l->pos.xPos;
|
||||
coll->old.y = l->pos.yPos;
|
||||
coll->old.z = l->pos.zPos;
|
||||
|
||||
UpdateLaraRoom(item, -10);
|
||||
UpdateLaraRoom(l, -10);
|
||||
}
|
||||
else
|
||||
{
|
||||
item->pos.xPos = coll->old.x;
|
||||
item->pos.zPos = coll->old.z;
|
||||
l->pos.xPos = coll->old.x;
|
||||
l->pos.zPos = coll->old.z;
|
||||
}
|
||||
|
||||
if (item == LaraItem && Lara.isMoving && Lara.moveCount > 15)
|
||||
if (l == LaraItem && Lara.isMoving && Lara.moveCount > 15)
|
||||
{
|
||||
Lara.isMoving = false;
|
||||
Lara.gunStatus = LG_NO_ARMS;
|
||||
|
@ -470,7 +470,7 @@ int ItemPushLaraStatic(ITEM_INFO* item, BOUNDING_BOX* bounds, PHD_3DPOS* pos, CO
|
|||
return true;
|
||||
}
|
||||
|
||||
int ItemPushLara(ITEM_INFO* item, ITEM_INFO* l, COLL_INFO* coll, int spazon, char bigpush)
|
||||
int ItemPushItem(ITEM_INFO* item, ITEM_INFO* l, COLL_INFO* coll, int spazon, char bigpush)
|
||||
{
|
||||
float c, s;
|
||||
int dx, dz, rx, rz, minX, maxX, minZ, maxZ;
|
||||
|
@ -618,7 +618,7 @@ void ObjectCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* c)
|
|||
if (TestCollision(item, l))
|
||||
{
|
||||
if (c->enableBaddiePush)
|
||||
ItemPushLara(item, l, c, false, true);
|
||||
ItemPushItem(item, l, c, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -902,7 +902,7 @@ void CreatureCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
|
|||
{
|
||||
if (coll->enableBaddiePush || Lara.waterStatus == LW_UNDERWATER || Lara.waterStatus == LW_SURFACE)
|
||||
{
|
||||
ItemPushLara(item, l, coll, coll->enableSpaz, 0);
|
||||
ItemPushItem(item, l, coll, coll->enableSpaz, 0);
|
||||
}
|
||||
else if (coll->enableSpaz)
|
||||
{
|
||||
|
@ -2585,7 +2585,7 @@ void LaraBaddieCollision(ITEM_INFO* l, COLL_INFO* coll)
|
|||
pos.yRot = mesh->yRot;
|
||||
|
||||
if (TestBoundsCollideStatic(&StaticObjects[mesh->staticNumber].collisionBox, &pos, coll->radius))
|
||||
ItemPushLaraStatic(l, &StaticObjects[mesh->staticNumber].collisionBox, &pos, coll);
|
||||
ItemPushStatic(l, &StaticObjects[mesh->staticNumber].collisionBox, &pos, coll);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2639,7 +2639,7 @@ void GenericSphereBoxCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
|
|||
int y = l->pos.yPos;
|
||||
int z = l->pos.zPos;
|
||||
|
||||
if (ItemPushLara(item, l, coll, ((deadlyBits & 1) & coll->enableSpaz), 3) && (deadlyBits & 1))
|
||||
if (ItemPushItem(item, l, coll, ((deadlyBits & 1) & coll->enableSpaz), 3) && (deadlyBits & 1))
|
||||
{
|
||||
l->hitPoints -= item->itemFlags[3];
|
||||
|
||||
|
|
|
@ -98,11 +98,11 @@ COLL_RESULT GetCollisionResult(int x, int y, int z, short roomNumber);
|
|||
COLL_RESULT GetCollisionResult(ITEM_INFO* item);
|
||||
int FindGridShift(int x, int z);
|
||||
int TestBoundsCollideStatic(BOUNDING_BOX* bounds, PHD_3DPOS* pos, int radius);
|
||||
int ItemPushLaraStatic(ITEM_INFO* item, BOUNDING_BOX* bounds, PHD_3DPOS* pos, COLL_INFO* coll);
|
||||
int ItemPushItem(ITEM_INFO* item, ITEM_INFO* l, COLL_INFO* coll, int spazon, char bigpush);
|
||||
int ItemPushStatic(ITEM_INFO* l, BOUNDING_BOX* bounds, PHD_3DPOS* pos, COLL_INFO* coll);
|
||||
void AIPickupCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* c);
|
||||
void ObjectCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* c);
|
||||
void AlignLaraPosition(PHD_VECTOR* vec, ITEM_INFO* item, ITEM_INFO* l);
|
||||
int ItemPushLara(ITEM_INFO* item, ITEM_INFO* l, COLL_INFO* coll, int spazon, char bigpush);
|
||||
int TestLaraPosition(OBJECT_COLLISION_BOUNDS* bounds, ITEM_INFO* item, ITEM_INFO* l);
|
||||
int Move3DPosTo3DPos(PHD_3DPOS* src, PHD_3DPOS* dest, int velocity, short angAdd);
|
||||
int MoveLaraPosition(PHD_VECTOR* pos, ITEM_INFO* item, ITEM_INFO* l);
|
||||
|
|
|
@ -440,7 +440,7 @@ void DoorCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
|
|||
{
|
||||
if (!(item->objectNumber >= ID_LIFT_DOORS1 && item->objectNumber <= ID_LIFT_DOORS2) || item->itemFlags[0])
|
||||
{
|
||||
ItemPushLara(item, l, coll, FALSE, TRUE);
|
||||
ItemPushItem(item, l, coll, FALSE, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -981,7 +981,7 @@ void SteelDoorCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* coll)
|
|||
if (TestCollision(item, l))
|
||||
{
|
||||
if (coll->enableBaddiePush)
|
||||
ItemPushLara(item, l, coll, 0, 1);
|
||||
ItemPushItem(item, l, coll, 0, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ void TorchControl(short itemNumber)
|
|||
pos.yPos = CollidedMeshes[0]->y;
|
||||
pos.zPos = CollidedMeshes[0]->z;
|
||||
pos.yRot = CollidedMeshes[0]->yRot;
|
||||
ItemPushLaraStatic(item, &sobj->collisionBox, &pos, &lara_coll);
|
||||
ItemPushStatic(item, &sobj->collisionBox, &pos, &lara_coll);
|
||||
}
|
||||
item->speed /= 2;
|
||||
}
|
||||
|
|
|
@ -501,7 +501,7 @@ void WreckingBallCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* coll)
|
|||
z = l->pos.zPos;
|
||||
test = (x & 1023) > 256 && (x & 1023) < 768 && (z & 1023) > 256 && (z & 1023) < 768;
|
||||
damage = item->fallspeed > 0 ? 96 : 0;
|
||||
if (ItemPushLara(item, l, coll, coll->enableSpaz, 1))
|
||||
if (ItemPushItem(item, l, coll, coll->enableSpaz, 1))
|
||||
{
|
||||
if (test)
|
||||
l->hitPoints = 0;
|
||||
|
|
|
@ -158,14 +158,14 @@ namespace TEN::Entities::Switches
|
|||
GlobalCollisionBounds.Z1 = -512;
|
||||
GlobalCollisionBounds.Z2 = 512;
|
||||
|
||||
ItemPushLara(item, l, coll, 0, 2);
|
||||
ItemPushItem(item, l, coll, 0, 2);
|
||||
|
||||
GlobalCollisionBounds.X1 = 256;
|
||||
GlobalCollisionBounds.X2 = 1024;
|
||||
GlobalCollisionBounds.Z1 = -128;
|
||||
GlobalCollisionBounds.Z2 = 128;
|
||||
|
||||
ItemPushLara(item, l, coll, 0, 2);
|
||||
ItemPushItem(item, l, coll, 0, 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ void DragonCollision(short itemNum, ITEM_INFO* laraitem, COLL_INFO* coll)
|
|||
}
|
||||
}
|
||||
|
||||
ItemPushLara(item, laraitem, coll, 1, 0);
|
||||
ItemPushItem(item, laraitem, coll, 1, 0);
|
||||
}
|
||||
|
||||
void DragonControl(short backNum)
|
||||
|
|
|
@ -67,9 +67,9 @@ void SkidManCollision(short itemNum, ITEM_INFO* laraitem, COLL_INFO* coll)
|
|||
if (coll->enableBaddiePush)
|
||||
{
|
||||
if (item->speed > 0)
|
||||
ItemPushLara(item, laraitem, coll, coll->enableSpaz, 0);
|
||||
ItemPushItem(item, laraitem, coll, coll->enableSpaz, 0);
|
||||
else
|
||||
ItemPushLara(item, laraitem, coll, 0, 0);
|
||||
ItemPushItem(item, laraitem, coll, 0, 0);
|
||||
}
|
||||
|
||||
if (Lara.Vehicle == NO_ITEM && item->speed > 0)
|
||||
|
|
|
@ -850,7 +850,7 @@ void NoGetOnCollision(short item_num, ITEM_INFO *laraitem, COLL_INFO *coll)
|
|||
return;
|
||||
if (!TestCollision(item, laraitem))
|
||||
return;
|
||||
ItemPushLara(item, laraitem, coll, 0, 0);
|
||||
ItemPushItem(item, laraitem, coll, 0, 0);
|
||||
}
|
||||
|
||||
void SubCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
|
||||
|
|
|
@ -141,7 +141,7 @@ void ElementPuzzleDoCollision(short itemNumber, ITEM_INFO* l, COLL_INFO* c)
|
|||
{
|
||||
if (c->enableBaddiePush)
|
||||
{
|
||||
ItemPushLara(item, l, c, 0, 0);
|
||||
ItemPushItem(item, l, c, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,17 +97,17 @@ void ScalesCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
|
|||
GlobalCollisionBounds.Z1 = -256;
|
||||
GlobalCollisionBounds.Z2 = 384;
|
||||
|
||||
ItemPushLara(item, l, coll, 0, 2);
|
||||
ItemPushItem(item, l, coll, 0, 2);
|
||||
|
||||
GlobalCollisionBounds.X1 = -256;
|
||||
GlobalCollisionBounds.X2 = 256;
|
||||
|
||||
ItemPushLara(item, l, coll, 0, 2);
|
||||
ItemPushItem(item, l, coll, 0, 2);
|
||||
|
||||
GlobalCollisionBounds.X1 = -1280;
|
||||
GlobalCollisionBounds.X2 = -640;
|
||||
|
||||
ItemPushLara(item, l, coll, 0, 2);
|
||||
ItemPushItem(item, l, coll, 0, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -25,7 +25,7 @@ void BladeCollision(short itemNum, ITEM_INFO* l, COLL_INFO* coll)
|
|||
int dy = 0;
|
||||
int dz = 0;
|
||||
|
||||
if (ItemPushLara(item, l, coll, 1, 1))
|
||||
if (ItemPushItem(item, l, coll, 1, 1))
|
||||
{
|
||||
LaraItem->hitPoints -= item->itemFlags[3];
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ void StargateCollision(short itemNum, ITEM_INFO* l, COLL_INFO* c)
|
|||
GlobalCollisionBounds.Z1 = StargateBounds[3 * i + 2];
|
||||
|
||||
if (TestWithGlobalCollisionBounds(item, l, c))
|
||||
ItemPushLara(item, l, c, 0, 2);
|
||||
ItemPushItem(item, l, c, 0, 2);
|
||||
}
|
||||
|
||||
int result = TestCollision(item, l);
|
||||
|
@ -75,7 +75,7 @@ void StargateCollision(short itemNum, ITEM_INFO* l, COLL_INFO* c)
|
|||
int oldY = LaraItem->pos.yPos;
|
||||
int oldZ = LaraItem->pos.zPos;
|
||||
|
||||
if (ItemPushLara(item, l, c, flags & 1, 2))
|
||||
if (ItemPushItem(item, l, c, flags & 1, 2))
|
||||
{
|
||||
if ((flags & 1) &&
|
||||
(oldX != LaraItem->pos.xPos || oldY != LaraItem->pos.yPos || oldZ != LaraItem->pos.zPos) &&
|
||||
|
|
|
@ -312,7 +312,7 @@ void ClassicRollingBallCollision(short itemNum, ITEM_INFO* lara, COLL_INFO* coll
|
|||
if (lara->gravityStatus)
|
||||
{
|
||||
if (coll->enableBaddiePush)
|
||||
ItemPushLara(item, lara, coll, coll->enableSpaz, 1);
|
||||
ItemPushItem(item, lara, coll, coll->enableSpaz, 1);
|
||||
lara->hitPoints -= 100;
|
||||
x = lara->pos.xPos - item->pos.xPos;
|
||||
y = (lara->pos.yPos - 350) - (item->pos.yPos - 512);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue