mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 12:47:58 +03:00
typing: streamline structs and enums
This commit is contained in:
parent
8faceb4c81
commit
becda3f436
277 changed files with 1531 additions and 1577 deletions
|
@ -127,7 +127,7 @@ void Box_TargetBox(LOT_INFO *lot, int16_t box_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Box_StalkBox(ITEM_INFO *item, int16_t box_num)
|
bool Box_StalkBox(ITEM *item, int16_t box_num)
|
||||||
{
|
{
|
||||||
BOX_INFO *box = &g_Boxes[box_num];
|
BOX_INFO *box = &g_Boxes[box_num];
|
||||||
int32_t z = ((box->left + box->right) >> 1) - g_LaraItem->pos.z;
|
int32_t z = ((box->left + box->right) >> 1) - g_LaraItem->pos.z;
|
||||||
|
@ -156,7 +156,7 @@ bool Box_StalkBox(ITEM_INFO *item, int16_t box_num)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Box_EscapeBox(ITEM_INFO *item, int16_t box_num)
|
bool Box_EscapeBox(ITEM *item, int16_t box_num)
|
||||||
{
|
{
|
||||||
BOX_INFO *box = &g_Boxes[box_num];
|
BOX_INFO *box = &g_Boxes[box_num];
|
||||||
int32_t z = ((box->left + box->right) >> 1) - g_LaraItem->pos.z;
|
int32_t z = ((box->left + box->right) >> 1) - g_LaraItem->pos.z;
|
||||||
|
@ -175,9 +175,9 @@ bool Box_EscapeBox(ITEM_INFO *item, int16_t box_num)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Box_ValidBox(ITEM_INFO *item, int16_t zone_num, int16_t box_num)
|
bool Box_ValidBox(ITEM *item, int16_t zone_num, int16_t box_num)
|
||||||
{
|
{
|
||||||
CREATURE_INFO *creature = item->data;
|
CREATURE *creature = item->data;
|
||||||
|
|
||||||
int16_t *zone;
|
int16_t *zone;
|
||||||
if (creature->lot.fly) {
|
if (creature->lot.fly) {
|
||||||
|
@ -205,7 +205,7 @@ bool Box_ValidBox(ITEM_INFO *item, int16_t zone_num, int16_t box_num)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
TARGET_TYPE Box_CalculateTarget(XYZ_32 *target, ITEM_INFO *item, LOT_INFO *lot)
|
TARGET_TYPE Box_CalculateTarget(XYZ_32 *target, ITEM *item, LOT_INFO *lot)
|
||||||
{
|
{
|
||||||
int32_t left = 0;
|
int32_t left = 0;
|
||||||
int32_t right = 0;
|
int32_t right = 0;
|
||||||
|
@ -425,7 +425,7 @@ bool Box_BadFloor(
|
||||||
int32_t x, int32_t y, int32_t z, int16_t box_height, int16_t next_height,
|
int32_t x, int32_t y, int32_t z, int16_t box_height, int16_t next_height,
|
||||||
int16_t room_num, LOT_INFO *lot)
|
int16_t room_num, LOT_INFO *lot)
|
||||||
{
|
{
|
||||||
const SECTOR_INFO *const sector = Room_GetSector(x, y, z, &room_num);
|
const SECTOR *const sector = Room_GetSector(x, y, z, &room_num);
|
||||||
if (sector->box == NO_BOX) {
|
if (sector->box == NO_BOX) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,10 +8,10 @@
|
||||||
bool Box_SearchLOT(LOT_INFO *lot, int32_t expansion);
|
bool Box_SearchLOT(LOT_INFO *lot, int32_t expansion);
|
||||||
bool Box_UpdateLOT(LOT_INFO *lot, int32_t expansion);
|
bool Box_UpdateLOT(LOT_INFO *lot, int32_t expansion);
|
||||||
void Box_TargetBox(LOT_INFO *lot, int16_t box_num);
|
void Box_TargetBox(LOT_INFO *lot, int16_t box_num);
|
||||||
bool Box_StalkBox(ITEM_INFO *item, int16_t box_num);
|
bool Box_StalkBox(ITEM *item, int16_t box_num);
|
||||||
bool Box_EscapeBox(ITEM_INFO *item, int16_t box_num);
|
bool Box_EscapeBox(ITEM *item, int16_t box_num);
|
||||||
bool Box_ValidBox(ITEM_INFO *item, int16_t zone_num, int16_t box_num);
|
bool Box_ValidBox(ITEM *item, int16_t zone_num, int16_t box_num);
|
||||||
TARGET_TYPE Box_CalculateTarget(XYZ_32 *target, ITEM_INFO *item, LOT_INFO *lot);
|
TARGET_TYPE Box_CalculateTarget(XYZ_32 *target, ITEM *item, LOT_INFO *lot);
|
||||||
bool Box_BadFloor(
|
bool Box_BadFloor(
|
||||||
int32_t x, int32_t y, int32_t z, int16_t box_height, int16_t next_height,
|
int32_t x, int32_t y, int32_t z, int16_t box_height, int16_t next_height,
|
||||||
int16_t room_num, LOT_INFO *lot);
|
int16_t room_num, LOT_INFO *lot);
|
||||||
|
|
|
@ -47,7 +47,7 @@ static void M_EnsureEnvironment(void);
|
||||||
|
|
||||||
static bool M_BadPosition(int32_t x, int32_t y, int32_t z, int16_t room_num)
|
static bool M_BadPosition(int32_t x, int32_t y, int32_t z, int16_t room_num)
|
||||||
{
|
{
|
||||||
const SECTOR_INFO *const sector = Room_GetSector(x, y, z, &room_num);
|
const SECTOR *const sector = Room_GetSector(x, y, z, &room_num);
|
||||||
return y >= Room_GetHeight(sector, x, y, z)
|
return y >= Room_GetHeight(sector, x, y, z)
|
||||||
|| y <= Room_GetCeiling(sector, x, y, z);
|
|| y <= Room_GetCeiling(sector, x, y, z);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ static int32_t M_ShiftClamp(GAME_VECTOR *pos, int32_t clamp)
|
||||||
int32_t y = pos->y;
|
int32_t y = pos->y;
|
||||||
int32_t z = pos->z;
|
int32_t z = pos->z;
|
||||||
|
|
||||||
const SECTOR_INFO *const sector = Room_GetSector(x, y, z, &pos->room_num);
|
const SECTOR *const sector = Room_GetSector(x, y, z, &pos->room_num);
|
||||||
|
|
||||||
const BOX_INFO *const box = &g_Boxes[sector->box];
|
const BOX_INFO *const box = &g_Boxes[sector->box];
|
||||||
if (z < box->left + clamp
|
if (z < box->left + clamp
|
||||||
|
@ -103,7 +103,7 @@ static void M_SmartShift(
|
||||||
{
|
{
|
||||||
LOS_Check(&g_Camera.target, ideal);
|
LOS_Check(&g_Camera.target, ideal);
|
||||||
|
|
||||||
const ROOM_INFO *r = &g_RoomInfo[g_Camera.target.room_num];
|
const ROOM *r = &g_RoomInfo[g_Camera.target.room_num];
|
||||||
int32_t z_sector = (g_Camera.target.z - r->z) >> WALL_SHIFT;
|
int32_t z_sector = (g_Camera.target.z - r->z) >> WALL_SHIFT;
|
||||||
int32_t x_sector = (g_Camera.target.x - r->x) >> WALL_SHIFT;
|
int32_t x_sector = (g_Camera.target.x - r->x) >> WALL_SHIFT;
|
||||||
|
|
||||||
|
@ -297,7 +297,7 @@ static void M_Move(GAME_VECTOR *ideal, int32_t speed)
|
||||||
|
|
||||||
g_ChunkyFlag = false;
|
g_ChunkyFlag = false;
|
||||||
|
|
||||||
const SECTOR_INFO *sector = Room_GetSector(
|
const SECTOR *sector = Room_GetSector(
|
||||||
g_Camera.pos.x, g_Camera.pos.y, g_Camera.pos.z, &g_Camera.pos.room_num);
|
g_Camera.pos.x, g_Camera.pos.y, g_Camera.pos.z, &g_Camera.pos.room_num);
|
||||||
int32_t height =
|
int32_t height =
|
||||||
Room_GetHeight(sector, g_Camera.pos.x, g_Camera.pos.y, g_Camera.pos.z)
|
Room_GetHeight(sector, g_Camera.pos.x, g_Camera.pos.y, g_Camera.pos.z)
|
||||||
|
@ -471,7 +471,7 @@ void Camera_Initialise(void)
|
||||||
Camera_Update();
|
Camera_Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera_Chase(ITEM_INFO *item)
|
void Camera_Chase(ITEM *item)
|
||||||
{
|
{
|
||||||
GAME_VECTOR ideal;
|
GAME_VECTOR ideal;
|
||||||
|
|
||||||
|
@ -505,7 +505,7 @@ void Camera_Chase(ITEM_INFO *item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera_Combat(ITEM_INFO *item)
|
void Camera_Combat(ITEM *item)
|
||||||
{
|
{
|
||||||
GAME_VECTOR ideal;
|
GAME_VECTOR ideal;
|
||||||
|
|
||||||
|
@ -541,7 +541,7 @@ void Camera_Combat(ITEM_INFO *item)
|
||||||
M_Move(&ideal, g_Camera.speed);
|
M_Move(&ideal, g_Camera.speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera_Look(ITEM_INFO *item)
|
void Camera_Look(ITEM *item)
|
||||||
{
|
{
|
||||||
GAME_VECTOR old;
|
GAME_VECTOR old;
|
||||||
GAME_VECTOR ideal;
|
GAME_VECTOR ideal;
|
||||||
|
@ -629,7 +629,7 @@ void Camera_Update(void)
|
||||||
|
|
||||||
int32_t fixed_camera = g_Camera.item
|
int32_t fixed_camera = g_Camera.item
|
||||||
&& (g_Camera.type == CAM_FIXED || g_Camera.type == CAM_HEAVY);
|
&& (g_Camera.type == CAM_FIXED || g_Camera.type == CAM_HEAVY);
|
||||||
ITEM_INFO *item = fixed_camera ? g_Camera.item : g_LaraItem;
|
ITEM *item = fixed_camera ? g_Camera.item : g_LaraItem;
|
||||||
|
|
||||||
const BOUNDS_16 *bounds = Item_GetBoundsAccurate(item);
|
const BOUNDS_16 *bounds = Item_GetBoundsAccurate(item);
|
||||||
|
|
||||||
|
@ -724,7 +724,7 @@ void Camera_Update(void)
|
||||||
g_Camera.fixed_camera = 0;
|
g_Camera.fixed_camera = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SECTOR_INFO *const sector = Room_GetSector(
|
const SECTOR *const sector = Room_GetSector(
|
||||||
g_Camera.target.x, g_Camera.target.y, g_Camera.target.z,
|
g_Camera.target.x, g_Camera.target.y, g_Camera.target.z,
|
||||||
&g_Camera.target.room_num);
|
&g_Camera.target.room_num);
|
||||||
if (g_Camera.target.y > Room_GetHeight(
|
if (g_Camera.target.y > Room_GetHeight(
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
void Camera_Initialise(void);
|
void Camera_Initialise(void);
|
||||||
void Camera_Reset(void);
|
void Camera_Reset(void);
|
||||||
void Camera_ResetPosition(void);
|
void Camera_ResetPosition(void);
|
||||||
void Camera_Chase(ITEM_INFO *item);
|
void Camera_Chase(ITEM *item);
|
||||||
void Camera_Combat(ITEM_INFO *item);
|
void Camera_Combat(ITEM *item);
|
||||||
void Camera_Look(ITEM_INFO *item);
|
void Camera_Look(ITEM *item);
|
||||||
void Camera_Fixed(void);
|
void Camera_Fixed(void);
|
||||||
void Camera_Update(void);
|
void Camera_Update(void);
|
||||||
void Camera_UpdateCutscene(void);
|
void Camera_UpdateCutscene(void);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
static int16_t m_AnimatingCount = 0;
|
static int16_t m_AnimatingCount = 0;
|
||||||
|
|
||||||
static ITEM_INFO *M_GetCarrier(int16_t item_num);
|
static ITEM *M_GetCarrier(int16_t item_num);
|
||||||
static void M_AnimateDrop(CARRIED_ITEM *item);
|
static void M_AnimateDrop(CARRIED_ITEM *item);
|
||||||
|
|
||||||
static const GAME_OBJECT_PAIR m_LegacyMap[] = {
|
static const GAME_OBJECT_PAIR m_LegacyMap[] = {
|
||||||
|
@ -40,7 +40,7 @@ void Carrier_InitialiseLevel(int32_t level_num)
|
||||||
for (int i = 0; i < level.item_drops.count; i++) {
|
for (int i = 0; i < level.item_drops.count; i++) {
|
||||||
GAMEFLOW_DROP_ITEM_DATA *data = &level.item_drops.data[i];
|
GAMEFLOW_DROP_ITEM_DATA *data = &level.item_drops.data[i];
|
||||||
|
|
||||||
ITEM_INFO *item = M_GetCarrier(data->enemy_num);
|
ITEM *item = M_GetCarrier(data->enemy_num);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
LOG_WARNING("%d does not refer to a loaded item", data->enemy_num);
|
LOG_WARNING("%d does not refer to a loaded item", data->enemy_num);
|
||||||
continue;
|
continue;
|
||||||
|
@ -92,7 +92,7 @@ void Carrier_InitialiseLevel(int32_t level_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static ITEM_INFO *M_GetCarrier(int16_t item_num)
|
static ITEM *M_GetCarrier(int16_t item_num)
|
||||||
{
|
{
|
||||||
if (item_num < 0 || item_num >= g_LevelItemCount) {
|
if (item_num < 0 || item_num >= g_LevelItemCount) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -100,7 +100,7 @@ static ITEM_INFO *M_GetCarrier(int16_t item_num)
|
||||||
|
|
||||||
// Allow carried items to be allocated to holder objects (pods/statues),
|
// Allow carried items to be allocated to holder objects (pods/statues),
|
||||||
// but then have those items dropped by the actual creatures within.
|
// but then have those items dropped by the actual creatures within.
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
if (Object_IsObjectType(item->object_id, g_PlaceholderObjects)) {
|
if (Object_IsObjectType(item->object_id, g_PlaceholderObjects)) {
|
||||||
int16_t child_item_num = *(int16_t *)item->data;
|
int16_t child_item_num = *(int16_t *)item->data;
|
||||||
item = &g_Items[child_item_num];
|
item = &g_Items[child_item_num];
|
||||||
|
@ -115,7 +115,7 @@ static ITEM_INFO *M_GetCarrier(int16_t item_num)
|
||||||
|
|
||||||
int32_t Carrier_GetItemCount(int16_t item_num)
|
int32_t Carrier_GetItemCount(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *carrier = M_GetCarrier(item_num);
|
ITEM *carrier = M_GetCarrier(item_num);
|
||||||
if (!carrier) {
|
if (!carrier) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ DROP_STATUS Carrier_GetSaveStatus(const CARRIED_ITEM *item)
|
||||||
// This allows us to save drops as still being carried to allow accurate
|
// This allows us to save drops as still being carried to allow accurate
|
||||||
// placement again in Carrier_TestItemDrops on load.
|
// placement again in Carrier_TestItemDrops on load.
|
||||||
if (item->status == DS_DROPPED) {
|
if (item->status == DS_DROPPED) {
|
||||||
ITEM_INFO *pickup = &g_Items[item->spawn_num];
|
ITEM *pickup = &g_Items[item->spawn_num];
|
||||||
return pickup->status == IS_INVISIBLE ? DS_COLLECTED : DS_CARRIED;
|
return pickup->status == IS_INVISIBLE ? DS_COLLECTED : DS_CARRIED;
|
||||||
} else if (item->status == DS_FALLING) {
|
} else if (item->status == DS_FALLING) {
|
||||||
return DS_CARRIED;
|
return DS_CARRIED;
|
||||||
|
@ -148,7 +148,7 @@ DROP_STATUS Carrier_GetSaveStatus(const CARRIED_ITEM *item)
|
||||||
|
|
||||||
void Carrier_TestItemDrops(int16_t item_num)
|
void Carrier_TestItemDrops(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *carrier = &g_Items[item_num];
|
ITEM *carrier = &g_Items[item_num];
|
||||||
CARRIED_ITEM *item = carrier->carried_item;
|
CARRIED_ITEM *item = carrier->carried_item;
|
||||||
if (carrier->hit_points > 0 || !item
|
if (carrier->hit_points > 0 || !item
|
||||||
|| (carrier->object_id == O_PIERRE
|
|| (carrier->object_id == O_PIERRE
|
||||||
|
@ -177,7 +177,7 @@ void Carrier_TestItemDrops(int16_t item_num)
|
||||||
|
|
||||||
if (item->room_num != NO_ROOM) {
|
if (item->room_num != NO_ROOM) {
|
||||||
// Handle reloading a save with a falling or landed item.
|
// Handle reloading a save with a falling or landed item.
|
||||||
ITEM_INFO *pickup = &g_Items[item->spawn_num];
|
ITEM *pickup = &g_Items[item->spawn_num];
|
||||||
pickup->pos = item->pos;
|
pickup->pos = item->pos;
|
||||||
pickup->fall_speed = item->fall_speed;
|
pickup->fall_speed = item->fall_speed;
|
||||||
if (pickup->room_num != item->room_num) {
|
if (pickup->room_num != item->room_num) {
|
||||||
|
@ -190,7 +190,7 @@ void Carrier_TestItemDrops(int16_t item_num)
|
||||||
|
|
||||||
void Carrier_TestLegacyDrops(int16_t item_num)
|
void Carrier_TestLegacyDrops(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *carrier = &g_Items[item_num];
|
ITEM *carrier = &g_Items[item_num];
|
||||||
if (carrier->hit_points > 0) {
|
if (carrier->hit_points > 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -224,7 +224,7 @@ void Carrier_AnimateDrops(void)
|
||||||
|
|
||||||
// Make items that spawn in mid-air or water gracefully fall to the floor.
|
// Make items that spawn in mid-air or water gracefully fall to the floor.
|
||||||
for (int i = 0; i < g_LevelItemCount; i++) {
|
for (int i = 0; i < g_LevelItemCount; i++) {
|
||||||
ITEM_INFO *carrier = &g_Items[i];
|
ITEM *carrier = &g_Items[i];
|
||||||
CARRIED_ITEM *item = carrier->carried_item;
|
CARRIED_ITEM *item = carrier->carried_item;
|
||||||
while (item) {
|
while (item) {
|
||||||
M_AnimateDrop(item);
|
M_AnimateDrop(item);
|
||||||
|
@ -239,9 +239,9 @@ static void M_AnimateDrop(CARRIED_ITEM *item)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_INFO *const pickup = &g_Items[item->spawn_num];
|
ITEM *const pickup = &g_Items[item->spawn_num];
|
||||||
int16_t room_num = pickup->room_num;
|
int16_t room_num = pickup->room_num;
|
||||||
const SECTOR_INFO *const sector =
|
const SECTOR *const sector =
|
||||||
Room_GetSector(pickup->pos.x, pickup->pos.y, pickup->pos.z, &room_num);
|
Room_GetSector(pickup->pos.x, pickup->pos.y, pickup->pos.z, &room_num);
|
||||||
const int16_t height =
|
const int16_t height =
|
||||||
Room_GetHeight(sector, pickup->pos.x, pickup->pos.y, pickup->pos.z);
|
Room_GetHeight(sector, pickup->pos.x, pickup->pos.y, pickup->pos.z);
|
||||||
|
|
|
@ -27,7 +27,7 @@ void Collide_GetCollisionInfo(
|
||||||
int32_t z = zpos;
|
int32_t z = zpos;
|
||||||
int32_t ytop = y - 160;
|
int32_t ytop = y - 160;
|
||||||
|
|
||||||
const SECTOR_INFO *sector = Room_GetSector(x, ytop, z, &room_num);
|
const SECTOR *sector = Room_GetSector(x, ytop, z, &room_num);
|
||||||
int32_t height = Room_GetHeight(sector, x, ytop, z);
|
int32_t height = Room_GetHeight(sector, x, ytop, z);
|
||||||
int32_t room_height = height;
|
int32_t room_height = height;
|
||||||
if (height != NO_HEIGHT) {
|
if (height != NO_HEIGHT) {
|
||||||
|
@ -342,8 +342,8 @@ bool Collide_CollideStaticObjects(
|
||||||
|
|
||||||
for (int i = 0; i < g_RoomsToDrawCount; i++) {
|
for (int i = 0; i < g_RoomsToDrawCount; i++) {
|
||||||
int16_t room_num = g_RoomsToDraw[i];
|
int16_t room_num = g_RoomsToDraw[i];
|
||||||
ROOM_INFO *r = &g_RoomInfo[room_num];
|
ROOM *r = &g_RoomInfo[room_num];
|
||||||
MESH_INFO *mesh = r->mesh;
|
MESH *mesh = r->mesh;
|
||||||
|
|
||||||
for (int j = 0; j < r->num_meshes; j++, mesh++) {
|
for (int j = 0; j < r->num_meshes; j++, mesh++) {
|
||||||
STATIC_INFO *sinfo = &g_StaticObjects[mesh->static_num];
|
STATIC_INFO *sinfo = &g_StaticObjects[mesh->static_num];
|
||||||
|
@ -485,7 +485,7 @@ bool Collide_CollideStaticObjects(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Collide_GetSpheres(ITEM_INFO *item, SPHERE *ptr, int32_t world_space)
|
int32_t Collide_GetSpheres(ITEM *item, SPHERE *ptr, int32_t world_space)
|
||||||
{
|
{
|
||||||
static int16_t null_rotation[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
static int16_t null_rotation[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||||
|
|
||||||
|
@ -517,7 +517,7 @@ int32_t Collide_GetSpheres(ITEM_INFO *item, SPHERE *ptr, int32_t world_space)
|
||||||
int32_t *packed_rotation = frame->mesh_rots;
|
int32_t *packed_rotation = frame->mesh_rots;
|
||||||
Matrix_RotYXZpack(*packed_rotation++);
|
Matrix_RotYXZpack(*packed_rotation++);
|
||||||
|
|
||||||
OBJECT_INFO *object = &g_Objects[item->object_id];
|
OBJECT *object = &g_Objects[item->object_id];
|
||||||
int16_t **meshpp = &g_Meshes[object->mesh_idx];
|
int16_t **meshpp = &g_Meshes[object->mesh_idx];
|
||||||
int32_t *bone = &g_AnimBones[object->bone_idx];
|
int32_t *bone = &g_AnimBones[object->bone_idx];
|
||||||
|
|
||||||
|
@ -571,7 +571,7 @@ int32_t Collide_GetSpheres(ITEM_INFO *item, SPHERE *ptr, int32_t world_space)
|
||||||
return object->nmeshes;
|
return object->nmeshes;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Collide_TestCollision(ITEM_INFO *item, ITEM_INFO *lara_item)
|
int32_t Collide_TestCollision(ITEM *item, ITEM *lara_item)
|
||||||
{
|
{
|
||||||
SPHERE slist_baddie[34];
|
SPHERE slist_baddie[34];
|
||||||
SPHERE slist_lara[34];
|
SPHERE slist_lara[34];
|
||||||
|
@ -607,9 +607,9 @@ int32_t Collide_TestCollision(ITEM_INFO *item, ITEM_INFO *lara_item)
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Collide_GetJointAbsPosition(ITEM_INFO *item, XYZ_32 *vec, int32_t joint)
|
void Collide_GetJointAbsPosition(ITEM *item, XYZ_32 *vec, int32_t joint)
|
||||||
{
|
{
|
||||||
OBJECT_INFO *object = &g_Objects[item->object_id];
|
OBJECT *object = &g_Objects[item->object_id];
|
||||||
|
|
||||||
Matrix_PushUnit();
|
Matrix_PushUnit();
|
||||||
Matrix_RotYXZ(item->rot.y, item->rot.x, item->rot.z);
|
Matrix_RotYXZ(item->rot.y, item->rot.x, item->rot.z);
|
||||||
|
|
|
@ -13,8 +13,8 @@ bool Collide_CollideStaticObjects(
|
||||||
COLL_INFO *coll, int32_t x, int32_t y, int32_t z, int16_t room_num,
|
COLL_INFO *coll, int32_t x, int32_t y, int32_t z, int16_t room_num,
|
||||||
int32_t height);
|
int32_t height);
|
||||||
|
|
||||||
int32_t Collide_GetSpheres(ITEM_INFO *item, SPHERE *slist, int32_t world_space);
|
int32_t Collide_GetSpheres(ITEM *item, SPHERE *slist, int32_t world_space);
|
||||||
|
|
||||||
int32_t Collide_TestCollision(ITEM_INFO *item, ITEM_INFO *lara_item);
|
int32_t Collide_TestCollision(ITEM *item, ITEM *lara_item);
|
||||||
|
|
||||||
void Collide_GetJointAbsPosition(ITEM_INFO *item, XYZ_32 *vec, int32_t joint);
|
void Collide_GetJointAbsPosition(ITEM *item, XYZ_32 *vec, int32_t joint);
|
||||||
|
|
|
@ -30,16 +30,16 @@ static bool M_TestSwitchOrKill(int16_t item_num, GAME_OBJECT_ID target_id);
|
||||||
|
|
||||||
void Creature_Initialise(int16_t item_num)
|
void Creature_Initialise(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
item->rot.y += (PHD_ANGLE)((Random_GetControl() - PHD_90) >> 1);
|
item->rot.y += (PHD_ANGLE)((Random_GetControl() - PHD_90) >> 1);
|
||||||
item->collidable = 1;
|
item->collidable = 1;
|
||||||
item->data = NULL;
|
item->data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature_AIInfo(ITEM_INFO *item, AI_INFO *info)
|
void Creature_AIInfo(ITEM *item, AI_INFO *info)
|
||||||
{
|
{
|
||||||
CREATURE_INFO *creature = item->data;
|
CREATURE *creature = item->data;
|
||||||
if (!creature) {
|
if (!creature) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ void Creature_AIInfo(ITEM_INFO *item, AI_INFO *info)
|
||||||
zone = g_GroundZone2[g_FlipStatus];
|
zone = g_GroundZone2[g_FlipStatus];
|
||||||
}
|
}
|
||||||
|
|
||||||
const ROOM_INFO *r = &g_RoomInfo[item->room_num];
|
const ROOM *r = &g_RoomInfo[item->room_num];
|
||||||
int32_t z_sector = (item->pos.z - r->z) >> WALL_SHIFT;
|
int32_t z_sector = (item->pos.z - r->z) >> WALL_SHIFT;
|
||||||
int32_t x_sector = (item->pos.x - r->x) >> WALL_SHIFT;
|
int32_t x_sector = (item->pos.x - r->x) >> WALL_SHIFT;
|
||||||
item->box_num = r->sectors[z_sector + x_sector * r->z_size].box;
|
item->box_num = r->sectors[z_sector + x_sector * r->z_size].box;
|
||||||
|
@ -73,7 +73,7 @@ void Creature_AIInfo(ITEM_INFO *item, AI_INFO *info)
|
||||||
info->enemy_zone |= BLOCKED;
|
info->enemy_zone |= BLOCKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJECT_INFO *object = &g_Objects[item->object_id];
|
OBJECT *object = &g_Objects[item->object_id];
|
||||||
int32_t z = g_LaraItem->pos.z
|
int32_t z = g_LaraItem->pos.z
|
||||||
- ((Math_Cos(item->rot.y) * object->pivot_length) >> W2V_SHIFT)
|
- ((Math_Cos(item->rot.y) * object->pivot_length) >> W2V_SHIFT)
|
||||||
- item->pos.z;
|
- item->pos.z;
|
||||||
|
@ -93,9 +93,9 @@ void Creature_AIInfo(ITEM_INFO *item, AI_INFO *info)
|
||||||
&& (g_LaraItem->pos.y < item->pos.y + STEP_L);
|
&& (g_LaraItem->pos.y < item->pos.y + STEP_L);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature_Mood(ITEM_INFO *item, AI_INFO *info, bool violent)
|
void Creature_Mood(ITEM *item, AI_INFO *info, bool violent)
|
||||||
{
|
{
|
||||||
CREATURE_INFO *creature = item->data;
|
CREATURE *creature = item->data;
|
||||||
if (!creature) {
|
if (!creature) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -259,9 +259,9 @@ void Creature_Mood(ITEM_INFO *item, AI_INFO *info, bool violent)
|
||||||
Box_CalculateTarget(&creature->target, item, &creature->lot);
|
Box_CalculateTarget(&creature->target, item, &creature->lot);
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t Creature_Turn(ITEM_INFO *item, int16_t maximum_turn)
|
int16_t Creature_Turn(ITEM *item, int16_t maximum_turn)
|
||||||
{
|
{
|
||||||
CREATURE_INFO *creature = item->data;
|
CREATURE *creature = item->data;
|
||||||
if (!creature) {
|
if (!creature) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,7 @@ int16_t Creature_Turn(ITEM_INFO *item, int16_t maximum_turn)
|
||||||
return angle;
|
return angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature_Tilt(ITEM_INFO *item, int16_t angle)
|
void Creature_Tilt(ITEM *item, int16_t angle)
|
||||||
{
|
{
|
||||||
angle = angle * 4 - item->rot.z;
|
angle = angle * 4 - item->rot.z;
|
||||||
if (angle < -MAX_TILT) {
|
if (angle < -MAX_TILT) {
|
||||||
|
@ -303,9 +303,9 @@ void Creature_Tilt(ITEM_INFO *item, int16_t angle)
|
||||||
item->rot.z += angle;
|
item->rot.z += angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature_Head(ITEM_INFO *item, int16_t required)
|
void Creature_Head(ITEM *item, int16_t required)
|
||||||
{
|
{
|
||||||
CREATURE_INFO *creature = item->data;
|
CREATURE *creature = item->data;
|
||||||
if (!creature) {
|
if (!creature) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -327,7 +327,7 @@ void Creature_Head(ITEM_INFO *item, int16_t required)
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t Creature_Effect(
|
int16_t Creature_Effect(
|
||||||
ITEM_INFO *item, BITE_INFO *bite,
|
ITEM *item, BITE *bite,
|
||||||
int16_t (*spawn)(
|
int16_t (*spawn)(
|
||||||
int32_t x, int32_t y, int32_t z, int16_t speed, int16_t yrot,
|
int32_t x, int32_t y, int32_t z, int16_t speed, int16_t yrot,
|
||||||
int16_t room_num))
|
int16_t room_num))
|
||||||
|
@ -343,7 +343,7 @@ int16_t Creature_Effect(
|
||||||
|
|
||||||
bool Creature_CheckBaddieOverlap(int16_t item_num)
|
bool Creature_CheckBaddieOverlap(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
int32_t x = item->pos.x;
|
int32_t x = item->pos.x;
|
||||||
int32_t y = item->pos.y;
|
int32_t y = item->pos.y;
|
||||||
|
@ -373,9 +373,9 @@ bool Creature_CheckBaddieOverlap(int16_t item_num)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Creature_Collision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
void Creature_Collision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (!Lara_TestBoundsCollide(item, coll->radius)) {
|
if (!Lara_TestBoundsCollide(item, coll->radius)) {
|
||||||
return;
|
return;
|
||||||
|
@ -395,8 +395,8 @@ void Creature_Collision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
|
|
||||||
bool Creature_Animate(int16_t item_num, int16_t angle, int16_t tilt)
|
bool Creature_Animate(int16_t item_num, int16_t angle, int16_t tilt)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
CREATURE_INFO *creature = item->data;
|
CREATURE *creature = item->data;
|
||||||
if (!creature) {
|
if (!creature) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -433,7 +433,7 @@ bool Creature_Animate(int16_t item_num, int16_t angle, int16_t tilt)
|
||||||
int32_t y = item->pos.y + bounds->min.y;
|
int32_t y = item->pos.y + bounds->min.y;
|
||||||
|
|
||||||
int16_t room_num = item->room_num;
|
int16_t room_num = item->room_num;
|
||||||
const SECTOR_INFO *sector =
|
const SECTOR *sector =
|
||||||
Room_GetSector(item->pos.x, y, item->pos.z, &room_num);
|
Room_GetSector(item->pos.x, y, item->pos.z, &room_num);
|
||||||
int32_t height = g_Boxes[sector->box].height;
|
int32_t height = g_Boxes[sector->box].height;
|
||||||
int16_t next_box = lot->node[sector->box].exit_box;
|
int16_t next_box = lot->node[sector->box].exit_box;
|
||||||
|
@ -660,7 +660,7 @@ bool Creature_Animate(int16_t item_num, int16_t angle, int16_t tilt)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Creature_CanTargetEnemy(ITEM_INFO *item, AI_INFO *info)
|
bool Creature_CanTargetEnemy(ITEM *item, AI_INFO *info)
|
||||||
{
|
{
|
||||||
if (!info->ahead || info->distance >= CREATURE_SHOOT_RANGE) {
|
if (!info->ahead || info->distance >= CREATURE_SHOOT_RANGE) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -681,7 +681,7 @@ bool Creature_CanTargetEnemy(ITEM_INFO *item, AI_INFO *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Creature_ShootAtLara(
|
bool Creature_ShootAtLara(
|
||||||
ITEM_INFO *item, int32_t distance, BITE_INFO *gun, int16_t extra_rotation,
|
ITEM *item, int32_t distance, BITE *gun, int16_t extra_rotation,
|
||||||
int16_t damage)
|
int16_t damage)
|
||||||
{
|
{
|
||||||
bool hit;
|
bool hit;
|
||||||
|
@ -717,7 +717,7 @@ bool Creature_EnsureHabitat(
|
||||||
{
|
{
|
||||||
// Test the environment for a hybrid creature. Record the water height and
|
// Test the environment for a hybrid creature. Record the water height and
|
||||||
// return whether or not a type conversion has taken place.
|
// return whether or not a type conversion has taken place.
|
||||||
const ITEM_INFO *const item = &g_Items[item_num];
|
const ITEM *const item = &g_Items[item_num];
|
||||||
*wh = Room_GetWaterHeight(
|
*wh = Room_GetWaterHeight(
|
||||||
item->pos.x, item->pos.y, item->pos.z, item->room_num);
|
item->pos.x, item->pos.y, item->pos.z, item->room_num);
|
||||||
|
|
||||||
|
@ -728,7 +728,7 @@ bool Creature_EnsureHabitat(
|
||||||
|
|
||||||
bool Creature_IsBoss(const int16_t item_num)
|
bool Creature_IsBoss(const int16_t item_num)
|
||||||
{
|
{
|
||||||
const ITEM_INFO *const item = &g_Items[item_num];
|
const ITEM *const item = &g_Items[item_num];
|
||||||
return Object_IsObjectType(item->object_id, g_BossObjects);
|
return Object_IsObjectType(item->object_id, g_BossObjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -740,7 +740,7 @@ static bool M_SwitchToWater(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_INFO *const item = &g_Items[item_num];
|
ITEM *const item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
// Dead land creatures should remain in their pose permanently.
|
// Dead land creatures should remain in their pose permanently.
|
||||||
|
@ -774,7 +774,7 @@ static bool M_SwitchToLand(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_INFO *const item = &g_Items[item_num];
|
ITEM *const item = &g_Items[item_num];
|
||||||
|
|
||||||
// Switch to the land creature regardless of death state.
|
// Switch to the land creature regardless of death state.
|
||||||
item->object_id = info->land.id;
|
item->object_id = info->land.id;
|
||||||
|
@ -791,7 +791,7 @@ static bool M_SwitchToLand(
|
||||||
item->goal_anim_state = item->current_anim_state;
|
item->goal_anim_state = item->current_anim_state;
|
||||||
|
|
||||||
int16_t room_num = item->room_num;
|
int16_t room_num = item->room_num;
|
||||||
const SECTOR_INFO *const sector =
|
const SECTOR *const sector =
|
||||||
Room_GetSector(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
Room_GetSector(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
item->floor =
|
item->floor =
|
||||||
Room_GetHeight(sector, item->pos.x, item->pos.y, item->pos.z);
|
Room_GetHeight(sector, item->pos.x, item->pos.y, item->pos.z);
|
||||||
|
@ -819,12 +819,12 @@ static bool M_TestSwitchOrKill(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Creature_IsEnemy(const ITEM_INFO *const item)
|
bool Creature_IsEnemy(const ITEM *const item)
|
||||||
{
|
{
|
||||||
return Object_IsObjectType(item->object_id, g_EnemyObjects);
|
return Object_IsObjectType(item->object_id, g_EnemyObjects);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Creature_IsAlly(const ITEM_INFO *const item)
|
bool Creature_IsAlly(const ITEM *const item)
|
||||||
{
|
{
|
||||||
return Object_IsObjectType(item->object_id, g_AllyObjects);
|
return Object_IsObjectType(item->object_id, g_AllyObjects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#define CREATURE_SHOOT_RANGE SQUARE(WALL_L * 7) // = 51380224
|
#define CREATURE_SHOOT_RANGE SQUARE(WALL_L * 7) // = 51380224
|
||||||
#define CREATURE_MISS_CHANCE 0x2000
|
#define CREATURE_MISS_CHANCE 0x2000
|
||||||
|
|
||||||
typedef struct HYBRID_INFO {
|
typedef struct {
|
||||||
struct {
|
struct {
|
||||||
GAME_OBJECT_ID id;
|
GAME_OBJECT_ID id;
|
||||||
int16_t active_anim;
|
int16_t active_anim;
|
||||||
|
@ -25,23 +25,22 @@ typedef struct HYBRID_INFO {
|
||||||
} HYBRID_INFO;
|
} HYBRID_INFO;
|
||||||
|
|
||||||
void Creature_Initialise(int16_t item_num);
|
void Creature_Initialise(int16_t item_num);
|
||||||
void Creature_AIInfo(ITEM_INFO *item, AI_INFO *info);
|
void Creature_AIInfo(ITEM *item, AI_INFO *info);
|
||||||
void Creature_Mood(ITEM_INFO *item, AI_INFO *info, bool violent);
|
void Creature_Mood(ITEM *item, AI_INFO *info, bool violent);
|
||||||
int16_t Creature_Turn(ITEM_INFO *item, int16_t maximum_turn);
|
int16_t Creature_Turn(ITEM *item, int16_t maximum_turn);
|
||||||
void Creature_Tilt(ITEM_INFO *item, int16_t angle);
|
void Creature_Tilt(ITEM *item, int16_t angle);
|
||||||
void Creature_Head(ITEM_INFO *item, int16_t required);
|
void Creature_Head(ITEM *item, int16_t required);
|
||||||
int16_t Creature_Effect(
|
int16_t Creature_Effect(
|
||||||
ITEM_INFO *item, BITE_INFO *bite,
|
ITEM *item, BITE *bite,
|
||||||
int16_t (*spawn)(
|
int16_t (*spawn)(
|
||||||
int32_t x, int32_t y, int32_t z, int16_t speed, int16_t yrot,
|
int32_t x, int32_t y, int32_t z, int16_t speed, int16_t yrot,
|
||||||
int16_t room_num));
|
int16_t room_num));
|
||||||
bool Creature_CheckBaddieOverlap(int16_t item_num);
|
bool Creature_CheckBaddieOverlap(int16_t item_num);
|
||||||
void Creature_Collision(
|
void Creature_Collision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll);
|
||||||
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
|
||||||
bool Creature_Animate(int16_t item_num, int16_t angle, int16_t tilt);
|
bool Creature_Animate(int16_t item_num, int16_t angle, int16_t tilt);
|
||||||
bool Creature_CanTargetEnemy(ITEM_INFO *item, AI_INFO *info);
|
bool Creature_CanTargetEnemy(ITEM *item, AI_INFO *info);
|
||||||
bool Creature_ShootAtLara(
|
bool Creature_ShootAtLara(
|
||||||
ITEM_INFO *item, int32_t distance, BITE_INFO *gun, int16_t extra_rotation,
|
ITEM *item, int32_t distance, BITE *gun, int16_t extra_rotation,
|
||||||
int16_t damage);
|
int16_t damage);
|
||||||
bool Creature_EnsureHabitat(
|
bool Creature_EnsureHabitat(
|
||||||
int16_t item_num, int32_t *wh, const HYBRID_INFO *info);
|
int16_t item_num, int32_t *wh, const HYBRID_INFO *info);
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void FX_Bubbles(ITEM_INFO *item)
|
void FX_Bubbles(ITEM *item)
|
||||||
{
|
{
|
||||||
// XXX: until we get Robolara, it makes sense for her to breathe underwater
|
// XXX: until we get Robolara, it makes sense for her to breathe underwater
|
||||||
if (g_Lara.water_status == LWS_CHEAT
|
if (g_Lara.water_status == LWS_CHEAT
|
||||||
|
@ -34,7 +34,7 @@ void FX_Bubbles(ITEM_INFO *item)
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
int16_t fx_num = Effect_Create(item->room_num);
|
int16_t fx_num = Effect_Create(item->room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO *fx = &g_Effects[fx_num];
|
FX *fx = &g_Effects[fx_num];
|
||||||
fx->pos.x = offset.x;
|
fx->pos.x = offset.x;
|
||||||
fx->pos.y = offset.y;
|
fx->pos.y = offset.y;
|
||||||
fx->pos.z = offset.z;
|
fx->pos.z = offset.z;
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_Bubbles(ITEM_INFO *item);
|
void FX_Bubbles(ITEM *item);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
void FX_ChainBlock(ITEM_INFO *item)
|
void FX_ChainBlock(ITEM *item)
|
||||||
{
|
{
|
||||||
if (g_Config.fix_tihocan_secret_sound) {
|
if (g_Config.fix_tihocan_secret_sound) {
|
||||||
if (g_FlipTimer == 0) {
|
if (g_FlipTimer == 0) {
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_ChainBlock(ITEM_INFO *item);
|
void FX_ChainBlock(ITEM *item);
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#define MAX_BOUNCE 100
|
#define MAX_BOUNCE 100
|
||||||
|
|
||||||
void FX_DinoStomp(ITEM_INFO *item)
|
void FX_DinoStomp(ITEM *item)
|
||||||
{
|
{
|
||||||
int32_t dx = item->pos.x - g_Camera.pos.x;
|
int32_t dx = item->pos.x - g_Camera.pos.x;
|
||||||
int32_t dy = item->pos.y - g_Camera.pos.y;
|
int32_t dy = item->pos.y - g_Camera.pos.y;
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_DinoStomp(ITEM_INFO *item);
|
void FX_DinoStomp(ITEM *item);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
void FX_Earthquake(ITEM_INFO *item)
|
void FX_Earthquake(ITEM *item)
|
||||||
{
|
{
|
||||||
if (g_FlipTimer == 0) {
|
if (g_FlipTimer == 0) {
|
||||||
Sound_Effect(SFX_EXPLOSION, NULL, SPM_NORMAL);
|
Sound_Effect(SFX_EXPLOSION, NULL, SPM_NORMAL);
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_Earthquake(ITEM_INFO *item);
|
void FX_Earthquake(ITEM *item);
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
void FX_Explosion(ITEM_INFO *item)
|
void FX_Explosion(ITEM *item)
|
||||||
{
|
{
|
||||||
Sound_Effect(SFX_EXPLOSION_FX, NULL, SPM_NORMAL);
|
Sound_Effect(SFX_EXPLOSION_FX, NULL, SPM_NORMAL);
|
||||||
g_Camera.bounce = -75;
|
g_Camera.bounce = -75;
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_Explosion(ITEM_INFO *item);
|
void FX_Explosion(ITEM *item);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
void FX_FinishLevel(ITEM_INFO *item)
|
void FX_FinishLevel(ITEM *item)
|
||||||
{
|
{
|
||||||
g_LevelComplete = true;
|
g_LevelComplete = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_FinishLevel(ITEM_INFO *item);
|
void FX_FinishLevel(ITEM *item);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "game/room.h"
|
#include "game/room.h"
|
||||||
|
|
||||||
void FX_Flicker(ITEM_INFO *item)
|
void FX_Flicker(ITEM *item)
|
||||||
{
|
{
|
||||||
if (g_FlipTimer > 125) {
|
if (g_FlipTimer > 125) {
|
||||||
Room_FlipMap();
|
Room_FlipMap();
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_Flicker(ITEM_INFO *item);
|
void FX_Flicker(ITEM *item);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "game/room.h"
|
#include "game/room.h"
|
||||||
|
|
||||||
void FX_FlipMap(ITEM_INFO *item)
|
void FX_FlipMap(ITEM *item)
|
||||||
{
|
{
|
||||||
Room_FlipMap();
|
Room_FlipMap();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_FlipMap(ITEM_INFO *item);
|
void FX_FlipMap(ITEM *item);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void FX_Flood(ITEM_INFO *item)
|
void FX_Flood(ITEM *item)
|
||||||
{
|
{
|
||||||
if (g_FlipTimer > LOGIC_FPS * 4) {
|
if (g_FlipTimer > LOGIC_FPS * 4) {
|
||||||
g_FlipEffect = -1;
|
g_FlipEffect = -1;
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_Flood(ITEM_INFO *item);
|
void FX_Flood(ITEM *item);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void FX_LaraNormal(ITEM_INFO *item)
|
void FX_LaraNormal(ITEM *item)
|
||||||
{
|
{
|
||||||
item->current_anim_state = LS_STOP;
|
item->current_anim_state = LS_STOP;
|
||||||
item->goal_anim_state = LS_STOP;
|
item->goal_anim_state = LS_STOP;
|
||||||
|
@ -17,16 +17,16 @@ void FX_LaraNormal(ITEM_INFO *item)
|
||||||
Viewport_SetFOV(Viewport_GetUserFOV());
|
Viewport_SetFOV(Viewport_GetUserFOV());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FX_LaraHandsFree(ITEM_INFO *item)
|
void FX_LaraHandsFree(ITEM *item)
|
||||||
{
|
{
|
||||||
g_Lara.gun_status = LGS_ARMLESS;
|
g_Lara.gun_status = LGS_ARMLESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FX_LaraDrawRightGun(ITEM_INFO *item)
|
void FX_LaraDrawRightGun(ITEM *item)
|
||||||
{
|
{
|
||||||
int16_t *tmp_mesh;
|
int16_t *tmp_mesh;
|
||||||
OBJECT_INFO *obj = &g_Objects[item->object_id];
|
OBJECT *obj = &g_Objects[item->object_id];
|
||||||
OBJECT_INFO *obj2 = &g_Objects[O_PISTOL_ANIM];
|
OBJECT *obj2 = &g_Objects[O_PISTOL_ANIM];
|
||||||
|
|
||||||
SWAP(
|
SWAP(
|
||||||
g_Meshes[obj->mesh_idx + LM_THIGH_R],
|
g_Meshes[obj->mesh_idx + LM_THIGH_R],
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_LaraNormal(ITEM_INFO *item);
|
void FX_LaraNormal(ITEM *item);
|
||||||
void FX_LaraHandsFree(ITEM_INFO *item);
|
void FX_LaraHandsFree(ITEM *item);
|
||||||
void FX_LaraDrawRightGun(ITEM_INFO *item);
|
void FX_LaraDrawRightGun(ITEM *item);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "global/const.h"
|
#include "global/const.h"
|
||||||
#include "global/vars.h"
|
#include "global/vars.h"
|
||||||
|
|
||||||
void FX_PowerUp(ITEM_INFO *item)
|
void FX_PowerUp(ITEM *item)
|
||||||
{
|
{
|
||||||
if (g_FlipTimer > LOGIC_FPS * 4) {
|
if (g_FlipTimer > LOGIC_FPS * 4) {
|
||||||
g_FlipEffect = -1;
|
g_FlipEffect = -1;
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_PowerUp(ITEM_INFO *item);
|
void FX_PowerUp(ITEM *item);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
void FX_RaisingBlock(ITEM_INFO *item)
|
void FX_RaisingBlock(ITEM *item)
|
||||||
{
|
{
|
||||||
Sound_Effect(SFX_RAISINGBLOCK_FX, NULL, SPM_NORMAL);
|
Sound_Effect(SFX_RAISINGBLOCK_FX, NULL, SPM_NORMAL);
|
||||||
g_FlipEffect = -1;
|
g_FlipEffect = -1;
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_RaisingBlock(ITEM_INFO *item);
|
void FX_RaisingBlock(ITEM *item);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
void FX_DropSand(ITEM_INFO *item)
|
void FX_DropSand(ITEM *item)
|
||||||
{
|
{
|
||||||
if (g_FlipTimer > LOGIC_FPS * 4) {
|
if (g_FlipTimer > LOGIC_FPS * 4) {
|
||||||
g_FlipEffect = -1;
|
g_FlipEffect = -1;
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_DropSand(ITEM_INFO *item);
|
void FX_DropSand(ITEM *item);
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
void FX_Stairs2Slope(ITEM_INFO *item)
|
void FX_Stairs2Slope(ITEM *item)
|
||||||
{
|
{
|
||||||
if (g_FlipTimer == 5) {
|
if (g_FlipTimer == 5) {
|
||||||
Sound_Effect(SFX_STAIRS2SLOPE_FX, NULL, SPM_NORMAL);
|
Sound_Effect(SFX_STAIRS2SLOPE_FX, NULL, SPM_NORMAL);
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_Stairs2Slope(ITEM_INFO *item);
|
void FX_Stairs2Slope(ITEM *item);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include "global/const.h"
|
#include "global/const.h"
|
||||||
|
|
||||||
void FX_Turn180(ITEM_INFO *item)
|
void FX_Turn180(ITEM *item)
|
||||||
{
|
{
|
||||||
item->rot.y += PHD_180;
|
item->rot.y += PHD_180;
|
||||||
item->rot.x *= -1;
|
item->rot.x *= -1;
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void FX_Turn180(ITEM_INFO *item);
|
void FX_Turn180(ITEM *item);
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
FX_INFO *g_Effects = NULL;
|
FX *g_Effects = NULL;
|
||||||
int16_t g_NextFxActive = NO_ITEM;
|
int16_t g_NextFxActive = NO_ITEM;
|
||||||
|
|
||||||
static int16_t m_NextFxFree = NO_ITEM;
|
static int16_t m_NextFxFree = NO_ITEM;
|
||||||
|
@ -30,8 +30,8 @@ void Effect_Control(void)
|
||||||
{
|
{
|
||||||
int16_t fx_num = g_NextFxActive;
|
int16_t fx_num = g_NextFxActive;
|
||||||
while (fx_num != NO_ITEM) {
|
while (fx_num != NO_ITEM) {
|
||||||
FX_INFO *fx = &g_Effects[fx_num];
|
FX *fx = &g_Effects[fx_num];
|
||||||
OBJECT_INFO *obj = &g_Objects[fx->object_id];
|
OBJECT *obj = &g_Objects[fx->object_id];
|
||||||
if (obj->control) {
|
if (obj->control) {
|
||||||
obj->control(fx_num);
|
obj->control(fx_num);
|
||||||
}
|
}
|
||||||
|
@ -46,10 +46,10 @@ int16_t Effect_Create(int16_t room_num)
|
||||||
return fx_num;
|
return fx_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_INFO *fx = &g_Effects[fx_num];
|
FX *fx = &g_Effects[fx_num];
|
||||||
m_NextFxFree = fx->next_free;
|
m_NextFxFree = fx->next_free;
|
||||||
|
|
||||||
ROOM_INFO *r = &g_RoomInfo[room_num];
|
ROOM *r = &g_RoomInfo[room_num];
|
||||||
fx->room_num = room_num;
|
fx->room_num = room_num;
|
||||||
fx->next_draw = r->fx_num;
|
fx->next_draw = r->fx_num;
|
||||||
r->fx_num = fx_num;
|
r->fx_num = fx_num;
|
||||||
|
@ -62,14 +62,14 @@ int16_t Effect_Create(int16_t room_num)
|
||||||
|
|
||||||
void Effect_Kill(int16_t fx_num)
|
void Effect_Kill(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO *fx = &g_Effects[fx_num];
|
FX *fx = &g_Effects[fx_num];
|
||||||
|
|
||||||
if (g_NextFxActive == fx_num) {
|
if (g_NextFxActive == fx_num) {
|
||||||
g_NextFxActive = fx->next_active;
|
g_NextFxActive = fx->next_active;
|
||||||
} else {
|
} else {
|
||||||
int16_t linknum = g_NextFxActive;
|
int16_t linknum = g_NextFxActive;
|
||||||
while (linknum != NO_ITEM) {
|
while (linknum != NO_ITEM) {
|
||||||
FX_INFO *fx_link = &g_Effects[linknum];
|
FX *fx_link = &g_Effects[linknum];
|
||||||
if (fx_link->next_active == fx_num) {
|
if (fx_link->next_active == fx_num) {
|
||||||
fx_link->next_active = fx->next_active;
|
fx_link->next_active = fx->next_active;
|
||||||
}
|
}
|
||||||
|
@ -77,13 +77,13 @@ void Effect_Kill(int16_t fx_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOM_INFO *r = &g_RoomInfo[fx->room_num];
|
ROOM *r = &g_RoomInfo[fx->room_num];
|
||||||
if (r->fx_num == fx_num) {
|
if (r->fx_num == fx_num) {
|
||||||
r->fx_num = fx->next_draw;
|
r->fx_num = fx->next_draw;
|
||||||
} else {
|
} else {
|
||||||
int16_t linknum = r->fx_num;
|
int16_t linknum = r->fx_num;
|
||||||
while (linknum != NO_ITEM) {
|
while (linknum != NO_ITEM) {
|
||||||
FX_INFO *fx_link = &g_Effects[linknum];
|
FX *fx_link = &g_Effects[linknum];
|
||||||
if (fx_link->next_draw == fx_num) {
|
if (fx_link->next_draw == fx_num) {
|
||||||
fx_link->next_draw = fx->next_draw;
|
fx_link->next_draw = fx->next_draw;
|
||||||
break;
|
break;
|
||||||
|
@ -98,8 +98,8 @@ void Effect_Kill(int16_t fx_num)
|
||||||
|
|
||||||
void Effect_NewRoom(int16_t fx_num, int16_t room_num)
|
void Effect_NewRoom(int16_t fx_num, int16_t room_num)
|
||||||
{
|
{
|
||||||
FX_INFO *fx = &g_Effects[fx_num];
|
FX *fx = &g_Effects[fx_num];
|
||||||
ROOM_INFO *r = &g_RoomInfo[fx->room_num];
|
ROOM *r = &g_RoomInfo[fx->room_num];
|
||||||
|
|
||||||
int16_t linknum = r->fx_num;
|
int16_t linknum = r->fx_num;
|
||||||
if (linknum == fx_num) {
|
if (linknum == fx_num) {
|
||||||
|
@ -121,8 +121,8 @@ void Effect_NewRoom(int16_t fx_num, int16_t room_num)
|
||||||
|
|
||||||
void Effect_Draw(const int16_t fxnum)
|
void Effect_Draw(const int16_t fxnum)
|
||||||
{
|
{
|
||||||
const FX_INFO *const fx = &g_Effects[fxnum];
|
const FX *const fx = &g_Effects[fxnum];
|
||||||
const OBJECT_INFO *const object = &g_Objects[fx->object_id];
|
const OBJECT *const object = &g_Objects[fx->object_id];
|
||||||
if (!object->loaded) {
|
if (!object->loaded) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
extern FX_INFO *g_Effects;
|
extern FX *g_Effects;
|
||||||
extern int16_t g_NextFxActive;
|
extern int16_t g_NextFxActive;
|
||||||
|
|
||||||
void Effect_InitialiseArray(void);
|
void Effect_InitialiseArray(void);
|
||||||
|
|
|
@ -10,7 +10,7 @@ int16_t Effect_Blood(
|
||||||
{
|
{
|
||||||
int16_t fx_num = Effect_Create(room_num);
|
int16_t fx_num = Effect_Create(room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO *fx = &g_Effects[fx_num];
|
FX *fx = &g_Effects[fx_num];
|
||||||
fx->pos.x = x;
|
fx->pos.x = x;
|
||||||
fx->pos.y = y;
|
fx->pos.y = y;
|
||||||
fx->pos.z = z;
|
fx->pos.z = z;
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
int32_t Effect_ExplodingDeath(
|
int32_t Effect_ExplodingDeath(
|
||||||
int16_t item_num, int32_t mesh_bits, int16_t damage)
|
int16_t item_num, int32_t mesh_bits, int16_t damage)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
OBJECT_INFO *object = &g_Objects[item->object_id];
|
OBJECT *object = &g_Objects[item->object_id];
|
||||||
|
|
||||||
const FRAME_INFO *const frame = Item_GetBestFrame(item);
|
const FRAME_INFO *const frame = Item_GetBestFrame(item);
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ int32_t Effect_ExplodingDeath(
|
||||||
if ((bit & mesh_bits) && (bit & item->mesh_bits)) {
|
if ((bit & mesh_bits) && (bit & item->mesh_bits)) {
|
||||||
int16_t fx_num = Effect_Create(item->room_num);
|
int16_t fx_num = Effect_Create(item->room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO *fx = &g_Effects[fx_num];
|
FX *fx = &g_Effects[fx_num];
|
||||||
fx->room_num = item->room_num;
|
fx->room_num = item->room_num;
|
||||||
fx->pos.x = (g_MatrixPtr->_03 >> W2V_SHIFT) + item->pos.x;
|
fx->pos.x = (g_MatrixPtr->_03 >> W2V_SHIFT) + item->pos.x;
|
||||||
fx->pos.y = (g_MatrixPtr->_13 >> W2V_SHIFT) + item->pos.y;
|
fx->pos.y = (g_MatrixPtr->_13 >> W2V_SHIFT) + item->pos.y;
|
||||||
|
@ -86,7 +86,7 @@ int32_t Effect_ExplodingDeath(
|
||||||
if ((bit & mesh_bits) && (bit & item->mesh_bits)) {
|
if ((bit & mesh_bits) && (bit & item->mesh_bits)) {
|
||||||
int16_t fx_num = Effect_Create(item->room_num);
|
int16_t fx_num = Effect_Create(item->room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO *fx = &g_Effects[fx_num];
|
FX *fx = &g_Effects[fx_num];
|
||||||
fx->room_num = item->room_num;
|
fx->room_num = item->room_num;
|
||||||
fx->pos.x = (g_MatrixPtr->_03 >> W2V_SHIFT) + item->pos.x;
|
fx->pos.x = (g_MatrixPtr->_03 >> W2V_SHIFT) + item->pos.x;
|
||||||
fx->pos.y = (g_MatrixPtr->_13 >> W2V_SHIFT) + item->pos.y;
|
fx->pos.y = (g_MatrixPtr->_13 >> W2V_SHIFT) + item->pos.y;
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
#define SHARD_SPEED 250
|
#define SHARD_SPEED 250
|
||||||
#define ROCKET_SPEED 220
|
#define ROCKET_SPEED 220
|
||||||
|
|
||||||
static void M_ShootAtLara(FX_INFO *fx);
|
static void M_ShootAtLara(FX *fx);
|
||||||
|
|
||||||
void M_ShootAtLara(FX_INFO *fx)
|
void M_ShootAtLara(FX *fx)
|
||||||
{
|
{
|
||||||
int32_t x = g_LaraItem->pos.x - fx->pos.x;
|
int32_t x = g_LaraItem->pos.x - fx->pos.x;
|
||||||
int32_t y = g_LaraItem->pos.y - fx->pos.y;
|
int32_t y = g_LaraItem->pos.y - fx->pos.y;
|
||||||
|
@ -36,7 +36,7 @@ int16_t Effect_ShardGun(
|
||||||
{
|
{
|
||||||
int16_t fx_num = Effect_Create(room_num);
|
int16_t fx_num = Effect_Create(room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO *fx = &g_Effects[fx_num];
|
FX *fx = &g_Effects[fx_num];
|
||||||
fx->room_num = room_num;
|
fx->room_num = room_num;
|
||||||
fx->pos.x = x;
|
fx->pos.x = x;
|
||||||
fx->pos.y = y;
|
fx->pos.y = y;
|
||||||
|
@ -59,7 +59,7 @@ int16_t Effect_RocketGun(
|
||||||
{
|
{
|
||||||
int16_t fx_num = Effect_Create(room_num);
|
int16_t fx_num = Effect_Create(room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO *fx = &g_Effects[fx_num];
|
FX *fx = &g_Effects[fx_num];
|
||||||
fx->room_num = room_num;
|
fx->room_num = room_num;
|
||||||
fx->pos.x = x;
|
fx->pos.x = x;
|
||||||
fx->pos.y = y;
|
fx->pos.y = y;
|
||||||
|
|
|
@ -15,7 +15,7 @@ int16_t Effect_GunShot(
|
||||||
{
|
{
|
||||||
int16_t fx_num = Effect_Create(room_num);
|
int16_t fx_num = Effect_Create(room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO *fx = &g_Effects[fx_num];
|
FX *fx = &g_Effects[fx_num];
|
||||||
fx->pos.x = x;
|
fx->pos.x = x;
|
||||||
fx->pos.y = y;
|
fx->pos.y = y;
|
||||||
fx->pos.z = z;
|
fx->pos.z = z;
|
||||||
|
|
|
@ -45,7 +45,7 @@ void Game_DrawScene(bool draw_overlay)
|
||||||
// cinematic scene
|
// cinematic scene
|
||||||
for (int i = 0; i < g_RoomsToDrawCount; i++) {
|
for (int i = 0; i < g_RoomsToDrawCount; i++) {
|
||||||
int16_t room_num = g_RoomsToDraw[i];
|
int16_t room_num = g_RoomsToDraw[i];
|
||||||
ROOM_INFO *r = &g_RoomInfo[room_num];
|
ROOM *r = &g_RoomInfo[room_num];
|
||||||
r->top = 0;
|
r->top = 0;
|
||||||
r->left = 0;
|
r->left = 0;
|
||||||
r->right = Viewport_GetMaxX();
|
r->right = Viewport_GetMaxX();
|
||||||
|
|
|
@ -25,12 +25,12 @@ static const char *M_GetBufferName(GAME_BUFFER buffer)
|
||||||
case GBUF_ANIM_COMMANDS: return "Animation commands";
|
case GBUF_ANIM_COMMANDS: return "Animation commands";
|
||||||
case GBUF_ANIM_BONES: return "Animation bones";
|
case GBUF_ANIM_BONES: return "Animation bones";
|
||||||
case GBUF_ANIM_FRAMES: return "Animation frames";
|
case GBUF_ANIM_FRAMES: return "Animation frames";
|
||||||
case GBUF_ROOM_INFOS: return "Room information";
|
case GBUF_ROOMS: return "Room information";
|
||||||
case GBUF_ROOM_MESH: return "Room meshes";
|
case GBUF_ROOM_MESH: return "Room meshes";
|
||||||
case GBUF_ROOM_DOOR: return "Room doors";
|
case GBUF_ROOM_DOOR: return "Room doors";
|
||||||
case GBUF_ROOM_SECTOR: return "Room sector information";
|
case GBUF_ROOM_SECTOR: return "Room sector information";
|
||||||
case GBUF_ROOM_LIGHTS: return "Room lights";
|
case GBUF_ROOM_LIGHTS: return "Room lights";
|
||||||
case GBUF_ROOM_STATIC_MESH_INFOS: return "Room static meshes";
|
case GBUF_ROOM_STATIC_MESHES: return "Room static meshes";
|
||||||
case GBUF_FLOOR_DATA: return "Floor data";
|
case GBUF_FLOOR_DATA: return "Floor data";
|
||||||
case GBUF_ITEMS: return "Items";
|
case GBUF_ITEMS: return "Items";
|
||||||
case GBUF_CAMERAS: return "Cameras";
|
case GBUF_CAMERAS: return "Cameras";
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// intentionally not implemented. To use more dynamic memory management, use
|
// intentionally not implemented. To use more dynamic memory management, use
|
||||||
// Memory_Alloc / Memory_Free.
|
// Memory_Alloc / Memory_Free.
|
||||||
|
|
||||||
typedef enum GAME_BUFFER {
|
typedef enum {
|
||||||
GBUF_TEXTURE_PAGES,
|
GBUF_TEXTURE_PAGES,
|
||||||
GBUF_MESH_POINTERS,
|
GBUF_MESH_POINTERS,
|
||||||
GBUF_MESHES,
|
GBUF_MESHES,
|
||||||
|
@ -19,12 +19,12 @@ typedef enum GAME_BUFFER {
|
||||||
GBUF_ANIM_COMMANDS,
|
GBUF_ANIM_COMMANDS,
|
||||||
GBUF_ANIM_BONES,
|
GBUF_ANIM_BONES,
|
||||||
GBUF_ANIM_FRAMES,
|
GBUF_ANIM_FRAMES,
|
||||||
GBUF_ROOM_INFOS,
|
GBUF_ROOMS,
|
||||||
GBUF_ROOM_MESH,
|
GBUF_ROOM_MESH,
|
||||||
GBUF_ROOM_DOOR,
|
GBUF_ROOM_DOOR,
|
||||||
GBUF_ROOM_SECTOR,
|
GBUF_ROOM_SECTOR,
|
||||||
GBUF_ROOM_LIGHTS,
|
GBUF_ROOM_LIGHTS,
|
||||||
GBUF_ROOM_STATIC_MESH_INFOS,
|
GBUF_ROOM_STATIC_MESHES,
|
||||||
GBUF_FLOOR_DATA,
|
GBUF_FLOOR_DATA,
|
||||||
GBUF_ITEMS,
|
GBUF_ITEMS,
|
||||||
GBUF_CAMERAS,
|
GBUF_CAMERAS,
|
||||||
|
|
|
@ -23,23 +23,23 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
typedef struct STRING_TO_ENUM_TYPE {
|
typedef struct {
|
||||||
const char *str;
|
const char *str;
|
||||||
const int32_t val;
|
const int32_t val;
|
||||||
} STRING_TO_ENUM_TYPE;
|
} STRING_TO_ENUM_TYPE;
|
||||||
|
|
||||||
typedef struct GAMEFLOW_DISPLAY_PICTURE_DATA {
|
typedef struct {
|
||||||
char *path;
|
char *path;
|
||||||
double display_time;
|
double display_time;
|
||||||
} GAMEFLOW_DISPLAY_PICTURE_DATA;
|
} GAMEFLOW_DISPLAY_PICTURE_DATA;
|
||||||
|
|
||||||
typedef struct GAMEFLOW_MESH_SWAP_DATA {
|
typedef struct {
|
||||||
GAME_OBJECT_ID object1_id;
|
GAME_OBJECT_ID object1_id;
|
||||||
GAME_OBJECT_ID object2_id;
|
GAME_OBJECT_ID object2_id;
|
||||||
int32_t mesh_num;
|
int32_t mesh_num;
|
||||||
} GAMEFLOW_MESH_SWAP_DATA;
|
} GAMEFLOW_MESH_SWAP_DATA;
|
||||||
|
|
||||||
typedef struct GAMEFLOW_GIVE_ITEM_DATA {
|
typedef struct {
|
||||||
GAME_OBJECT_ID object_id;
|
GAME_OBJECT_ID object_id;
|
||||||
int quantity;
|
int quantity;
|
||||||
} GAMEFLOW_GIVE_ITEM_DATA;
|
} GAMEFLOW_GIVE_ITEM_DATA;
|
||||||
|
|
|
@ -5,18 +5,18 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef struct GAMEFLOW_SEQUENCE {
|
typedef struct {
|
||||||
GAMEFLOW_SEQUENCE_TYPE type;
|
GAMEFLOW_SEQUENCE_TYPE type;
|
||||||
void *data;
|
void *data;
|
||||||
} GAMEFLOW_SEQUENCE;
|
} GAMEFLOW_SEQUENCE;
|
||||||
|
|
||||||
typedef struct GAMEFLOW_DROP_ITEM_DATA {
|
typedef struct {
|
||||||
int32_t enemy_num;
|
int32_t enemy_num;
|
||||||
int32_t count;
|
int32_t count;
|
||||||
int16_t *object_ids;
|
int16_t *object_ids;
|
||||||
} GAMEFLOW_DROP_ITEM_DATA;
|
} GAMEFLOW_DROP_ITEM_DATA;
|
||||||
|
|
||||||
typedef struct GAMEFLOW_LEVEL {
|
typedef struct {
|
||||||
GAMEFLOW_LEVEL_TYPE level_type;
|
GAMEFLOW_LEVEL_TYPE level_type;
|
||||||
int16_t music;
|
int16_t music;
|
||||||
char *level_title;
|
char *level_title;
|
||||||
|
@ -61,7 +61,7 @@ typedef struct GAMEFLOW_LEVEL {
|
||||||
GAME_OBJECT_ID lara_type;
|
GAME_OBJECT_ID lara_type;
|
||||||
} GAMEFLOW_LEVEL;
|
} GAMEFLOW_LEVEL;
|
||||||
|
|
||||||
typedef struct GAMEFLOW {
|
typedef struct {
|
||||||
char *main_menu_background_path;
|
char *main_menu_background_path;
|
||||||
int32_t gym_level_num;
|
int32_t gym_level_num;
|
||||||
int32_t first_level_num;
|
int32_t first_level_num;
|
||||||
|
|
|
@ -10,8 +10,8 @@ void Gun_Control(void);
|
||||||
void Gun_InitialiseNewWeapon(void);
|
void Gun_InitialiseNewWeapon(void);
|
||||||
void Gun_AimWeapon(WEAPON_INFO *winfo, LARA_ARM *arm);
|
void Gun_AimWeapon(WEAPON_INFO *winfo, LARA_ARM *arm);
|
||||||
int32_t Gun_FireWeapon(
|
int32_t Gun_FireWeapon(
|
||||||
int32_t weapon_type, ITEM_INFO *target, ITEM_INFO *src, PHD_ANGLE *angles);
|
int32_t weapon_type, ITEM *target, ITEM *src, PHD_ANGLE *angles);
|
||||||
void Gun_HitTarget(ITEM_INFO *item, GAME_VECTOR *hitpos, int16_t damage);
|
void Gun_HitTarget(ITEM *item, GAME_VECTOR *hitpos, int16_t damage);
|
||||||
void Gun_DrawFlash(LARA_GUN_TYPE weapon_type, int32_t clip);
|
void Gun_DrawFlash(LARA_GUN_TYPE weapon_type, int32_t clip);
|
||||||
GAME_OBJECT_ID Gun_GetLaraAnim(LARA_GUN_TYPE gun_type);
|
GAME_OBJECT_ID Gun_GetLaraAnim(LARA_GUN_TYPE gun_type);
|
||||||
GAME_OBJECT_ID Gun_GetWeaponAnim(LARA_GUN_TYPE gun_type);
|
GAME_OBJECT_ID Gun_GetWeaponAnim(LARA_GUN_TYPE gun_type);
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
#define SHOTGUN_RARM_XMIN (-65 * PHD_DEGREE)
|
#define SHOTGUN_RARM_XMIN (-65 * PHD_DEGREE)
|
||||||
#define SHOTGUN_RARM_XMAX (+65 * PHD_DEGREE)
|
#define SHOTGUN_RARM_XMAX (+65 * PHD_DEGREE)
|
||||||
|
|
||||||
static ITEM_INFO *m_TargetList[NUM_SLOTS];
|
static ITEM *m_TargetList[NUM_SLOTS];
|
||||||
static ITEM_INFO *m_LastTargetList[NUM_SLOTS];
|
static ITEM *m_LastTargetList[NUM_SLOTS];
|
||||||
|
|
||||||
WEAPON_INFO g_Weapons[NUM_WEAPONS] = {
|
WEAPON_INFO g_Weapons[NUM_WEAPONS] = {
|
||||||
// null
|
// null
|
||||||
|
@ -206,7 +206,7 @@ void Gun_GetNewTarget(WEAPON_INFO *winfo)
|
||||||
g_Lara.target = NULL;
|
g_Lara.target = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_INFO *best_target = NULL;
|
ITEM *best_target = NULL;
|
||||||
int16_t best_yrot = 0x7FFF;
|
int16_t best_yrot = 0x7FFF;
|
||||||
int16_t num_targets = 0;
|
int16_t num_targets = 0;
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ void Gun_GetNewTarget(WEAPON_INFO *winfo)
|
||||||
src.z = g_LaraItem->pos.z;
|
src.z = g_LaraItem->pos.z;
|
||||||
src.room_num = g_LaraItem->room_num;
|
src.room_num = g_LaraItem->room_num;
|
||||||
|
|
||||||
ITEM_INFO *item = NULL;
|
ITEM *item = NULL;
|
||||||
for (int16_t item_num = g_NextItemActive; item_num != NO_ITEM;
|
for (int16_t item_num = g_NextItemActive; item_num != NO_ITEM;
|
||||||
item_num = item->next_active) {
|
item_num = item->next_active) {
|
||||||
item = &g_Items[item_num];
|
item = &g_Items[item_num];
|
||||||
|
@ -335,7 +335,7 @@ void Gun_ChangeTarget(WEAPON_INFO *winfo)
|
||||||
Gun_TargetInfo(winfo);
|
Gun_TargetInfo(winfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gun_FindTargetPoint(ITEM_INFO *item, GAME_VECTOR *target)
|
void Gun_FindTargetPoint(ITEM *item, GAME_VECTOR *target)
|
||||||
{
|
{
|
||||||
const BOUNDS_16 *const bounds = &Item_GetBestFrame(item)->bounds;
|
const BOUNDS_16 *const bounds = &Item_GetBestFrame(item)->bounds;
|
||||||
const int32_t x = (bounds->min.x + bounds->max.x) / 2;
|
const int32_t x = (bounds->min.x + bounds->max.x) / 2;
|
||||||
|
@ -388,7 +388,7 @@ void Gun_AimWeapon(WEAPON_INFO *winfo, LARA_ARM *arm)
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Gun_FireWeapon(
|
int32_t Gun_FireWeapon(
|
||||||
int32_t weapon_type, ITEM_INFO *target, ITEM_INFO *src, PHD_ANGLE *angles)
|
int32_t weapon_type, ITEM *target, ITEM *src, PHD_ANGLE *angles)
|
||||||
{
|
{
|
||||||
WEAPON_INFO *winfo = &g_Weapons[weapon_type];
|
WEAPON_INFO *winfo = &g_Weapons[weapon_type];
|
||||||
|
|
||||||
|
@ -489,7 +489,7 @@ int32_t Gun_FireWeapon(
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gun_HitTarget(ITEM_INFO *item, GAME_VECTOR *hitpos, int16_t damage)
|
void Gun_HitTarget(ITEM *item, GAME_VECTOR *hitpos, int16_t damage)
|
||||||
{
|
{
|
||||||
if (item->hit_points > 0 && item->hit_points <= damage) {
|
if (item->hit_points > 0 && item->hit_points <= damage) {
|
||||||
g_GameInfo.current[g_CurrentLevel].stats.kill_count++;
|
g_GameInfo.current[g_CurrentLevel].stats.kill_count++;
|
||||||
|
|
|
@ -12,10 +12,10 @@ extern WEAPON_INFO g_Weapons[NUM_WEAPONS];
|
||||||
void Gun_TargetInfo(WEAPON_INFO *winfo);
|
void Gun_TargetInfo(WEAPON_INFO *winfo);
|
||||||
void Gun_GetNewTarget(WEAPON_INFO *winfo);
|
void Gun_GetNewTarget(WEAPON_INFO *winfo);
|
||||||
void Gun_ChangeTarget(WEAPON_INFO *winfo);
|
void Gun_ChangeTarget(WEAPON_INFO *winfo);
|
||||||
void Gun_FindTargetPoint(ITEM_INFO *item, GAME_VECTOR *target);
|
void Gun_FindTargetPoint(ITEM *item, GAME_VECTOR *target);
|
||||||
void Gun_AimWeapon(WEAPON_INFO *winfo, LARA_ARM *arm);
|
void Gun_AimWeapon(WEAPON_INFO *winfo, LARA_ARM *arm);
|
||||||
int32_t Gun_FireWeapon(
|
int32_t Gun_FireWeapon(
|
||||||
int32_t weapon_type, ITEM_INFO *target, ITEM_INFO *src, PHD_ANGLE *angles);
|
int32_t weapon_type, ITEM *target, ITEM *src, PHD_ANGLE *angles);
|
||||||
void Gun_HitTarget(ITEM_INFO *item, GAME_VECTOR *hitpos, int16_t damage);
|
void Gun_HitTarget(ITEM *item, GAME_VECTOR *hitpos, int16_t damage);
|
||||||
|
|
||||||
void Gun_DrawFlash(LARA_GUN_TYPE weapon_type, int32_t clip);
|
void Gun_DrawFlash(LARA_GUN_TYPE weapon_type, int32_t clip);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#define INJECTION_CURRENT_VERSION 8
|
#define INJECTION_CURRENT_VERSION 8
|
||||||
#define NULL_FD_INDEX ((uint16_t)(-1))
|
#define NULL_FD_INDEX ((uint16_t)(-1))
|
||||||
|
|
||||||
typedef enum INJECTION_VERSION {
|
typedef enum {
|
||||||
INJ_VERSION_1 = 1,
|
INJ_VERSION_1 = 1,
|
||||||
INJ_VERSION_2 = 2,
|
INJ_VERSION_2 = 2,
|
||||||
INJ_VERSION_3 = 3,
|
INJ_VERSION_3 = 3,
|
||||||
|
@ -34,7 +34,7 @@ typedef enum INJECTION_VERSION {
|
||||||
INJ_VERSION_8 = 8,
|
INJ_VERSION_8 = 8,
|
||||||
} INJECTION_VERSION;
|
} INJECTION_VERSION;
|
||||||
|
|
||||||
typedef enum INJECTION_TYPE {
|
typedef enum {
|
||||||
INJ_GENERAL = 0,
|
INJ_GENERAL = 0,
|
||||||
INJ_BRAID = 1,
|
INJ_BRAID = 1,
|
||||||
INJ_TEXTURE_FIX = 2,
|
INJ_TEXTURE_FIX = 2,
|
||||||
|
@ -49,7 +49,7 @@ typedef enum INJECTION_TYPE {
|
||||||
INJ_PS1_CRYSTAL = 11,
|
INJ_PS1_CRYSTAL = 11,
|
||||||
} INJECTION_TYPE;
|
} INJECTION_TYPE;
|
||||||
|
|
||||||
typedef struct INJECTION {
|
typedef struct {
|
||||||
VFILE *fp;
|
VFILE *fp;
|
||||||
INJECTION_VERSION version;
|
INJECTION_VERSION version;
|
||||||
INJECTION_TYPE type;
|
INJECTION_TYPE type;
|
||||||
|
@ -57,14 +57,14 @@ typedef struct INJECTION {
|
||||||
bool relevant;
|
bool relevant;
|
||||||
} INJECTION;
|
} INJECTION;
|
||||||
|
|
||||||
typedef enum FACE_TYPE {
|
typedef enum {
|
||||||
FT_TEXTURED_QUAD = 0,
|
FT_TEXTURED_QUAD = 0,
|
||||||
FT_TEXTURED_TRIANGLE = 1,
|
FT_TEXTURED_TRIANGLE = 1,
|
||||||
FT_COLOURED_QUAD = 2,
|
FT_COLOURED_QUAD = 2,
|
||||||
FT_COLOURED_TRIANGLE = 3
|
FT_COLOURED_TRIANGLE = 3
|
||||||
} FACE_TYPE;
|
} FACE_TYPE;
|
||||||
|
|
||||||
typedef struct FACE_EDIT {
|
typedef struct {
|
||||||
GAME_OBJECT_ID object_id;
|
GAME_OBJECT_ID object_id;
|
||||||
int16_t source_identifier;
|
int16_t source_identifier;
|
||||||
FACE_TYPE face_type;
|
FACE_TYPE face_type;
|
||||||
|
@ -73,14 +73,14 @@ typedef struct FACE_EDIT {
|
||||||
int16_t *targets;
|
int16_t *targets;
|
||||||
} FACE_EDIT;
|
} FACE_EDIT;
|
||||||
|
|
||||||
typedef struct VERTEX_EDIT {
|
typedef struct {
|
||||||
int16_t vertex_index;
|
int16_t vertex_index;
|
||||||
int16_t x_change;
|
int16_t x_change;
|
||||||
int16_t y_change;
|
int16_t y_change;
|
||||||
int16_t z_change;
|
int16_t z_change;
|
||||||
} VERTEX_EDIT;
|
} VERTEX_EDIT;
|
||||||
|
|
||||||
typedef struct MESH_EDIT {
|
typedef struct {
|
||||||
GAME_OBJECT_ID object_id;
|
GAME_OBJECT_ID object_id;
|
||||||
int16_t mesh_idx;
|
int16_t mesh_idx;
|
||||||
XYZ_16 centre_shift;
|
XYZ_16 centre_shift;
|
||||||
|
@ -91,7 +91,7 @@ typedef struct MESH_EDIT {
|
||||||
VERTEX_EDIT *vertex_edits;
|
VERTEX_EDIT *vertex_edits;
|
||||||
} MESH_EDIT;
|
} MESH_EDIT;
|
||||||
|
|
||||||
typedef enum FLOOR_EDIT_TYPE {
|
typedef enum {
|
||||||
FET_TRIGGER_PARAM = 0,
|
FET_TRIGGER_PARAM = 0,
|
||||||
FET_MUSIC_ONESHOT = 1,
|
FET_MUSIC_ONESHOT = 1,
|
||||||
FET_FD_INSERT = 2,
|
FET_FD_INSERT = 2,
|
||||||
|
@ -99,7 +99,7 @@ typedef enum FLOOR_EDIT_TYPE {
|
||||||
FET_TRIGGER_ITEM = 4,
|
FET_TRIGGER_ITEM = 4,
|
||||||
} FLOOR_EDIT_TYPE;
|
} FLOOR_EDIT_TYPE;
|
||||||
|
|
||||||
typedef enum ROOM_MESH_EDIT_TYPE {
|
typedef enum {
|
||||||
RMET_TEXTURE_FACE = 0,
|
RMET_TEXTURE_FACE = 0,
|
||||||
RMET_MOVE_FACE = 1,
|
RMET_MOVE_FACE = 1,
|
||||||
RMET_ALTER_VERTEX = 2,
|
RMET_ALTER_VERTEX = 2,
|
||||||
|
@ -116,7 +116,7 @@ static void M_LoadFromFile(INJECTION *injection, const char *filename);
|
||||||
|
|
||||||
static uint16_t M_RemapRGB(LEVEL_INFO *level_info, RGB_888 rgb);
|
static uint16_t M_RemapRGB(LEVEL_INFO *level_info, RGB_888 rgb);
|
||||||
static void M_AlignTextureReferences(
|
static void M_AlignTextureReferences(
|
||||||
OBJECT_INFO *object, uint16_t *palette_map, int32_t page_base);
|
OBJECT *object, uint16_t *palette_map, int32_t page_base);
|
||||||
|
|
||||||
static void M_LoadTexturePages(
|
static void M_LoadTexturePages(
|
||||||
INJECTION *injection, LEVEL_INFO *level_info, uint16_t *palette_map,
|
INJECTION *injection, LEVEL_INFO *level_info, uint16_t *palette_map,
|
||||||
|
@ -140,10 +140,10 @@ static void M_TextureOverwrites(
|
||||||
INJECTION *injection, LEVEL_INFO *level_info, uint16_t *palette_map);
|
INJECTION *injection, LEVEL_INFO *level_info, uint16_t *palette_map);
|
||||||
|
|
||||||
static void M_FloorDataEdits(INJECTION *injection, LEVEL_INFO *level_info);
|
static void M_FloorDataEdits(INJECTION *injection, LEVEL_INFO *level_info);
|
||||||
static void M_TriggerParameterChange(INJECTION *injection, SECTOR_INFO *sector);
|
static void M_TriggerParameterChange(INJECTION *injection, SECTOR *sector);
|
||||||
static void M_SetMusicOneShot(SECTOR_INFO *sector);
|
static void M_SetMusicOneShot(SECTOR *sector);
|
||||||
static void M_InsertFloorData(
|
static void M_InsertFloorData(
|
||||||
INJECTION *injection, SECTOR_INFO *sector, LEVEL_INFO *level_info);
|
INJECTION *injection, SECTOR *sector, LEVEL_INFO *level_info);
|
||||||
static void M_RoomShift(INJECTION *injection, int16_t room_num);
|
static void M_RoomShift(INJECTION *injection, int16_t room_num);
|
||||||
static void M_TriggeredItem(INJECTION *injection, LEVEL_INFO *level_info);
|
static void M_TriggeredItem(INJECTION *injection, LEVEL_INFO *level_info);
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@ static void M_TextureData(
|
||||||
const int16_t mesh_idx = VFile_ReadS16(fp);
|
const int16_t mesh_idx = VFile_ReadS16(fp);
|
||||||
|
|
||||||
if (object_id < O_NUMBER_OF) {
|
if (object_id < O_NUMBER_OF) {
|
||||||
OBJECT_INFO *object = &g_Objects[object_id];
|
OBJECT *object = &g_Objects[object_id];
|
||||||
object->nmeshes = num_meshes;
|
object->nmeshes = num_meshes;
|
||||||
object->mesh_idx = mesh_idx + level_info->sprite_info_count;
|
object->mesh_idx = mesh_idx + level_info->sprite_info_count;
|
||||||
object->loaded = 1;
|
object->loaded = 1;
|
||||||
|
@ -620,7 +620,7 @@ static void M_AnimRangeEdits(INJECTION *injection)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJECT_INFO *object = &g_Objects[object_id];
|
OBJECT *object = &g_Objects[object_id];
|
||||||
if (!object->loaded) {
|
if (!object->loaded) {
|
||||||
LOG_WARNING("Object %d is not loaded", object_id);
|
LOG_WARNING("Object %d is not loaded", object_id);
|
||||||
VFile_Skip(fp, edit_count * sizeof(int16_t) * 4);
|
VFile_Skip(fp, edit_count * sizeof(int16_t) * 4);
|
||||||
|
@ -670,7 +670,7 @@ static void M_ObjectData(
|
||||||
// use cases.
|
// use cases.
|
||||||
for (int32_t i = 0; i < inj_info->object_count; i++) {
|
for (int32_t i = 0; i < inj_info->object_count; i++) {
|
||||||
const GAME_OBJECT_ID object_id = VFile_ReadS32(fp);
|
const GAME_OBJECT_ID object_id = VFile_ReadS32(fp);
|
||||||
OBJECT_INFO *object = &g_Objects[object_id];
|
OBJECT *object = &g_Objects[object_id];
|
||||||
|
|
||||||
const int16_t num_meshes = VFile_ReadS16(fp);
|
const int16_t num_meshes = VFile_ReadS16(fp);
|
||||||
const int16_t mesh_idx = VFile_ReadS16(fp);
|
const int16_t mesh_idx = VFile_ReadS16(fp);
|
||||||
|
@ -752,7 +752,7 @@ static void M_SFXData(INJECTION *injection, LEVEL_INFO *level_info)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_AlignTextureReferences(
|
static void M_AlignTextureReferences(
|
||||||
OBJECT_INFO *object, uint16_t *palette_map, int32_t page_base)
|
OBJECT *object, uint16_t *palette_map, int32_t page_base)
|
||||||
{
|
{
|
||||||
int16_t **mesh = &g_Meshes[object->mesh_idx];
|
int16_t **mesh = &g_Meshes[object->mesh_idx];
|
||||||
for (int32_t i = 0; i < object->nmeshes; i++) {
|
for (int32_t i = 0; i < object->nmeshes; i++) {
|
||||||
|
@ -885,7 +885,7 @@ static void M_MeshEdits(INJECTION *injection, uint16_t *palette_map)
|
||||||
|
|
||||||
static void M_ApplyMeshEdit(MESH_EDIT *mesh_edit, uint16_t *palette_map)
|
static void M_ApplyMeshEdit(MESH_EDIT *mesh_edit, uint16_t *palette_map)
|
||||||
{
|
{
|
||||||
OBJECT_INFO object = g_Objects[mesh_edit->object_id];
|
OBJECT object = g_Objects[mesh_edit->object_id];
|
||||||
if (!object.loaded) {
|
if (!object.loaded) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -989,7 +989,7 @@ static void M_ApplyFaceEdit(
|
||||||
|
|
||||||
static int16_t *M_GetMeshTexture(FACE_EDIT *face_edit)
|
static int16_t *M_GetMeshTexture(FACE_EDIT *face_edit)
|
||||||
{
|
{
|
||||||
OBJECT_INFO object = g_Objects[face_edit->object_id];
|
OBJECT object = g_Objects[face_edit->object_id];
|
||||||
if (!object.loaded) {
|
if (!object.loaded) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1094,8 +1094,8 @@ static void M_FloorDataEdits(INJECTION *injection, LEVEL_INFO *level_info)
|
||||||
|
|
||||||
// Verify that the given room and coordinates are accurate.
|
// Verify that the given room and coordinates are accurate.
|
||||||
// Individual FD functions must check that sector is actually set.
|
// Individual FD functions must check that sector is actually set.
|
||||||
ROOM_INFO *r = NULL;
|
ROOM *r = NULL;
|
||||||
SECTOR_INFO *sector = NULL;
|
SECTOR *sector = NULL;
|
||||||
if (room < 0 || room >= g_RoomCount) {
|
if (room < 0 || room >= g_RoomCount) {
|
||||||
LOG_WARNING("Room index %d is invalid", room);
|
LOG_WARNING("Room index %d is invalid", room);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1136,7 +1136,7 @@ static void M_FloorDataEdits(INJECTION *injection, LEVEL_INFO *level_info)
|
||||||
Benchmark_End(benchmark, NULL);
|
Benchmark_End(benchmark, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_TriggerParameterChange(INJECTION *injection, SECTOR_INFO *sector)
|
static void M_TriggerParameterChange(INJECTION *injection, SECTOR *sector)
|
||||||
{
|
{
|
||||||
VFILE *const fp = injection->fp;
|
VFILE *const fp = injection->fp;
|
||||||
|
|
||||||
|
@ -1173,7 +1173,7 @@ static void M_TriggerParameterChange(INJECTION *injection, SECTOR_INFO *sector)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_SetMusicOneShot(SECTOR_INFO *sector)
|
static void M_SetMusicOneShot(SECTOR *sector)
|
||||||
{
|
{
|
||||||
if (sector == NULL || sector->trigger == NULL) {
|
if (sector == NULL || sector->trigger == NULL) {
|
||||||
return;
|
return;
|
||||||
|
@ -1188,7 +1188,7 @@ static void M_SetMusicOneShot(SECTOR_INFO *sector)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_InsertFloorData(
|
static void M_InsertFloorData(
|
||||||
INJECTION *injection, SECTOR_INFO *sector, LEVEL_INFO *level_info)
|
INJECTION *injection, SECTOR *sector, LEVEL_INFO *level_info)
|
||||||
{
|
{
|
||||||
VFILE *const fp = injection->fp;
|
VFILE *const fp = injection->fp;
|
||||||
|
|
||||||
|
@ -1215,7 +1215,7 @@ static void M_RoomShift(INJECTION *injection, int16_t room_num)
|
||||||
const uint32_t z_shift = ROUND_TO_SECTOR(VFile_ReadU32(fp));
|
const uint32_t z_shift = ROUND_TO_SECTOR(VFile_ReadU32(fp));
|
||||||
const int32_t y_shift = ROUND_TO_CLICK(VFile_ReadS32(fp));
|
const int32_t y_shift = ROUND_TO_CLICK(VFile_ReadS32(fp));
|
||||||
|
|
||||||
ROOM_INFO *room = &g_RoomInfo[room_num];
|
ROOM *room = &g_RoomInfo[room_num];
|
||||||
room->x += x_shift;
|
room->x += x_shift;
|
||||||
room->z += z_shift;
|
room->z += z_shift;
|
||||||
room->min_floor += y_shift;
|
room->min_floor += y_shift;
|
||||||
|
@ -1223,7 +1223,7 @@ static void M_RoomShift(INJECTION *injection, int16_t room_num)
|
||||||
|
|
||||||
// Move any items in the room to match.
|
// Move any items in the room to match.
|
||||||
for (int32_t i = 0; i < g_LevelItemCount; i++) {
|
for (int32_t i = 0; i < g_LevelItemCount; i++) {
|
||||||
ITEM_INFO *item = &g_Items[i];
|
ITEM *item = &g_Items[i];
|
||||||
if (item->room_num != room_num) {
|
if (item->room_num != room_num) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1239,7 +1239,7 @@ static void M_RoomShift(INJECTION *injection, int16_t room_num)
|
||||||
|
|
||||||
// Update the sector floor and ceiling heights to match.
|
// Update the sector floor and ceiling heights to match.
|
||||||
for (int32_t i = 0; i < room->z_size * room->x_size; i++) {
|
for (int32_t i = 0; i < room->z_size * room->x_size; i++) {
|
||||||
SECTOR_INFO *const sector = &room->sectors[i];
|
SECTOR *const sector = &room->sectors[i];
|
||||||
if (sector->floor.height == NO_HEIGHT
|
if (sector->floor.height == NO_HEIGHT
|
||||||
|| sector->ceiling.height == NO_HEIGHT) {
|
|| sector->ceiling.height == NO_HEIGHT) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -1269,7 +1269,7 @@ static void M_TriggeredItem(INJECTION *injection, LEVEL_INFO *level_info)
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t item_num = Item_Create();
|
int16_t item_num = Item_Create();
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
item->object_id = VFile_ReadS16(fp);
|
item->object_id = VFile_ReadS16(fp);
|
||||||
item->room_num = VFile_ReadS16(fp);
|
item->room_num = VFile_ReadS16(fp);
|
||||||
|
@ -1388,7 +1388,7 @@ static void M_AlterRoomVertex(INJECTION *injection)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ROOM_INFO *const room = &g_RoomInfo[target_room];
|
const ROOM *const room = &g_RoomInfo[target_room];
|
||||||
const int16_t vertex_count = *room->data;
|
const int16_t vertex_count = *room->data;
|
||||||
if (target_vertex < 0 || target_vertex >= vertex_count) {
|
if (target_vertex < 0 || target_vertex >= vertex_count) {
|
||||||
LOG_WARNING(
|
LOG_WARNING(
|
||||||
|
@ -1459,7 +1459,7 @@ static void M_AddRoomFace(INJECTION *injection)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOM_INFO *r = &g_RoomInfo[target_room];
|
ROOM *r = &g_RoomInfo[target_room];
|
||||||
int32_t data_index = 0;
|
int32_t data_index = 0;
|
||||||
|
|
||||||
int32_t vertex_count = r->data[data_index++];
|
int32_t vertex_count = r->data[data_index++];
|
||||||
|
@ -1516,7 +1516,7 @@ static void M_AddRoomVertex(INJECTION *injection)
|
||||||
const int16_t z = VFile_ReadS16(fp);
|
const int16_t z = VFile_ReadS16(fp);
|
||||||
const int16_t lighting = VFile_ReadS16(fp);
|
const int16_t lighting = VFile_ReadS16(fp);
|
||||||
|
|
||||||
ROOM_INFO *r = &g_RoomInfo[target_room];
|
ROOM *r = &g_RoomInfo[target_room];
|
||||||
int32_t data_index = 0;
|
int32_t data_index = 0;
|
||||||
|
|
||||||
int32_t vertex_count = r->data[data_index];
|
int32_t vertex_count = r->data[data_index];
|
||||||
|
@ -1559,7 +1559,7 @@ static int16_t *M_GetRoomTexture(
|
||||||
static int16_t *M_GetRoomFace(
|
static int16_t *M_GetRoomFace(
|
||||||
int16_t room, FACE_TYPE face_type, int16_t face_index)
|
int16_t room, FACE_TYPE face_type, int16_t face_index)
|
||||||
{
|
{
|
||||||
ROOM_INFO *r = NULL;
|
ROOM *r = NULL;
|
||||||
if (room < 0 || room >= g_RoomCount) {
|
if (room < 0 || room >= g_RoomCount) {
|
||||||
LOG_WARNING("Room index %d is invalid", room);
|
LOG_WARNING("Room index %d is invalid", room);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1621,21 +1621,21 @@ static void M_RoomDoorEdits(INJECTION *injection)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOM_INFO *r = &g_RoomInfo[base_room];
|
ROOM *r = &g_RoomInfo[base_room];
|
||||||
DOOR_INFO *door = NULL;
|
PORTAL *portal = NULL;
|
||||||
for (int32_t j = 0; j < r->doors->count; j++) {
|
for (int32_t j = 0; j < r->portals->count; j++) {
|
||||||
DOOR_INFO d = r->doors->door[j];
|
PORTAL d = r->portals->portal[j];
|
||||||
if (d.room_num == link_room
|
if (d.room_num == link_room
|
||||||
&& (j == door_index || door_index == -1)) {
|
&& (j == door_index || door_index == -1)) {
|
||||||
door = &r->doors->door[j];
|
portal = &r->portals->portal[j];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!door) {
|
if (portal == NULL) {
|
||||||
VFile_Skip(fp, sizeof(int16_t) * 12);
|
VFile_Skip(fp, sizeof(int16_t) * 12);
|
||||||
LOG_WARNING(
|
LOG_WARNING(
|
||||||
"Room index %d has no matching door to %d", base_room,
|
"Room index %d has no matching portal to %d", base_room,
|
||||||
link_room);
|
link_room);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1645,9 +1645,9 @@ static void M_RoomDoorEdits(INJECTION *injection)
|
||||||
const int16_t y_change = VFile_ReadS16(fp);
|
const int16_t y_change = VFile_ReadS16(fp);
|
||||||
const int16_t z_change = VFile_ReadS16(fp);
|
const int16_t z_change = VFile_ReadS16(fp);
|
||||||
|
|
||||||
door->vertex[j].x += x_change;
|
portal->vertex[j].x += x_change;
|
||||||
door->vertex[j].y += y_change;
|
portal->vertex[j].y += y_change;
|
||||||
door->vertex[j].z += z_change;
|
portal->vertex[j].z += z_change;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1685,7 +1685,7 @@ static void M_ItemPositions(INJECTION *injection)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
item->rot.y = y_rot;
|
item->rot.y = y_rot;
|
||||||
if (injection->version > INJ_VERSION_4) {
|
if (injection->version > INJ_VERSION_4) {
|
||||||
item->pos.x = x;
|
item->pos.x = x;
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef struct INJECTION_ROOM_MESH {
|
typedef struct {
|
||||||
int16_t room_index;
|
int16_t room_index;
|
||||||
uint32_t extra_size;
|
uint32_t extra_size;
|
||||||
} INJECTION_ROOM_MESH;
|
} INJECTION_ROOM_MESH;
|
||||||
|
|
||||||
typedef struct INJECTION_INFO {
|
typedef struct {
|
||||||
int32_t texture_page_count;
|
int32_t texture_page_count;
|
||||||
int32_t texture_count;
|
int32_t texture_count;
|
||||||
int32_t sprite_info_count;
|
int32_t sprite_info_count;
|
||||||
|
|
|
@ -106,7 +106,7 @@ void Interpolation_Commit(void)
|
||||||
INTERPOLATE_ROT(&g_Lara, head_rot.z, ratio, PHD_45);
|
INTERPOLATE_ROT(&g_Lara, head_rot.z, ratio, PHD_45);
|
||||||
|
|
||||||
for (int i = 0; i < Item_GetTotalCount(); i++) {
|
for (int i = 0; i < Item_GetTotalCount(); i++) {
|
||||||
ITEM_INFO *const item = &g_Items[i];
|
ITEM *const item = &g_Items[i];
|
||||||
if ((item->flags & IF_KILLED) || item->status == IS_INACTIVE
|
if ((item->flags & IF_KILLED) || item->status == IS_INACTIVE
|
||||||
|| item->object_id == O_BAT) {
|
|| item->object_id == O_BAT) {
|
||||||
COMMIT(item, pos.x);
|
COMMIT(item, pos.x);
|
||||||
|
@ -140,7 +140,7 @@ void Interpolation_Commit(void)
|
||||||
|
|
||||||
int16_t fx_num = g_NextFxActive;
|
int16_t fx_num = g_NextFxActive;
|
||||||
while (fx_num != NO_ITEM) {
|
while (fx_num != NO_ITEM) {
|
||||||
FX_INFO *const fx = &g_Effects[fx_num];
|
FX *const fx = &g_Effects[fx_num];
|
||||||
INTERPOLATE(fx, pos.x, ratio, 128);
|
INTERPOLATE(fx, pos.x, ratio, 128);
|
||||||
INTERPOLATE(fx, pos.y, ratio, MAX(128, fx->fall_speed * 2));
|
INTERPOLATE(fx, pos.y, ratio, MAX(128, fx->fall_speed * 2));
|
||||||
INTERPOLATE(fx, pos.z, ratio, 128);
|
INTERPOLATE(fx, pos.z, ratio, 128);
|
||||||
|
@ -190,7 +190,7 @@ void Interpolation_Remember(void)
|
||||||
REMEMBER(&g_Lara, head_rot.z);
|
REMEMBER(&g_Lara, head_rot.z);
|
||||||
|
|
||||||
for (int i = 0; i < Item_GetTotalCount(); i++) {
|
for (int i = 0; i < Item_GetTotalCount(); i++) {
|
||||||
ITEM_INFO *const item = &g_Items[i];
|
ITEM *const item = &g_Items[i];
|
||||||
REMEMBER(item, pos.x);
|
REMEMBER(item, pos.x);
|
||||||
REMEMBER(item, pos.y);
|
REMEMBER(item, pos.y);
|
||||||
REMEMBER(item, pos.z);
|
REMEMBER(item, pos.z);
|
||||||
|
@ -210,7 +210,7 @@ void Interpolation_Remember(void)
|
||||||
|
|
||||||
int16_t fx_num = g_NextFxActive;
|
int16_t fx_num = g_NextFxActive;
|
||||||
while (fx_num != NO_ITEM) {
|
while (fx_num != NO_ITEM) {
|
||||||
FX_INFO *const fx = &g_Effects[fx_num];
|
FX *const fx = &g_Effects[fx_num];
|
||||||
REMEMBER(fx, pos.x);
|
REMEMBER(fx, pos.x);
|
||||||
REMEMBER(fx, pos.y);
|
REMEMBER(fx, pos.y);
|
||||||
REMEMBER(fx, pos.z);
|
REMEMBER(fx, pos.z);
|
||||||
|
@ -233,7 +233,7 @@ void Interpolation_Remember(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpolation_RememberItem(ITEM_INFO *item)
|
void Interpolation_RememberItem(ITEM *item)
|
||||||
{
|
{
|
||||||
item->interp.prev.pos = item->pos;
|
item->interp.prev.pos = item->pos;
|
||||||
item->interp.prev.rot = item->rot;
|
item->interp.prev.rot = item->rot;
|
||||||
|
|
|
@ -13,4 +13,4 @@ void Interpolation_SetRate(double rate);
|
||||||
|
|
||||||
void Interpolation_Commit(void);
|
void Interpolation_Commit(void);
|
||||||
void Interpolation_Remember(void);
|
void Interpolation_Remember(void);
|
||||||
void Interpolation_RememberItem(ITEM_INFO *item);
|
void Interpolation_RememberItem(ITEM *item);
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
ITEM_INFO *g_Items = NULL;
|
ITEM *g_Items = NULL;
|
||||||
int16_t g_NextItemActive = NO_ITEM;
|
int16_t g_NextItemActive = NO_ITEM;
|
||||||
static int16_t m_NextItemFree = NO_ITEM;
|
static int16_t m_NextItemFree = NO_ITEM;
|
||||||
static BOUNDS_16 m_InterpolatedBounds = { 0 };
|
static BOUNDS_16 m_InterpolatedBounds = { 0 };
|
||||||
|
@ -58,8 +58,8 @@ void Item_Control(void)
|
||||||
{
|
{
|
||||||
int16_t item_num = g_NextItemActive;
|
int16_t item_num = g_NextItemActive;
|
||||||
while (item_num != NO_ITEM) {
|
while (item_num != NO_ITEM) {
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
OBJECT_INFO *obj = &g_Objects[item->object_id];
|
OBJECT *obj = &g_Objects[item->object_id];
|
||||||
if (obj->control) {
|
if (obj->control) {
|
||||||
obj->control(item_num);
|
obj->control(item_num);
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ void Item_Control(void)
|
||||||
|
|
||||||
void Item_Kill(int16_t item_num)
|
void Item_Kill(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
Item_RemoveActive(item_num);
|
Item_RemoveActive(item_num);
|
||||||
Item_RemoveDrawn(item_num);
|
Item_RemoveDrawn(item_num);
|
||||||
|
@ -106,8 +106,8 @@ int16_t Item_Create(void)
|
||||||
|
|
||||||
void Item_Initialise(int16_t item_num)
|
void Item_Initialise(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
OBJECT_INFO *object = &g_Objects[item->object_id];
|
OBJECT *object = &g_Objects[item->object_id];
|
||||||
|
|
||||||
Item_SwitchToAnim(item, 0, 0);
|
Item_SwitchToAnim(item, 0, 0);
|
||||||
item->current_anim_state = g_Anims[item->anim_num].current_anim_state;
|
item->current_anim_state = g_Anims[item->anim_num].current_anim_state;
|
||||||
|
@ -143,13 +143,12 @@ void Item_Initialise(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOM_INFO *const r = &g_RoomInfo[item->room_num];
|
ROOM *const r = &g_RoomInfo[item->room_num];
|
||||||
item->next_item = r->item_num;
|
item->next_item = r->item_num;
|
||||||
r->item_num = item_num;
|
r->item_num = item_num;
|
||||||
const int32_t z_sector = (item->pos.z - r->z) >> WALL_SHIFT;
|
const int32_t z_sector = (item->pos.z - r->z) >> WALL_SHIFT;
|
||||||
const int32_t x_sector = (item->pos.x - r->x) >> WALL_SHIFT;
|
const int32_t x_sector = (item->pos.x - r->x) >> WALL_SHIFT;
|
||||||
const SECTOR_INFO *const sector =
|
const SECTOR *const sector = &r->sectors[z_sector + x_sector * r->z_size];
|
||||||
&r->sectors[z_sector + x_sector * r->z_size];
|
|
||||||
item->floor = sector->floor.height;
|
item->floor = sector->floor.height;
|
||||||
|
|
||||||
if (g_GameInfo.bonus_flag & GBF_NGPLUS) {
|
if (g_GameInfo.bonus_flag & GBF_NGPLUS) {
|
||||||
|
@ -164,7 +163,7 @@ void Item_Initialise(int16_t item_num)
|
||||||
|
|
||||||
void Item_RemoveActive(int16_t item_num)
|
void Item_RemoveActive(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *const item = &g_Items[item_num];
|
ITEM *const item = &g_Items[item_num];
|
||||||
if (!item->active) {
|
if (!item->active) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -188,8 +187,8 @@ void Item_RemoveActive(int16_t item_num)
|
||||||
|
|
||||||
void Item_RemoveDrawn(int16_t item_num)
|
void Item_RemoveDrawn(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *const item = &g_Items[item_num];
|
ITEM *const item = &g_Items[item_num];
|
||||||
ROOM_INFO *const r = &g_RoomInfo[item->room_num];
|
ROOM *const r = &g_RoomInfo[item->room_num];
|
||||||
|
|
||||||
int16_t link_num = r->item_num;
|
int16_t link_num = r->item_num;
|
||||||
if (link_num == item_num) {
|
if (link_num == item_num) {
|
||||||
|
@ -208,7 +207,7 @@ void Item_RemoveDrawn(int16_t item_num)
|
||||||
|
|
||||||
void Item_AddActive(int16_t item_num)
|
void Item_AddActive(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (!g_Objects[item->object_id].control) {
|
if (!g_Objects[item->object_id].control) {
|
||||||
item->status = IS_INACTIVE;
|
item->status = IS_INACTIVE;
|
||||||
|
@ -226,8 +225,8 @@ void Item_AddActive(int16_t item_num)
|
||||||
|
|
||||||
void Item_NewRoom(int16_t item_num, int16_t room_num)
|
void Item_NewRoom(int16_t item_num, int16_t room_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
ROOM_INFO *r = &g_RoomInfo[item->room_num];
|
ROOM *r = &g_RoomInfo[item->room_num];
|
||||||
|
|
||||||
int16_t linknum = r->item_num;
|
int16_t linknum = r->item_num;
|
||||||
if (linknum == item_num) {
|
if (linknum == item_num) {
|
||||||
|
@ -247,23 +246,23 @@ void Item_NewRoom(int16_t item_num, int16_t room_num)
|
||||||
r->item_num = item_num;
|
r->item_num = item_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Item_UpdateRoom(ITEM_INFO *item, int32_t height)
|
void Item_UpdateRoom(ITEM *item, int32_t height)
|
||||||
{
|
{
|
||||||
int32_t x = item->pos.x;
|
int32_t x = item->pos.x;
|
||||||
int32_t y = item->pos.y + height;
|
int32_t y = item->pos.y + height;
|
||||||
int32_t z = item->pos.z;
|
int32_t z = item->pos.z;
|
||||||
int16_t room_num = item->room_num;
|
int16_t room_num = item->room_num;
|
||||||
const SECTOR_INFO *const sector = Room_GetSector(x, y, z, &room_num);
|
const SECTOR *const sector = Room_GetSector(x, y, z, &room_num);
|
||||||
item->floor = Room_GetHeight(sector, x, y, z);
|
item->floor = Room_GetHeight(sector, x, y, z);
|
||||||
if (item->room_num != room_num) {
|
if (item->room_num != room_num) {
|
||||||
Item_NewRoom(g_Lara.item_num, room_num);
|
Item_NewRoom(g_Lara.item_num, room_num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t Item_GetHeight(ITEM_INFO *item)
|
int16_t Item_GetHeight(ITEM *item)
|
||||||
{
|
{
|
||||||
int16_t room_num = item->room_num;
|
int16_t room_num = item->room_num;
|
||||||
const SECTOR_INFO *const sector =
|
const SECTOR *const sector =
|
||||||
Room_GetSector(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
Room_GetSector(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
const int32_t height =
|
const int32_t height =
|
||||||
Room_GetHeight(sector, item->pos.x, item->pos.y, item->pos.z);
|
Room_GetHeight(sector, item->pos.x, item->pos.y, item->pos.z);
|
||||||
|
@ -271,7 +270,7 @@ int16_t Item_GetHeight(ITEM_INFO *item)
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t Item_GetWaterHeight(ITEM_INFO *item)
|
int16_t Item_GetWaterHeight(ITEM *item)
|
||||||
{
|
{
|
||||||
int16_t height = Room_GetWaterHeight(
|
int16_t height = Room_GetWaterHeight(
|
||||||
item->pos.x, item->pos.y, item->pos.z, item->room_num);
|
item->pos.x, item->pos.y, item->pos.z, item->room_num);
|
||||||
|
@ -282,11 +281,11 @@ int16_t Item_GetWaterHeight(ITEM_INFO *item)
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t Item_Spawn(const ITEM_INFO *const item, const GAME_OBJECT_ID object_id)
|
int16_t Item_Spawn(const ITEM *const item, const GAME_OBJECT_ID object_id)
|
||||||
{
|
{
|
||||||
int16_t spawn_num = Item_Create();
|
int16_t spawn_num = Item_Create();
|
||||||
if (spawn_num != NO_ITEM) {
|
if (spawn_num != NO_ITEM) {
|
||||||
ITEM_INFO *spawn = &g_Items[spawn_num];
|
ITEM *spawn = &g_Items[spawn_num];
|
||||||
spawn->object_id = object_id;
|
spawn->object_id = object_id;
|
||||||
spawn->room_num = item->room_num;
|
spawn->room_num = item->room_num;
|
||||||
spawn->pos = item->pos;
|
spawn->pos = item->pos;
|
||||||
|
@ -303,7 +302,7 @@ int32_t Item_GlobalReplace(
|
||||||
{
|
{
|
||||||
int32_t changed = 0;
|
int32_t changed = 0;
|
||||||
for (int i = 0; i < g_RoomCount; i++) {
|
for (int i = 0; i < g_RoomCount; i++) {
|
||||||
ROOM_INFO *r = &g_RoomInfo[i];
|
ROOM *r = &g_RoomInfo[i];
|
||||||
for (int16_t item_num = r->item_num; item_num != NO_ITEM;
|
for (int16_t item_num = r->item_num; item_num != NO_ITEM;
|
||||||
item_num = g_Items[item_num].next_item) {
|
item_num = g_Items[item_num].next_item) {
|
||||||
if (g_Items[item_num].object_id == src_object_id) {
|
if (g_Items[item_num].object_id == src_object_id) {
|
||||||
|
@ -315,7 +314,7 @@ int32_t Item_GlobalReplace(
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Item_IsNearItem(const ITEM_INFO *item, const XYZ_32 *pos, int32_t distance)
|
bool Item_IsNearItem(const ITEM *item, const XYZ_32 *pos, int32_t distance)
|
||||||
{
|
{
|
||||||
int32_t x = pos->x - item->pos.x;
|
int32_t x = pos->x - item->pos.x;
|
||||||
int32_t y = pos->y - item->pos.y;
|
int32_t y = pos->y - item->pos.y;
|
||||||
|
@ -333,8 +332,7 @@ bool Item_IsNearItem(const ITEM_INFO *item, const XYZ_32 *pos, int32_t distance)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Item_GetDistance(
|
int32_t Item_GetDistance(const ITEM *const item, const XYZ_32 *const target)
|
||||||
const ITEM_INFO *const item, const XYZ_32 *const target)
|
|
||||||
{
|
{
|
||||||
const int32_t x = (item->pos.x - target->x);
|
const int32_t x = (item->pos.x - target->x);
|
||||||
const int32_t y = (item->pos.y - target->y);
|
const int32_t y = (item->pos.y - target->y);
|
||||||
|
@ -348,8 +346,7 @@ bool Item_Test3DRange(int32_t x, int32_t y, int32_t z, int32_t range)
|
||||||
&& (SQUARE(x) + SQUARE(y) + SQUARE(z) < SQUARE(range));
|
&& (SQUARE(x) + SQUARE(y) + SQUARE(z) < SQUARE(range));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Item_TestBoundsCollide(
|
bool Item_TestBoundsCollide(ITEM *src_item, ITEM *dst_item, int32_t radius)
|
||||||
ITEM_INFO *src_item, ITEM_INFO *dst_item, int32_t radius)
|
|
||||||
{
|
{
|
||||||
const BOUNDS_16 *const src_bounds = &Item_GetBestFrame(src_item)->bounds;
|
const BOUNDS_16 *const src_bounds = &Item_GetBestFrame(src_item)->bounds;
|
||||||
const BOUNDS_16 *const dst_bounds = &Item_GetBestFrame(dst_item)->bounds;
|
const BOUNDS_16 *const dst_bounds = &Item_GetBestFrame(dst_item)->bounds;
|
||||||
|
@ -374,7 +371,7 @@ bool Item_TestBoundsCollide(
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Item_TestPosition(
|
bool Item_TestPosition(
|
||||||
const ITEM_INFO *const src_item, const ITEM_INFO *const dst_item,
|
const ITEM *const src_item, const ITEM *const dst_item,
|
||||||
const OBJECT_BOUNDS *const bounds)
|
const OBJECT_BOUNDS *const bounds)
|
||||||
{
|
{
|
||||||
const XYZ_16 rot = {
|
const XYZ_16 rot = {
|
||||||
|
@ -416,7 +413,7 @@ bool Item_TestPosition(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Item_AlignPosition(ITEM_INFO *src_item, ITEM_INFO *dst_item, XYZ_32 *vec)
|
void Item_AlignPosition(ITEM *src_item, ITEM *dst_item, XYZ_32 *vec)
|
||||||
{
|
{
|
||||||
src_item->rot.x = dst_item->rot.x;
|
src_item->rot.x = dst_item->rot.x;
|
||||||
src_item->rot.y = dst_item->rot.y;
|
src_item->rot.y = dst_item->rot.y;
|
||||||
|
@ -438,8 +435,7 @@ void Item_AlignPosition(ITEM_INFO *src_item, ITEM_INFO *dst_item, XYZ_32 *vec)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Item_MovePosition(
|
bool Item_MovePosition(
|
||||||
ITEM_INFO *item, const ITEM_INFO *ref_item, const XYZ_32 *vec,
|
ITEM *item, const ITEM *ref_item, const XYZ_32 *vec, int32_t velocity)
|
||||||
int32_t velocity)
|
|
||||||
{
|
{
|
||||||
const XYZ_32 *ref_pos = &ref_item->pos;
|
const XYZ_32 *ref_pos = &ref_item->pos;
|
||||||
|
|
||||||
|
@ -529,7 +525,7 @@ bool Item_MovePosition(
|
||||||
// clang-format on
|
// clang-format on
|
||||||
}
|
}
|
||||||
|
|
||||||
void Item_ShiftCol(ITEM_INFO *item, COLL_INFO *coll)
|
void Item_ShiftCol(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->pos.x += coll->shift.x;
|
item->pos.x += coll->shift.x;
|
||||||
item->pos.y += coll->shift.y;
|
item->pos.y += coll->shift.y;
|
||||||
|
@ -539,7 +535,7 @@ void Item_ShiftCol(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
coll->shift.z = 0;
|
coll->shift.z = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Item_Translate(ITEM_INFO *item, int32_t x, int32_t y, int32_t z)
|
void Item_Translate(ITEM *item, int32_t x, int32_t y, int32_t z)
|
||||||
{
|
{
|
||||||
int32_t c = Math_Cos(item->rot.y);
|
int32_t c = Math_Cos(item->rot.y);
|
||||||
int32_t s = Math_Sin(item->rot.y);
|
int32_t s = Math_Sin(item->rot.y);
|
||||||
|
@ -548,18 +544,18 @@ void Item_Translate(ITEM_INFO *item, int32_t x, int32_t y, int32_t z)
|
||||||
item->pos.z += (c * z - s * x) >> W2V_SHIFT;
|
item->pos.z += (c * z - s * x) >> W2V_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Item_TestAnimEqual(ITEM_INFO *item, int16_t anim_idx)
|
bool Item_TestAnimEqual(ITEM *item, int16_t anim_idx)
|
||||||
{
|
{
|
||||||
return item->anim_num == g_Objects[item->object_id].anim_idx + anim_idx;
|
return item->anim_num == g_Objects[item->object_id].anim_idx + anim_idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Item_SwitchToAnim(ITEM_INFO *item, int16_t anim_idx, int16_t frame)
|
void Item_SwitchToAnim(ITEM *item, int16_t anim_idx, int16_t frame)
|
||||||
{
|
{
|
||||||
Item_SwitchToObjAnim(item, anim_idx, frame, item->object_id);
|
Item_SwitchToObjAnim(item, anim_idx, frame, item->object_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Item_SwitchToObjAnim(
|
void Item_SwitchToObjAnim(
|
||||||
ITEM_INFO *item, int16_t anim_idx, int16_t frame, GAME_OBJECT_ID object_id)
|
ITEM *item, int16_t anim_idx, int16_t frame, GAME_OBJECT_ID object_id)
|
||||||
{
|
{
|
||||||
item->anim_num = g_Objects[object_id].anim_idx + anim_idx;
|
item->anim_num = g_Objects[object_id].anim_idx + anim_idx;
|
||||||
if (frame < 0) {
|
if (frame < 0) {
|
||||||
|
@ -569,7 +565,7 @@ void Item_SwitchToObjAnim(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Item_Animate(ITEM_INFO *item)
|
void Item_Animate(ITEM *item)
|
||||||
{
|
{
|
||||||
item->touch_bits = 0;
|
item->touch_bits = 0;
|
||||||
item->hit_status = 0;
|
item->hit_status = 0;
|
||||||
|
@ -672,7 +668,7 @@ void Item_Animate(ITEM_INFO *item)
|
||||||
item->pos.z += (Math_Cos(item->rot.y) * item->speed) >> W2V_SHIFT;
|
item->pos.z += (Math_Cos(item->rot.y) * item->speed) >> W2V_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Item_GetAnimChange(ITEM_INFO *item, ANIM *anim)
|
bool Item_GetAnimChange(ITEM *item, ANIM *anim)
|
||||||
{
|
{
|
||||||
if (item->current_anim_state == item->goal_anim_state) {
|
if (item->current_anim_state == item->goal_anim_state) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -699,7 +695,7 @@ bool Item_GetAnimChange(ITEM_INFO *item, ANIM *anim)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Item_PlayAnimSFX(ITEM_INFO *item, int16_t *command, uint16_t flags)
|
void Item_PlayAnimSFX(ITEM *item, int16_t *command, uint16_t flags)
|
||||||
{
|
{
|
||||||
if (item->frame_num != command[0]) {
|
if (item->frame_num != command[0]) {
|
||||||
return;
|
return;
|
||||||
|
@ -717,7 +713,7 @@ void Item_PlayAnimSFX(ITEM_INFO *item, int16_t *command, uint16_t flags)
|
||||||
Sound_Effect(SFX_ID_BITS(command[1]), &item->pos, flags);
|
Sound_Effect(SFX_ID_BITS(command[1]), &item->pos, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Item_IsTriggerActive(ITEM_INFO *item)
|
bool Item_IsTriggerActive(ITEM *item)
|
||||||
{
|
{
|
||||||
bool ok = !(item->flags & IF_REVERSE);
|
bool ok = !(item->flags & IF_REVERSE);
|
||||||
|
|
||||||
|
@ -742,7 +738,7 @@ bool Item_IsTriggerActive(ITEM_INFO *item)
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
FRAME_INFO *Item_GetBestFrame(const ITEM_INFO *item)
|
FRAME_INFO *Item_GetBestFrame(const ITEM *item)
|
||||||
{
|
{
|
||||||
FRAME_INFO *frmptr[2];
|
FRAME_INFO *frmptr[2];
|
||||||
int32_t rate;
|
int32_t rate;
|
||||||
|
@ -754,7 +750,7 @@ FRAME_INFO *Item_GetBestFrame(const ITEM_INFO *item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const BOUNDS_16 *Item_GetBoundsAccurate(const ITEM_INFO *item)
|
const BOUNDS_16 *Item_GetBoundsAccurate(const ITEM *item)
|
||||||
{
|
{
|
||||||
int32_t rate;
|
int32_t rate;
|
||||||
FRAME_INFO *frmptr[2];
|
FRAME_INFO *frmptr[2];
|
||||||
|
@ -777,8 +773,7 @@ const BOUNDS_16 *Item_GetBoundsAccurate(const ITEM_INFO *item)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Item_GetFrames(
|
int32_t Item_GetFrames(const ITEM *item, FRAME_INFO *frmptr[], int32_t *rate)
|
||||||
const ITEM_INFO *item, FRAME_INFO *frmptr[], int32_t *rate)
|
|
||||||
{
|
{
|
||||||
const ANIM *anim = &g_Anims[item->anim_num];
|
const ANIM *anim = &g_Anims[item->anim_num];
|
||||||
|
|
||||||
|
@ -825,20 +820,20 @@ int32_t Item_GetFrames(
|
||||||
return final * 10;
|
return final * 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Item_TestFrameEqual(ITEM_INFO *item, int16_t frame)
|
bool Item_TestFrameEqual(ITEM *item, int16_t frame)
|
||||||
{
|
{
|
||||||
return Anim_TestAbsFrameEqual(
|
return Anim_TestAbsFrameEqual(
|
||||||
item->frame_num, g_Anims[item->anim_num].frame_base + frame);
|
item->frame_num, g_Anims[item->anim_num].frame_base + frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Item_TestFrameRange(ITEM_INFO *item, int16_t start, int16_t end)
|
bool Item_TestFrameRange(ITEM *item, int16_t start, int16_t end)
|
||||||
{
|
{
|
||||||
return Anim_TestAbsFrameRange(
|
return Anim_TestAbsFrameRange(
|
||||||
item->frame_num, g_Anims[item->anim_num].frame_base + start,
|
item->frame_num, g_Anims[item->anim_num].frame_base + start,
|
||||||
g_Anims[item->anim_num].frame_base + end);
|
g_Anims[item->anim_num].frame_base + end);
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_INFO *Item_Get(const int16_t item_num)
|
ITEM *Item_Get(const int16_t item_num)
|
||||||
{
|
{
|
||||||
return &g_Items[item_num];
|
return &g_Items[item_num];
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
extern ITEM_INFO *g_Items;
|
extern ITEM *g_Items;
|
||||||
extern int16_t g_NextItemActive;
|
extern int16_t g_NextItemActive;
|
||||||
|
|
||||||
void Item_InitialiseArray(int32_t num_items);
|
void Item_InitialiseArray(int32_t num_items);
|
||||||
|
@ -18,44 +18,39 @@ void Item_RemoveActive(int16_t item_num);
|
||||||
void Item_RemoveDrawn(int16_t item_num);
|
void Item_RemoveDrawn(int16_t item_num);
|
||||||
void Item_AddActive(int16_t item_num);
|
void Item_AddActive(int16_t item_num);
|
||||||
void Item_NewRoom(int16_t item_num, int16_t room_num);
|
void Item_NewRoom(int16_t item_num, int16_t room_num);
|
||||||
void Item_UpdateRoom(ITEM_INFO *item, int32_t height);
|
void Item_UpdateRoom(ITEM *item, int32_t height);
|
||||||
int16_t Item_GetHeight(ITEM_INFO *item);
|
int16_t Item_GetHeight(ITEM *item);
|
||||||
int16_t Item_GetWaterHeight(ITEM_INFO *item);
|
int16_t Item_GetWaterHeight(ITEM *item);
|
||||||
int16_t Item_Spawn(const ITEM_INFO *item, GAME_OBJECT_ID object_id);
|
int16_t Item_Spawn(const ITEM *item, GAME_OBJECT_ID object_id);
|
||||||
int32_t Item_GlobalReplace(
|
int32_t Item_GlobalReplace(
|
||||||
GAME_OBJECT_ID src_object_id, GAME_OBJECT_ID dst_object_id);
|
GAME_OBJECT_ID src_object_id, GAME_OBJECT_ID dst_object_id);
|
||||||
|
|
||||||
bool Item_IsNearItem(
|
bool Item_IsNearItem(const ITEM *item, const XYZ_32 *pos, int32_t distance);
|
||||||
const ITEM_INFO *item, const XYZ_32 *pos, int32_t distance);
|
|
||||||
bool Item_Test3DRange(int32_t x, int32_t y, int32_t z, int32_t range);
|
bool Item_Test3DRange(int32_t x, int32_t y, int32_t z, int32_t range);
|
||||||
bool Item_TestBoundsCollide(
|
bool Item_TestBoundsCollide(ITEM *src_item, ITEM *dst_item, int32_t radius);
|
||||||
ITEM_INFO *src_item, ITEM_INFO *dst_item, int32_t radius);
|
|
||||||
bool Item_TestPosition(
|
bool Item_TestPosition(
|
||||||
const ITEM_INFO *src_item, const ITEM_INFO *dst_item,
|
const ITEM *src_item, const ITEM *dst_item, const OBJECT_BOUNDS *bounds);
|
||||||
const OBJECT_BOUNDS *bounds);
|
void Item_AlignPosition(ITEM *src_item, ITEM *dst_item, XYZ_32 *vec);
|
||||||
void Item_AlignPosition(ITEM_INFO *src_item, ITEM_INFO *dst_item, XYZ_32 *vec);
|
|
||||||
bool Item_MovePosition(
|
bool Item_MovePosition(
|
||||||
ITEM_INFO *src_item, const ITEM_INFO *dst_item, const XYZ_32 *vec,
|
ITEM *src_item, const ITEM *dst_item, const XYZ_32 *vec, int32_t velocity);
|
||||||
int32_t velocity);
|
void Item_ShiftCol(ITEM *item, COLL_INFO *coll);
|
||||||
void Item_ShiftCol(ITEM_INFO *item, COLL_INFO *coll);
|
void Item_Translate(ITEM *item, int32_t x, int32_t y, int32_t z);
|
||||||
void Item_Translate(ITEM_INFO *item, int32_t x, int32_t y, int32_t z);
|
int32_t Item_GetDistance(const ITEM *item, const XYZ_32 *target);
|
||||||
int32_t Item_GetDistance(const ITEM_INFO *item, const XYZ_32 *target);
|
|
||||||
|
|
||||||
bool Item_TestAnimEqual(ITEM_INFO *item, int16_t anim_idx);
|
bool Item_TestAnimEqual(ITEM *item, int16_t anim_idx);
|
||||||
void Item_SwitchToAnim(ITEM_INFO *item, int16_t anim_idx, int16_t frame);
|
void Item_SwitchToAnim(ITEM *item, int16_t anim_idx, int16_t frame);
|
||||||
void Item_SwitchToObjAnim(
|
void Item_SwitchToObjAnim(
|
||||||
ITEM_INFO *item, int16_t anim_idx, int16_t frame, GAME_OBJECT_ID object_id);
|
ITEM *item, int16_t anim_idx, int16_t frame, GAME_OBJECT_ID object_id);
|
||||||
void Item_Animate(ITEM_INFO *item);
|
void Item_Animate(ITEM *item);
|
||||||
bool Item_GetAnimChange(ITEM_INFO *item, ANIM *anim);
|
bool Item_GetAnimChange(ITEM *item, ANIM *anim);
|
||||||
void Item_PlayAnimSFX(ITEM_INFO *item, int16_t *command, uint16_t flags);
|
void Item_PlayAnimSFX(ITEM *item, int16_t *command, uint16_t flags);
|
||||||
|
|
||||||
bool Item_IsTriggerActive(ITEM_INFO *item);
|
bool Item_IsTriggerActive(ITEM *item);
|
||||||
|
|
||||||
FRAME_INFO *Item_GetBestFrame(const ITEM_INFO *item);
|
FRAME_INFO *Item_GetBestFrame(const ITEM *item);
|
||||||
const BOUNDS_16 *Item_GetBoundsAccurate(const ITEM_INFO *item);
|
const BOUNDS_16 *Item_GetBoundsAccurate(const ITEM *item);
|
||||||
int32_t Item_GetFrames(
|
int32_t Item_GetFrames(const ITEM *item, FRAME_INFO *frmptr[], int32_t *rate);
|
||||||
const ITEM_INFO *item, FRAME_INFO *frmptr[], int32_t *rate);
|
|
||||||
|
|
||||||
void Item_TakeDamage(ITEM_INFO *item, int16_t damage, bool hit_status);
|
void Item_TakeDamage(ITEM *item, int16_t damage, bool hit_status);
|
||||||
bool Item_TestFrameEqual(ITEM_INFO *item, int16_t frame);
|
bool Item_TestFrameEqual(ITEM *item, int16_t frame);
|
||||||
bool Item_TestFrameRange(ITEM_INFO *item, int16_t start, int16_t end);
|
bool Item_TestFrameRange(ITEM *item, int16_t start, int16_t end);
|
||||||
|
|
|
@ -175,7 +175,7 @@ bool Lara_Cheat_ExitFlyMode(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ROOM_INFO *const room = &g_RoomInfo[g_LaraItem->room_num];
|
const ROOM *const room = &g_RoomInfo[g_LaraItem->room_num];
|
||||||
const bool room_submerged = (room->flags & RF_UNDERWATER) != 0;
|
const bool room_submerged = (room->flags & RF_UNDERWATER) != 0;
|
||||||
const int16_t water_height = Room_GetWaterHeight(
|
const int16_t water_height = Room_GetWaterHeight(
|
||||||
g_LaraItem->pos.x, g_LaraItem->pos.y, g_LaraItem->pos.z,
|
g_LaraItem->pos.x, g_LaraItem->pos.y, g_LaraItem->pos.z,
|
||||||
|
@ -319,7 +319,7 @@ bool Lara_Cheat_OpenNearestDoor(void)
|
||||||
const int32_t shift = 8; // constant shift to avoid overflow errors
|
const int32_t shift = 8; // constant shift to avoid overflow errors
|
||||||
const int32_t max_dist = SQUARE((WALL_L * 2) >> shift);
|
const int32_t max_dist = SQUARE((WALL_L * 2) >> shift);
|
||||||
for (int item_num = 0; item_num < g_LevelItemCount; item_num++) {
|
for (int item_num = 0; item_num < g_LevelItemCount; item_num++) {
|
||||||
ITEM_INFO *const item = &g_Items[item_num];
|
ITEM *const item = &g_Items[item_num];
|
||||||
if (!Object_IsObjectType(item->object_id, g_DoorObjects)
|
if (!Object_IsObjectType(item->object_id, g_DoorObjects)
|
||||||
&& !Object_IsObjectType(item->object_id, g_TrapdoorObjects)) {
|
&& !Object_IsObjectType(item->object_id, g_TrapdoorObjects)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -358,7 +358,7 @@ bool Lara_Cheat_OpenNearestDoor(void)
|
||||||
|
|
||||||
bool Lara_Cheat_KillEnemy(const int16_t item_num)
|
bool Lara_Cheat_KillEnemy(const int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *const item = &g_Items[item_num];
|
ITEM *const item = &g_Items[item_num];
|
||||||
if (!Object_IsObjectType(item->object_id, g_EnemyObjects)
|
if (!Object_IsObjectType(item->object_id, g_EnemyObjects)
|
||||||
|| item->hit_points <= 0) {
|
|| item->hit_points <= 0) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -380,7 +380,7 @@ bool Lara_Cheat_Teleport(int32_t x, int32_t y, int32_t z)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SECTOR_INFO *sector = Room_GetSector(x, y, z, &room_num);
|
const SECTOR *sector = Room_GetSector(x, y, z, &room_num);
|
||||||
int16_t height = Room_GetHeight(sector, x, y, z);
|
int16_t height = Room_GetHeight(sector, x, y, z);
|
||||||
|
|
||||||
if (height == NO_HEIGHT) {
|
if (height == NO_HEIGHT) {
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#define LF_BACK_R_START 26
|
#define LF_BACK_R_START 26
|
||||||
#define LF_BACK_R_END 55
|
#define LF_BACK_R_END 55
|
||||||
|
|
||||||
void (*g_LaraCollisionRoutines[])(ITEM_INFO *item, COLL_INFO *coll) = {
|
void (*g_LaraCollisionRoutines[])(ITEM *item, COLL_INFO *coll) = {
|
||||||
Lara_Col_Walk, Lara_Col_Run, Lara_Col_Stop,
|
Lara_Col_Walk, Lara_Col_Run, Lara_Col_Stop,
|
||||||
Lara_Col_ForwardJump, Lara_Col_Pose, Lara_Col_FastBack,
|
Lara_Col_ForwardJump, Lara_Col_Pose, Lara_Col_FastBack,
|
||||||
Lara_Col_TurnR, Lara_Col_TurnL, Lara_Col_Death,
|
Lara_Col_TurnR, Lara_Col_TurnL, Lara_Col_Death,
|
||||||
|
@ -57,10 +57,10 @@ void (*g_LaraCollisionRoutines[])(ITEM_INFO *item, COLL_INFO *coll) = {
|
||||||
Lara_Col_Twist, Lara_Col_UWRoll,
|
Lara_Col_Twist, Lara_Col_UWRoll,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void M_Default(ITEM_INFO *item, COLL_INFO *coll);
|
static void M_Default(ITEM *item, COLL_INFO *coll);
|
||||||
static void M_Jumper(ITEM_INFO *item, COLL_INFO *coll);
|
static void M_Jumper(ITEM *item, COLL_INFO *coll);
|
||||||
|
|
||||||
static void M_Default(ITEM_INFO *item, COLL_INFO *coll)
|
static void M_Default(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
coll->bad_pos = STEPUP_HEIGHT;
|
coll->bad_pos = STEPUP_HEIGHT;
|
||||||
|
@ -71,7 +71,7 @@ static void M_Default(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
Lara_GetCollisionInfo(item, coll);
|
Lara_GetCollisionInfo(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_Jumper(ITEM_INFO *item, COLL_INFO *coll)
|
static void M_Jumper(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
coll->bad_neg = -STEPUP_HEIGHT;
|
coll->bad_neg = -STEPUP_HEIGHT;
|
||||||
|
@ -92,7 +92,7 @@ static void M_Jumper(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Walk(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Walk(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
|
@ -160,7 +160,7 @@ void Lara_Col_Walk(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Run(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Run(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (g_Config.fix_qwop_glitch) {
|
if (g_Config.fix_qwop_glitch) {
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
|
@ -226,7 +226,7 @@ void Lara_Col_Run(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Stop(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Stop(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
|
@ -263,7 +263,7 @@ void Lara_Col_Stop(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_ForwardJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_ForwardJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -292,12 +292,12 @@ void Lara_Col_ForwardJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Pose(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Pose(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara_Col_Stop(item, coll);
|
Lara_Col_Stop(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_FastBack(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_FastBack(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y - PHD_180;
|
g_Lara.move_angle = item->rot.y - PHD_180;
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
|
@ -329,7 +329,7 @@ void Lara_Col_FastBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_TurnR(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_TurnR(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
|
@ -357,12 +357,12 @@ void Lara_Col_TurnR(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_TurnL(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_TurnL(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara_Col_TurnR(item, coll);
|
Lara_Col_TurnR(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Death(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Death(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
coll->bad_pos = STEPUP_HEIGHT;
|
coll->bad_pos = STEPUP_HEIGHT;
|
||||||
|
@ -377,7 +377,7 @@ void Lara_Col_Death(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
g_Lara.air = -1;
|
g_Lara.air = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_FastFall(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_FastFall(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->gravity = 1;
|
item->gravity = 1;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -401,7 +401,7 @@ void Lara_Col_FastFall(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Hang(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Hang(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara_HangTest(item, coll);
|
Lara_HangTest(item, coll);
|
||||||
if (item->goal_anim_state == LS_HANG && g_Input.forward) {
|
if (item->goal_anim_state == LS_HANG && g_Input.forward) {
|
||||||
|
@ -415,7 +415,7 @@ void Lara_Col_Hang(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Reach(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Reach(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->gravity = 1;
|
item->gravity = 1;
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
|
@ -441,7 +441,7 @@ void Lara_Col_Reach(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Splat(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Splat(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
coll->bad_pos = STEPUP_HEIGHT;
|
coll->bad_pos = STEPUP_HEIGHT;
|
||||||
|
@ -453,12 +453,12 @@ void Lara_Col_Splat(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
Item_ShiftCol(item, coll);
|
Item_ShiftCol(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Land(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Land(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara_Col_Stop(item, coll);
|
Lara_Col_Stop(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Compress(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Compress(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
item->fall_speed = 0;
|
item->fall_speed = 0;
|
||||||
|
@ -480,7 +480,7 @@ void Lara_Col_Compress(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Back(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Back(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y - PHD_180;
|
g_Lara.move_angle = item->rot.y - PHD_180;
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
|
@ -520,17 +520,17 @@ void Lara_Col_Back(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Null(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Null(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_FastTurn(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_FastTurn(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara_Col_Stop(item, coll);
|
Lara_Col_Stop(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_StepRight(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_StepRight(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y + PHD_90;
|
g_Lara.move_angle = item->rot.y + PHD_90;
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
|
@ -561,7 +561,7 @@ void Lara_Col_StepRight(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_StepLeft(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_StepLeft(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y - PHD_90;
|
g_Lara.move_angle = item->rot.y - PHD_90;
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
|
@ -592,31 +592,31 @@ void Lara_Col_StepLeft(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Slide(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Slide(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
Lara_SlideSlope(item, coll);
|
Lara_SlideSlope(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_BackJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_BackJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y - PHD_180;
|
g_Lara.move_angle = item->rot.y - PHD_180;
|
||||||
M_Jumper(item, coll);
|
M_Jumper(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_RightJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_RightJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y + PHD_90;
|
g_Lara.move_angle = item->rot.y + PHD_90;
|
||||||
M_Jumper(item, coll);
|
M_Jumper(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_LeftJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_LeftJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y - PHD_90;
|
g_Lara.move_angle = item->rot.y - PHD_90;
|
||||||
M_Jumper(item, coll);
|
M_Jumper(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_UpJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_UpJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -662,7 +662,7 @@ void Lara_Col_UpJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->fall_speed = 0;
|
item->fall_speed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_FallBack(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_FallBack(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y - PHD_180;
|
g_Lara.move_angle = item->rot.y - PHD_180;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -684,82 +684,82 @@ void Lara_Col_FallBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_HangLeft(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_HangLeft(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y - PHD_90;
|
g_Lara.move_angle = item->rot.y - PHD_90;
|
||||||
Lara_HangTest(item, coll);
|
Lara_HangTest(item, coll);
|
||||||
g_Lara.move_angle = item->rot.y - PHD_90;
|
g_Lara.move_angle = item->rot.y - PHD_90;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_HangRight(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_HangRight(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y + PHD_90;
|
g_Lara.move_angle = item->rot.y + PHD_90;
|
||||||
Lara_HangTest(item, coll);
|
Lara_HangTest(item, coll);
|
||||||
g_Lara.move_angle = item->rot.y + PHD_90;
|
g_Lara.move_angle = item->rot.y + PHD_90;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_SlideBack(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_SlideBack(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y - PHD_180;
|
g_Lara.move_angle = item->rot.y - PHD_180;
|
||||||
Lara_SlideSlope(item, coll);
|
Lara_SlideSlope(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_PushBlock(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_PushBlock(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_PullBlock(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_PullBlock(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_PPReady(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_PPReady(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Pickup(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Pickup(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Controlled(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Controlled(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Twist(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Twist(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_UWRoll(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_UWRoll(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara_SwimCollision(item, coll);
|
Lara_SwimCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_SwitchOn(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_SwitchOn(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_SwitchOff(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_SwitchOff(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_UseKey(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_UseKey(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_UsePuzzle(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_UsePuzzle(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Roll(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Roll(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
|
@ -791,7 +791,7 @@ void Lara_Col_Roll(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Roll2(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Roll2(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y - PHD_180;
|
g_Lara.move_angle = item->rot.y - PHD_180;
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
|
@ -823,21 +823,21 @@ void Lara_Col_Roll2(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Special(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Special(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_UseMidas(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_UseMidas(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_DieMidas(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_DieMidas(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_SwanDive(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_SwanDive(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -855,7 +855,7 @@ void Lara_Col_SwanDive(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_FastDive(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_FastDive(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -877,67 +877,67 @@ void Lara_Col_FastDive(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Gymnast(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Gymnast(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_WaterOut(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_WaterOut(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
M_Default(item, coll);
|
M_Default(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_SurfSwim(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_SurfSwim(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
Lara_SurfaceCollision(item, coll);
|
Lara_SurfaceCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_SurfTread(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_SurfTread(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y;
|
g_Lara.move_angle = item->rot.y;
|
||||||
Lara_SurfaceCollision(item, coll);
|
Lara_SurfaceCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_SurfBack(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_SurfBack(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y - PHD_180;
|
g_Lara.move_angle = item->rot.y - PHD_180;
|
||||||
Lara_SurfaceCollision(item, coll);
|
Lara_SurfaceCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_SurfLeft(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_SurfLeft(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y - PHD_90;
|
g_Lara.move_angle = item->rot.y - PHD_90;
|
||||||
Lara_SurfaceCollision(item, coll);
|
Lara_SurfaceCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_SurfRight(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_SurfRight(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Lara.move_angle = item->rot.y + PHD_90;
|
g_Lara.move_angle = item->rot.y + PHD_90;
|
||||||
Lara_SurfaceCollision(item, coll);
|
Lara_SurfaceCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Swim(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Swim(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara_SwimCollision(item, coll);
|
Lara_SwimCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Glide(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Glide(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara_SwimCollision(item, coll);
|
Lara_SwimCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Tread(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Tread(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara_SwimCollision(item, coll);
|
Lara_SwimCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_Dive(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_Dive(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara_SwimCollision(item, coll);
|
Lara_SwimCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Col_UWDeath(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_Col_UWDeath(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->hit_points = -1;
|
item->hit_points = -1;
|
||||||
g_Lara.air = -1;
|
g_Lara.air = -1;
|
||||||
|
|
|
@ -4,64 +4,64 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
extern void (*g_LaraCollisionRoutines[])(ITEM_INFO *item, COLL_INFO *coll);
|
extern void (*g_LaraCollisionRoutines[])(ITEM *item, COLL_INFO *coll);
|
||||||
|
|
||||||
void Lara_Col_Walk(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Walk(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Run(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Run(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Stop(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Stop(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_ForwardJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_ForwardJump(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Pose(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Pose(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_FastBack(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_FastBack(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_TurnR(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_TurnR(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_TurnL(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_TurnL(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Death(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Death(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_FastFall(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_FastFall(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Hang(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Hang(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Reach(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Reach(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Splat(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Splat(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Tread(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Tread(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Land(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Land(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Compress(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Compress(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Back(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Back(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Swim(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Swim(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Glide(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Glide(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Null(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Null(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_FastTurn(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_FastTurn(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_StepRight(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_StepRight(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_StepLeft(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_StepLeft(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Roll2(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Roll2(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Slide(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Slide(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_BackJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_BackJump(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_RightJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_RightJump(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_LeftJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_LeftJump(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_UpJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_UpJump(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_FallBack(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_FallBack(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_HangLeft(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_HangLeft(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_HangRight(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_HangRight(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_SlideBack(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_SlideBack(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_SurfTread(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_SurfTread(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_SurfSwim(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_SurfSwim(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Dive(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Dive(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_PushBlock(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_PushBlock(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_PullBlock(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_PullBlock(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_PPReady(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_PPReady(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Pickup(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Pickup(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Controlled(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Controlled(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_SwitchOn(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_SwitchOn(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_SwitchOff(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_SwitchOff(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_UseKey(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_UseKey(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_UsePuzzle(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_UsePuzzle(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_UWDeath(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_UWDeath(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Roll(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Roll(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Special(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Special(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_SurfBack(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_SurfBack(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_SurfLeft(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_SurfLeft(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_SurfRight(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_SurfRight(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_UseMidas(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_UseMidas(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_DieMidas(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_DieMidas(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_SwanDive(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_SwanDive(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_FastDive(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_FastDive(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Gymnast(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Gymnast(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_WaterOut(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_WaterOut(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_Twist(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_Twist(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_Col_UWRoll(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_Col_UWRoll(ITEM *item, COLL_INFO *coll);
|
||||||
|
|
|
@ -37,7 +37,7 @@ LARA_INFO *Lara_GetLaraInfo(void)
|
||||||
return &g_Lara;
|
return &g_Lara;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_INFO *Lara_GetItem(void)
|
ITEM *Lara_GetItem(void)
|
||||||
{
|
{
|
||||||
return g_LaraItem;
|
return g_LaraItem;
|
||||||
}
|
}
|
||||||
|
@ -46,8 +46,8 @@ void Lara_Control(void)
|
||||||
{
|
{
|
||||||
COLL_INFO coll = { 0 };
|
COLL_INFO coll = { 0 };
|
||||||
|
|
||||||
ITEM_INFO *item = g_LaraItem;
|
ITEM *item = g_LaraItem;
|
||||||
const ROOM_INFO *const room = &g_RoomInfo[item->room_num];
|
const ROOM *const room = &g_RoomInfo[item->room_num];
|
||||||
const bool room_submerged = (room->flags & RF_UNDERWATER) != 0;
|
const bool room_submerged = (room->flags & RF_UNDERWATER) != 0;
|
||||||
|
|
||||||
if (g_Lara.interact_target.is_moving
|
if (g_Lara.interact_target.is_moving
|
||||||
|
@ -231,7 +231,7 @@ void Lara_SwapSingleMesh(const LARA_MESH mesh, const GAME_OBJECT_ID object_id)
|
||||||
g_Lara.mesh_ptrs[mesh] = g_Meshes[g_Objects[object_id].mesh_idx + mesh];
|
g_Lara.mesh_ptrs[mesh] = g_Meshes[g_Objects[object_id].mesh_idx + mesh];
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Animate(ITEM_INFO *item)
|
void Lara_Animate(ITEM *item)
|
||||||
{
|
{
|
||||||
int16_t *command;
|
int16_t *command;
|
||||||
ANIM *anim;
|
ANIM *anim;
|
||||||
|
@ -331,7 +331,7 @@ void Lara_Animate(ITEM_INFO *item)
|
||||||
item->pos.z += (Math_Cos(g_Lara.move_angle) * item->speed) >> W2V_SHIFT;
|
item->pos.z += (Math_Cos(g_Lara.move_angle) * item->speed) >> W2V_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_AnimateUntil(ITEM_INFO *lara_item, int32_t goal)
|
void Lara_AnimateUntil(ITEM *lara_item, int32_t goal)
|
||||||
{
|
{
|
||||||
lara_item->goal_anim_state = goal;
|
lara_item->goal_anim_state = goal;
|
||||||
do {
|
do {
|
||||||
|
@ -678,7 +678,7 @@ int16_t Lara_GetNearestEnemy(void)
|
||||||
int16_t best_item_num = NO_ITEM;
|
int16_t best_item_num = NO_ITEM;
|
||||||
int16_t item_num = g_NextItemActive;
|
int16_t item_num = g_NextItemActive;
|
||||||
while (item_num != NO_ITEM) {
|
while (item_num != NO_ITEM) {
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (Object_IsObjectType(item->object_id, g_EnemyObjects)) {
|
if (Object_IsObjectType(item->object_id, g_EnemyObjects)) {
|
||||||
const int32_t distance = Item_GetDistance(item, &g_LaraItem->pos);
|
const int32_t distance = Item_GetDistance(item, &g_LaraItem->pos);
|
||||||
|
@ -694,22 +694,22 @@ int16_t Lara_GetNearestEnemy(void)
|
||||||
return best_item_num;
|
return best_item_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_TestBoundsCollide(ITEM_INFO *item, int32_t radius)
|
bool Lara_TestBoundsCollide(ITEM *item, int32_t radius)
|
||||||
{
|
{
|
||||||
return Item_TestBoundsCollide(g_LaraItem, item, radius);
|
return Item_TestBoundsCollide(g_LaraItem, item, radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_TestPosition(const ITEM_INFO *item, const OBJECT_BOUNDS *const bounds)
|
bool Lara_TestPosition(const ITEM *item, const OBJECT_BOUNDS *const bounds)
|
||||||
{
|
{
|
||||||
return Item_TestPosition(g_LaraItem, item, bounds);
|
return Item_TestPosition(g_LaraItem, item, bounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_AlignPosition(ITEM_INFO *item, XYZ_32 *vec)
|
void Lara_AlignPosition(ITEM *item, XYZ_32 *vec)
|
||||||
{
|
{
|
||||||
Item_AlignPosition(g_LaraItem, item, vec);
|
Item_AlignPosition(g_LaraItem, item, vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_MovePosition(ITEM_INFO *item, XYZ_32 *vec)
|
bool Lara_MovePosition(ITEM *item, XYZ_32 *vec)
|
||||||
{
|
{
|
||||||
int32_t velocity =
|
int32_t velocity =
|
||||||
g_Config.walk_to_items && g_Lara.water_status != LWS_UNDERWATER
|
g_Config.walk_to_items && g_Lara.water_status != LWS_UNDERWATER
|
||||||
|
@ -719,9 +719,9 @@ bool Lara_MovePosition(ITEM_INFO *item, XYZ_32 *vec)
|
||||||
return Item_MovePosition(g_LaraItem, item, vec, velocity);
|
return Item_MovePosition(g_LaraItem, item, vec, velocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Push(ITEM_INFO *item, COLL_INFO *coll, bool spaz_on, bool big_push)
|
void Lara_Push(ITEM *item, COLL_INFO *coll, bool spaz_on, bool big_push)
|
||||||
{
|
{
|
||||||
ITEM_INFO *const lara_item = g_LaraItem;
|
ITEM *const lara_item = g_LaraItem;
|
||||||
int32_t x = lara_item->pos.x - item->pos.x;
|
int32_t x = lara_item->pos.x - item->pos.x;
|
||||||
int32_t z = lara_item->pos.z - item->pos.z;
|
int32_t z = lara_item->pos.z - item->pos.z;
|
||||||
const int32_t c = Math_Cos(item->rot.y);
|
const int32_t c = Math_Cos(item->rot.y);
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
void Lara_Control(void);
|
void Lara_Control(void);
|
||||||
|
|
||||||
void Lara_ControlExtra(int16_t item_num);
|
void Lara_ControlExtra(int16_t item_num);
|
||||||
void Lara_Animate(ITEM_INFO *item);
|
void Lara_Animate(ITEM *item);
|
||||||
void Lara_AnimateUntil(ITEM_INFO *lara_item, int32_t goal);
|
void Lara_AnimateUntil(ITEM *lara_item, int32_t goal);
|
||||||
|
|
||||||
void Lara_Initialise(int32_t level_num);
|
void Lara_Initialise(int32_t level_num);
|
||||||
void Lara_InitialiseLoad(int16_t item_num);
|
void Lara_InitialiseLoad(int16_t item_num);
|
||||||
|
@ -24,11 +24,11 @@ bool Lara_IsNearItem(const XYZ_32 *pos, int32_t distance);
|
||||||
void Lara_UseItem(GAME_OBJECT_ID object_id);
|
void Lara_UseItem(GAME_OBJECT_ID object_id);
|
||||||
int16_t Lara_GetNearestEnemy(void);
|
int16_t Lara_GetNearestEnemy(void);
|
||||||
|
|
||||||
bool Lara_TestBoundsCollide(ITEM_INFO *item, int32_t radius);
|
bool Lara_TestBoundsCollide(ITEM *item, int32_t radius);
|
||||||
bool Lara_TestPosition(const ITEM_INFO *item, const OBJECT_BOUNDS *bounds);
|
bool Lara_TestPosition(const ITEM *item, const OBJECT_BOUNDS *bounds);
|
||||||
void Lara_AlignPosition(ITEM_INFO *item, XYZ_32 *vec);
|
void Lara_AlignPosition(ITEM *item, XYZ_32 *vec);
|
||||||
bool Lara_MovePosition(ITEM_INFO *item, XYZ_32 *vec);
|
bool Lara_MovePosition(ITEM *item, XYZ_32 *vec);
|
||||||
void Lara_Push(ITEM_INFO *item, COLL_INFO *coll, bool spaz_on, bool big_push);
|
void Lara_Push(ITEM *item, COLL_INFO *coll, bool spaz_on, bool big_push);
|
||||||
|
|
||||||
void Lara_TakeDamage(int16_t damage, bool hit_status);
|
void Lara_TakeDamage(int16_t damage, bool hit_status);
|
||||||
|
|
||||||
|
|
|
@ -27,15 +27,15 @@
|
||||||
static int32_t m_OpenDoorsCheatCooldown = 0;
|
static int32_t m_OpenDoorsCheatCooldown = 0;
|
||||||
|
|
||||||
static void M_WaterCurrent(COLL_INFO *coll);
|
static void M_WaterCurrent(COLL_INFO *coll);
|
||||||
static void M_BaddieCollision(ITEM_INFO *lara_item, COLL_INFO *coll);
|
static void M_BaddieCollision(ITEM *lara_item, COLL_INFO *coll);
|
||||||
|
|
||||||
static void M_WaterCurrent(COLL_INFO *coll)
|
static void M_WaterCurrent(COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
XYZ_32 target;
|
XYZ_32 target;
|
||||||
|
|
||||||
ITEM_INFO *const item = g_LaraItem;
|
ITEM *const item = g_LaraItem;
|
||||||
const ROOM_INFO *const r = &g_RoomInfo[item->room_num];
|
const ROOM *const r = &g_RoomInfo[item->room_num];
|
||||||
const SECTOR_INFO *const sector =
|
const SECTOR *const sector =
|
||||||
&r->sectors
|
&r->sectors
|
||||||
[((item->pos.z - r->z) >> WALL_SHIFT)
|
[((item->pos.z - r->z) >> WALL_SHIFT)
|
||||||
+ ((item->pos.x - r->x) >> WALL_SHIFT) * r->z_size];
|
+ ((item->pos.x - r->x) >> WALL_SHIFT) * r->z_size];
|
||||||
|
@ -109,7 +109,7 @@ static void M_WaterCurrent(COLL_INFO *coll)
|
||||||
coll->old.z = item->pos.z;
|
coll->old.z = item->pos.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_BaddieCollision(ITEM_INFO *lara_item, COLL_INFO *coll)
|
static void M_BaddieCollision(ITEM *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
lara_item->hit_status = 0;
|
lara_item->hit_status = 0;
|
||||||
g_Lara.hit_direction = -1;
|
g_Lara.hit_direction = -1;
|
||||||
|
@ -122,22 +122,22 @@ static void M_BaddieCollision(ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
|
|
||||||
roomies[numroom++] = lara_item->room_num;
|
roomies[numroom++] = lara_item->room_num;
|
||||||
|
|
||||||
DOOR_INFOS *door = g_RoomInfo[lara_item->room_num].doors;
|
PORTALS *portals = g_RoomInfo[lara_item->room_num].portals;
|
||||||
if (door) {
|
if (portals != NULL) {
|
||||||
for (int i = 0; i < door->count; i++) {
|
for (int i = 0; i < portals->count; i++) {
|
||||||
if (numroom >= MAX_BADDIE_COLLISION) {
|
if (numroom >= MAX_BADDIE_COLLISION) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
roomies[numroom++] = door->door[i].room_num;
|
roomies[numroom++] = portals->portal[i].room_num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < numroom; i++) {
|
for (int i = 0; i < numroom; i++) {
|
||||||
int16_t item_num = g_RoomInfo[roomies[i]].item_num;
|
int16_t item_num = g_RoomInfo[roomies[i]].item_num;
|
||||||
while (item_num != NO_ITEM) {
|
while (item_num != NO_ITEM) {
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
if (item->collidable && item->status != IS_INVISIBLE) {
|
if (item->collidable && item->status != IS_INVISIBLE) {
|
||||||
OBJECT_INFO *object = &g_Objects[item->object_id];
|
OBJECT *object = &g_Objects[item->object_id];
|
||||||
if (object->collision) {
|
if (object->collision) {
|
||||||
int32_t x = lara_item->pos.x - item->pos.x;
|
int32_t x = lara_item->pos.x - item->pos.x;
|
||||||
int32_t y = lara_item->pos.y - item->pos.y;
|
int32_t y = lara_item->pos.y - item->pos.y;
|
||||||
|
@ -175,7 +175,7 @@ static void M_BaddieCollision(ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_HandleAboveWater(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_HandleAboveWater(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->old.x = item->pos.x;
|
coll->old.x = item->pos.x;
|
||||||
coll->old.y = item->pos.y;
|
coll->old.y = item->pos.y;
|
||||||
|
@ -242,7 +242,7 @@ void Lara_HandleAboveWater(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
Room_TestTriggers(item);
|
Room_TestTriggers(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_HandleSurface(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_HandleSurface(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Camera.target_elevation = -22 * PHD_DEGREE;
|
g_Camera.target_elevation = -22 * PHD_DEGREE;
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ void Lara_HandleSurface(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
Room_TestTriggers(item);
|
Room_TestTriggers(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_HandleUnderwater(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_HandleUnderwater(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
coll->bad_neg = -UW_HEIGHT;
|
coll->bad_neg = -UW_HEIGHT;
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void Lara_HandleAboveWater(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_HandleAboveWater(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_HandleUnderwater(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_HandleUnderwater(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_HandleSurface(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_HandleSurface(ITEM *item, COLL_INFO *coll);
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
#include "global/vars.h"
|
#include "global/vars.h"
|
||||||
#include "math/matrix.h"
|
#include "math/matrix.h"
|
||||||
|
|
||||||
void Lara_Draw(ITEM_INFO *item)
|
void Lara_Draw(ITEM *item)
|
||||||
{
|
{
|
||||||
OBJECT_INFO *object;
|
OBJECT *object;
|
||||||
FRAME_INFO *frame;
|
FRAME_INFO *frame;
|
||||||
FRAME_INFO *frmptr[2];
|
FRAME_INFO *frmptr[2];
|
||||||
MATRIX saved_matrix;
|
MATRIX saved_matrix;
|
||||||
|
@ -326,12 +326,12 @@ end:
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_Draw_I(
|
void Lara_Draw_I(
|
||||||
ITEM_INFO *item, FRAME_INFO *frame1, FRAME_INFO *frame2, int32_t frac,
|
ITEM *item, FRAME_INFO *frame1, FRAME_INFO *frame2, int32_t frac,
|
||||||
int32_t rate)
|
int32_t rate)
|
||||||
{
|
{
|
||||||
MATRIX saved_matrix;
|
MATRIX saved_matrix;
|
||||||
|
|
||||||
OBJECT_INFO *object = &g_Objects[item->object_id];
|
OBJECT *object = &g_Objects[item->object_id];
|
||||||
const BOUNDS_16 *const bounds = Item_GetBoundsAccurate(item);
|
const BOUNDS_16 *const bounds = Item_GetBoundsAccurate(item);
|
||||||
|
|
||||||
saved_matrix = *g_MatrixPtr;
|
saved_matrix = *g_MatrixPtr;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void Lara_Draw(ITEM_INFO *item);
|
void Lara_Draw(ITEM *item);
|
||||||
void Lara_Draw_I(
|
void Lara_Draw_I(
|
||||||
ITEM_INFO *item, FRAME_INFO *frame1, FRAME_INFO *frame2, int32_t frac,
|
ITEM *item, FRAME_INFO *frame1, FRAME_INFO *frame2, int32_t frac,
|
||||||
int32_t rate);
|
int32_t rate);
|
||||||
|
|
|
@ -87,7 +87,7 @@ void Lara_Hair_Control(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool in_cutscene;
|
bool in_cutscene;
|
||||||
OBJECT_INFO *object;
|
OBJECT *object;
|
||||||
int32_t *bone;
|
int32_t *bone;
|
||||||
int32_t distance;
|
int32_t distance;
|
||||||
FRAME_INFO *frame;
|
FRAME_INFO *frame;
|
||||||
|
@ -96,7 +96,7 @@ void Lara_Hair_Control(void)
|
||||||
FRAME_INFO *frmptr[2];
|
FRAME_INFO *frmptr[2];
|
||||||
int16_t **mesh_base;
|
int16_t **mesh_base;
|
||||||
XYZ_32 pos;
|
XYZ_32 pos;
|
||||||
const SECTOR_INFO *sector;
|
const SECTOR *sector;
|
||||||
int32_t i;
|
int32_t i;
|
||||||
int32_t water_level;
|
int32_t water_level;
|
||||||
int32_t height;
|
int32_t height;
|
||||||
|
@ -382,6 +382,7 @@ void Lara_Hair_Control(void)
|
||||||
|
|
||||||
case LWS_UNDERWATER:
|
case LWS_UNDERWATER:
|
||||||
case LWS_SURFACE:
|
case LWS_SURFACE:
|
||||||
|
case LWS_CHEAT:
|
||||||
if (m_Hair[i].pos.y < water_level) {
|
if (m_Hair[i].pos.y < water_level) {
|
||||||
m_Hair[i].pos.y = water_level;
|
m_Hair[i].pos.y = water_level;
|
||||||
} else if (m_Hair[i].pos.y > height) {
|
} else if (m_Hair[i].pos.y > height) {
|
||||||
|
@ -448,7 +449,7 @@ void Lara_Hair_Draw(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJECT_INFO *object = &g_Objects[O_HAIR];
|
OBJECT *object = &g_Objects[O_HAIR];
|
||||||
int16_t mesh_idx = object->mesh_idx;
|
int16_t mesh_idx = object->mesh_idx;
|
||||||
if ((g_Lara.mesh_effects & (1 << LM_HEAD))
|
if ((g_Lara.mesh_effects & (1 << LM_HEAD))
|
||||||
&& object->nmeshes >= HAIR_SEGMENTS * 2) {
|
&& object->nmeshes >= HAIR_SEGMENTS * 2) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef struct HAIR_SEGMENT {
|
typedef struct {
|
||||||
XYZ_32 pos;
|
XYZ_32 pos;
|
||||||
XYZ_16 rot;
|
XYZ_16 rot;
|
||||||
struct {
|
struct {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#define LF_STARTHANG 12
|
#define LF_STARTHANG 12
|
||||||
#define LF_HANG 21
|
#define LF_HANG 21
|
||||||
|
|
||||||
void Lara_GetCollisionInfo(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_GetCollisionInfo(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->facing = g_Lara.move_angle;
|
coll->facing = g_Lara.move_angle;
|
||||||
Collide_GetCollisionInfo(
|
Collide_GetCollisionInfo(
|
||||||
|
@ -29,7 +29,7 @@ void Lara_GetCollisionInfo(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
LARA_HEIGHT);
|
LARA_HEIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_HangTest(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_HangTest(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
const BOUNDS_16 *bounds;
|
const BOUNDS_16 *bounds;
|
||||||
|
@ -124,7 +124,7 @@ void Lara_HangTest(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_SlideSlope(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_SlideSlope(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
coll->bad_neg = -512;
|
coll->bad_neg = -512;
|
||||||
|
@ -160,7 +160,7 @@ void Lara_SlideSlope(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_Fallen(ITEM_INFO *item, COLL_INFO *coll)
|
bool Lara_Fallen(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (coll->mid_floor <= STEPUP_HEIGHT) {
|
if (coll->mid_floor <= STEPUP_HEIGHT) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -173,7 +173,7 @@ bool Lara_Fallen(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_HitCeiling(ITEM_INFO *item, COLL_INFO *coll)
|
bool Lara_HitCeiling(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (coll->coll_type != COLL_TOP && coll->coll_type != COLL_CLAMP) {
|
if (coll->coll_type != COLL_TOP && coll->coll_type != COLL_CLAMP) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -190,7 +190,7 @@ bool Lara_HitCeiling(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->speed = 0;
|
item->speed = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool Lara_DeflectEdge(ITEM_INFO *item, COLL_INFO *coll)
|
bool Lara_DeflectEdge(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (coll->coll_type == COLL_FRONT || coll->coll_type == COLL_TOPFRONT) {
|
if (coll->coll_type == COLL_FRONT || coll->coll_type == COLL_TOPFRONT) {
|
||||||
Item_ShiftCol(item, coll);
|
Item_ShiftCol(item, coll);
|
||||||
|
@ -211,7 +211,7 @@ bool Lara_DeflectEdge(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_DeflectEdgeJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_DeflectEdgeJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Item_ShiftCol(item, coll);
|
Item_ShiftCol(item, coll);
|
||||||
switch (coll->coll_type) {
|
switch (coll->coll_type) {
|
||||||
|
@ -253,7 +253,7 @@ void Lara_DeflectEdgeJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_SlideEdgeJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_SlideEdgeJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Item_ShiftCol(item, coll);
|
Item_ShiftCol(item, coll);
|
||||||
switch (coll->coll_type) {
|
switch (coll->coll_type) {
|
||||||
|
@ -284,7 +284,7 @@ void Lara_SlideEdgeJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_TestVault(ITEM_INFO *item, COLL_INFO *coll)
|
bool Lara_TestVault(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (coll->coll_type != COLL_FRONT || !g_Input.action
|
if (coll->coll_type != COLL_FRONT || !g_Input.action
|
||||||
|| g_Lara.gun_status != LGS_ARMLESS
|
|| g_Lara.gun_status != LGS_ARMLESS
|
||||||
|
@ -356,7 +356,7 @@ bool Lara_TestVault(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_TestHangJump(ITEM_INFO *item, COLL_INFO *coll)
|
bool Lara_TestHangJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (coll->coll_type != COLL_FRONT || !g_Input.action
|
if (coll->coll_type != COLL_FRONT || !g_Input.action
|
||||||
|| g_Lara.gun_status != LGS_ARMLESS
|
|| g_Lara.gun_status != LGS_ARMLESS
|
||||||
|
@ -415,7 +415,7 @@ bool Lara_TestHangJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_TestHangSwingIn(ITEM_INFO *item, PHD_ANGLE angle)
|
bool Lara_TestHangSwingIn(ITEM *item, PHD_ANGLE angle)
|
||||||
{
|
{
|
||||||
int x = item->pos.x;
|
int x = item->pos.x;
|
||||||
int y = item->pos.y;
|
int y = item->pos.y;
|
||||||
|
@ -436,7 +436,7 @@ bool Lara_TestHangSwingIn(ITEM_INFO *item, PHD_ANGLE angle)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SECTOR_INFO *const sector = Room_GetSector(x, y, z, &room_num);
|
const SECTOR *const sector = Room_GetSector(x, y, z, &room_num);
|
||||||
const int32_t h = Room_GetHeight(sector, x, y, z);
|
const int32_t h = Room_GetHeight(sector, x, y, z);
|
||||||
const int32_t c = Room_GetCeiling(sector, x, y, z);
|
const int32_t c = Room_GetCeiling(sector, x, y, z);
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@ bool Lara_TestHangSwingIn(ITEM_INFO *item, PHD_ANGLE angle)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_TestHangJumpUp(ITEM_INFO *item, COLL_INFO *coll)
|
bool Lara_TestHangJumpUp(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (coll->coll_type != COLL_FRONT || !g_Input.action
|
if (coll->coll_type != COLL_FRONT || !g_Input.action
|
||||||
|| g_Lara.gun_status != LGS_ARMLESS
|
|| g_Lara.gun_status != LGS_ARMLESS
|
||||||
|
@ -501,7 +501,7 @@ bool Lara_TestHangJumpUp(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_TestSlide(ITEM_INFO *item, COLL_INFO *coll)
|
bool Lara_TestSlide(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
static PHD_ANGLE old_angle = 1;
|
static PHD_ANGLE old_angle = 1;
|
||||||
|
|
||||||
|
@ -545,11 +545,11 @@ bool Lara_TestSlide(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_LandedBad(ITEM_INFO *item, COLL_INFO *coll)
|
bool Lara_LandedBad(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
int16_t room_num = item->room_num;
|
int16_t room_num = item->room_num;
|
||||||
|
|
||||||
const SECTOR_INFO *const sector =
|
const SECTOR *const sector =
|
||||||
Room_GetSector(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
Room_GetSector(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
|
|
||||||
const int32_t old_y = item->pos.y;
|
const int32_t old_y = item->pos.y;
|
||||||
|
@ -580,7 +580,7 @@ bool Lara_LandedBad(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_SurfaceCollision(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_SurfaceCollision(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->facing = g_Lara.move_angle;
|
coll->facing = g_Lara.move_angle;
|
||||||
|
|
||||||
|
@ -619,7 +619,7 @@ void Lara_SurfaceCollision(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
Lara_TestWaterClimbOut(item, coll);
|
Lara_TestWaterClimbOut(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Lara_TestWaterClimbOut(ITEM_INFO *item, COLL_INFO *coll)
|
bool Lara_TestWaterClimbOut(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->rot.y != g_Lara.move_angle) {
|
if (item->rot.y != g_Lara.move_angle) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -687,7 +687,7 @@ bool Lara_TestWaterClimbOut(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_SwimCollision(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_SwimCollision(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->rot.x >= -PHD_90 && item->rot.x <= PHD_90) {
|
if (item->rot.x >= -PHD_90 && item->rot.x <= PHD_90) {
|
||||||
g_Lara.move_angle = coll->facing = item->rot.y;
|
g_Lara.move_angle = coll->facing = item->rot.y;
|
||||||
|
@ -750,7 +750,7 @@ void Lara_CatchFire(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t room_num = g_LaraItem->room_num;
|
int16_t room_num = g_LaraItem->room_num;
|
||||||
const SECTOR_INFO *const sector = Room_GetSector(
|
const SECTOR *const sector = Room_GetSector(
|
||||||
g_LaraItem->pos.x, MAX_HEIGHT, g_LaraItem->pos.z, &room_num);
|
g_LaraItem->pos.x, MAX_HEIGHT, g_LaraItem->pos.z, &room_num);
|
||||||
const int16_t height = Room_GetHeight(
|
const int16_t height = Room_GetHeight(
|
||||||
sector, g_LaraItem->pos.x, MAX_HEIGHT, g_LaraItem->pos.z);
|
sector, g_LaraItem->pos.x, MAX_HEIGHT, g_LaraItem->pos.z);
|
||||||
|
@ -769,7 +769,7 @@ void Lara_CatchFire(void)
|
||||||
for (int32_t i = 0; i < 10; i++) {
|
for (int32_t i = 0; i < 10; i++) {
|
||||||
const int16_t fx_num = Effect_Create(g_LaraItem->room_num);
|
const int16_t fx_num = Effect_Create(g_LaraItem->room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO *const fx = &g_Effects[fx_num];
|
FX *const fx = &g_Effects[fx_num];
|
||||||
fx->object_id = O_FLAME;
|
fx->object_id = O_FLAME;
|
||||||
fx->frame_num =
|
fx->frame_num =
|
||||||
(g_Objects[O_FLAME].nmeshes * Random_GetControl()) / 0x7FFF;
|
(g_Objects[O_FLAME].nmeshes * Random_GetControl()) / 0x7FFF;
|
||||||
|
@ -783,7 +783,7 @@ void Lara_Extinguish(void)
|
||||||
// put out flame objects
|
// put out flame objects
|
||||||
int16_t fx_num = g_NextFxActive;
|
int16_t fx_num = g_NextFxActive;
|
||||||
while (fx_num != NO_ITEM) {
|
while (fx_num != NO_ITEM) {
|
||||||
FX_INFO *const fx = &g_Effects[fx_num];
|
FX *const fx = &g_Effects[fx_num];
|
||||||
const int16_t next_fx_num = fx->next_active;
|
const int16_t next_fx_num = fx->next_active;
|
||||||
if (fx->object_id == O_FLAME && fx->counter < 0) {
|
if (fx->object_id == O_FLAME && fx->counter < 0) {
|
||||||
fx->counter = 0;
|
fx->counter = 0;
|
||||||
|
|
|
@ -6,21 +6,21 @@
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
void Lara_GetCollisionInfo(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_GetCollisionInfo(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_HangTest(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_HangTest(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_SlideSlope(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_SlideSlope(ITEM *item, COLL_INFO *coll);
|
||||||
bool Lara_Fallen(ITEM_INFO *item, COLL_INFO *coll);
|
bool Lara_Fallen(ITEM *item, COLL_INFO *coll);
|
||||||
bool Lara_HitCeiling(ITEM_INFO *item, COLL_INFO *coll);
|
bool Lara_HitCeiling(ITEM *item, COLL_INFO *coll);
|
||||||
bool Lara_DeflectEdge(ITEM_INFO *item, COLL_INFO *coll);
|
bool Lara_DeflectEdge(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_DeflectEdgeJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_DeflectEdgeJump(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_SlideEdgeJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_SlideEdgeJump(ITEM *item, COLL_INFO *coll);
|
||||||
bool Lara_TestVault(ITEM_INFO *item, COLL_INFO *coll);
|
bool Lara_TestVault(ITEM *item, COLL_INFO *coll);
|
||||||
bool Lara_TestHangJump(ITEM_INFO *item, COLL_INFO *coll);
|
bool Lara_TestHangJump(ITEM *item, COLL_INFO *coll);
|
||||||
bool Lara_TestHangJumpUp(ITEM_INFO *item, COLL_INFO *coll);
|
bool Lara_TestHangJumpUp(ITEM *item, COLL_INFO *coll);
|
||||||
bool Lara_TestHangSwingIn(ITEM_INFO *item, PHD_ANGLE angle);
|
bool Lara_TestHangSwingIn(ITEM *item, PHD_ANGLE angle);
|
||||||
bool Lara_TestSlide(ITEM_INFO *item, COLL_INFO *coll);
|
bool Lara_TestSlide(ITEM *item, COLL_INFO *coll);
|
||||||
bool Lara_LandedBad(ITEM_INFO *item, COLL_INFO *coll);
|
bool Lara_LandedBad(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_SwimCollision(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_SwimCollision(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_SurfaceCollision(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_SurfaceCollision(ITEM *item, COLL_INFO *coll);
|
||||||
bool Lara_TestWaterClimbOut(ITEM_INFO *item, COLL_INFO *coll);
|
bool Lara_TestWaterClimbOut(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_CatchFire(void);
|
void Lara_CatchFire(void);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#define LF_ROLL 2
|
#define LF_ROLL 2
|
||||||
#define LF_JUMP_READY 3
|
#define LF_JUMP_READY 3
|
||||||
|
|
||||||
void (*g_LaraStateRoutines[])(ITEM_INFO *item, COLL_INFO *coll) = {
|
void (*g_LaraStateRoutines[])(ITEM *item, COLL_INFO *coll) = {
|
||||||
Lara_State_Walk, Lara_State_Run, Lara_State_Stop,
|
Lara_State_Walk, Lara_State_Run, Lara_State_Stop,
|
||||||
Lara_State_ForwardJump, Lara_State_Pose, Lara_State_FastBack,
|
Lara_State_ForwardJump, Lara_State_Pose, Lara_State_FastBack,
|
||||||
Lara_State_TurnR, Lara_State_TurnL, Lara_State_Death,
|
Lara_State_TurnR, Lara_State_TurnL, Lara_State_Death,
|
||||||
|
@ -44,15 +44,15 @@ void (*g_LaraStateRoutines[])(ITEM_INFO *item, COLL_INFO *coll) = {
|
||||||
|
|
||||||
static bool m_JumpPermitted = true;
|
static bool m_JumpPermitted = true;
|
||||||
|
|
||||||
static int16_t M_FloorFront(ITEM_INFO *item, PHD_ANGLE ang, int32_t dist);
|
static int16_t M_FloorFront(ITEM *item, PHD_ANGLE ang, int32_t dist);
|
||||||
|
|
||||||
static int16_t M_FloorFront(ITEM_INFO *item, PHD_ANGLE ang, int32_t dist)
|
static int16_t M_FloorFront(ITEM *item, PHD_ANGLE ang, int32_t dist)
|
||||||
{
|
{
|
||||||
int32_t x = item->pos.x + ((Math_Sin(ang) * dist) >> W2V_SHIFT);
|
int32_t x = item->pos.x + ((Math_Sin(ang) * dist) >> W2V_SHIFT);
|
||||||
int32_t y = item->pos.y - LARA_HEIGHT;
|
int32_t y = item->pos.y - LARA_HEIGHT;
|
||||||
int32_t z = item->pos.z + ((Math_Cos(ang) * dist) >> W2V_SHIFT);
|
int32_t z = item->pos.z + ((Math_Cos(ang) * dist) >> W2V_SHIFT);
|
||||||
int16_t room_num = item->room_num;
|
int16_t room_num = item->room_num;
|
||||||
const SECTOR_INFO *const sector = Room_GetSector(x, y, z, &room_num);
|
const SECTOR *const sector = Room_GetSector(x, y, z, &room_num);
|
||||||
int32_t height = Room_GetHeight(sector, x, y, z);
|
int32_t height = Room_GetHeight(sector, x, y, z);
|
||||||
if (height != NO_HEIGHT) {
|
if (height != NO_HEIGHT) {
|
||||||
height -= item->pos.y;
|
height -= item->pos.y;
|
||||||
|
@ -60,7 +60,7 @@ static int16_t M_FloorFront(ITEM_INFO *item, PHD_ANGLE ang, int32_t dist)
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Walk(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Walk(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_STOP;
|
item->goal_anim_state = LS_STOP;
|
||||||
|
@ -89,7 +89,7 @@ void Lara_State_Walk(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Run(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Run(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_DEATH;
|
item->goal_anim_state = LS_DEATH;
|
||||||
|
@ -142,7 +142,7 @@ void Lara_State_Run(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Stop(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Stop(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_DEATH;
|
item->goal_anim_state = LS_DEATH;
|
||||||
|
@ -201,7 +201,7 @@ void Lara_State_Stop(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_ForwardJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_ForwardJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->goal_anim_state == LS_SWAN_DIVE
|
if (item->goal_anim_state == LS_SWAN_DIVE
|
||||||
|| item->goal_anim_state == LS_REACH) {
|
|| item->goal_anim_state == LS_REACH) {
|
||||||
|
@ -236,11 +236,11 @@ void Lara_State_ForwardJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Pose(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Pose(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_FastBack(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_FastBack(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->goal_anim_state = LS_STOP;
|
item->goal_anim_state = LS_STOP;
|
||||||
if (g_Input.left) {
|
if (g_Input.left) {
|
||||||
|
@ -256,7 +256,7 @@ void Lara_State_FastBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_TurnR(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_TurnR(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_STOP;
|
item->goal_anim_state = LS_STOP;
|
||||||
|
@ -286,7 +286,7 @@ void Lara_State_TurnR(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_TurnL(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_TurnL(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_STOP;
|
item->goal_anim_state = LS_STOP;
|
||||||
|
@ -316,13 +316,13 @@ void Lara_State_TurnL(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Death(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Death(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_FastFall(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_FastFall(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->speed = (item->speed * 95) / 100;
|
item->speed = (item->speed * 95) / 100;
|
||||||
if (item->fall_speed >= DAMAGE_START + DAMAGE_LENGTH) {
|
if (item->fall_speed >= DAMAGE_START + DAMAGE_LENGTH) {
|
||||||
|
@ -330,7 +330,7 @@ void Lara_State_FastFall(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Hang(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Hang(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (g_Config.enable_enhanced_look && g_Input.look) {
|
if (g_Config.enable_enhanced_look && g_Input.look) {
|
||||||
Lara_LookUpDown();
|
Lara_LookUpDown();
|
||||||
|
@ -347,7 +347,7 @@ void Lara_State_Hang(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Reach(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Reach(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Camera.target_angle = 85 * PHD_DEGREE;
|
g_Camera.target_angle = 85 * PHD_DEGREE;
|
||||||
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
||||||
|
@ -355,15 +355,15 @@ void Lara_State_Reach(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Splat(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Splat(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Land(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Land(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Compress(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Compress(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (g_Input.forward
|
if (g_Input.forward
|
||||||
&& M_FloorFront(item, item->rot.y, 256) >= -STEPUP_HEIGHT) {
|
&& M_FloorFront(item, item->rot.y, 256) >= -STEPUP_HEIGHT) {
|
||||||
|
@ -391,7 +391,7 @@ void Lara_State_Compress(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Back(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Back(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_STOP;
|
item->goal_anim_state = LS_STOP;
|
||||||
|
@ -413,7 +413,7 @@ void Lara_State_Back(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_FastTurn(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_FastTurn(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_STOP;
|
item->goal_anim_state = LS_STOP;
|
||||||
|
@ -438,7 +438,7 @@ void Lara_State_FastTurn(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_StepRight(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_StepRight(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_STOP;
|
item->goal_anim_state = LS_STOP;
|
||||||
|
@ -462,7 +462,7 @@ void Lara_State_StepRight(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_StepLeft(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_StepLeft(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_STOP;
|
item->goal_anim_state = LS_STOP;
|
||||||
|
@ -486,7 +486,7 @@ void Lara_State_StepLeft(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Slide(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Slide(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Camera.flags = NO_CHUNKY;
|
g_Camera.flags = NO_CHUNKY;
|
||||||
g_Camera.target_elevation = -45 * PHD_DEGREE;
|
g_Camera.target_elevation = -45 * PHD_DEGREE;
|
||||||
|
@ -495,7 +495,7 @@ void Lara_State_Slide(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_BackJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_BackJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Camera.target_angle = PHD_DEGREE * 135;
|
g_Camera.target_angle = PHD_DEGREE * 135;
|
||||||
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
||||||
|
@ -509,21 +509,21 @@ void Lara_State_BackJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_RightJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_RightJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
||||||
item->goal_anim_state = LS_FAST_FALL;
|
item->goal_anim_state = LS_FAST_FALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_LeftJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_LeftJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
||||||
item->goal_anim_state = LS_FAST_FALL;
|
item->goal_anim_state = LS_FAST_FALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_UpJump(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_UpJump(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->fall_speed
|
if (item->fall_speed
|
||||||
> (g_Config.enable_swing_cancel ? LARA_SWING_FASTFALL_SPEED
|
> (g_Config.enable_swing_cancel ? LARA_SWING_FASTFALL_SPEED
|
||||||
|
@ -532,7 +532,7 @@ void Lara_State_UpJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_FallBack(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_FallBack(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
||||||
item->goal_anim_state = LS_FAST_FALL;
|
item->goal_anim_state = LS_FAST_FALL;
|
||||||
|
@ -542,7 +542,7 @@ void Lara_State_FallBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_HangLeft(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_HangLeft(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -553,7 +553,7 @@ void Lara_State_HangLeft(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_HangRight(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_HangRight(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -564,14 +564,14 @@ void Lara_State_HangRight(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_SlideBack(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_SlideBack(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (g_Input.jump && (!g_Config.enable_jump_twists || !g_Input.forward)) {
|
if (g_Input.jump && (!g_Config.enable_jump_twists || !g_Input.forward)) {
|
||||||
item->goal_anim_state = LS_JUMP_BACK;
|
item->goal_anim_state = LS_JUMP_BACK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_PushBlock(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_PushBlock(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -580,7 +580,7 @@ void Lara_State_PushBlock(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
g_Camera.target_elevation = -25 * PHD_DEGREE;
|
g_Camera.target_elevation = -25 * PHD_DEGREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_PullBlock(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_PullBlock(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -589,7 +589,7 @@ void Lara_State_PullBlock(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
g_Camera.target_elevation = -25 * PHD_DEGREE;
|
g_Camera.target_elevation = -25 * PHD_DEGREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_PPReady(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_PPReady(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -599,7 +599,7 @@ void Lara_State_PPReady(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Pickup(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Pickup(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -608,13 +608,13 @@ void Lara_State_Pickup(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
g_Camera.target_distance = WALL_L;
|
g_Camera.target_distance = WALL_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Controlled(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Controlled(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_SwitchOn(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_SwitchOn(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -623,7 +623,7 @@ void Lara_State_SwitchOn(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
g_Camera.target_distance = WALL_L;
|
g_Camera.target_distance = WALL_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_SwitchOff(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_SwitchOff(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -632,7 +632,7 @@ void Lara_State_SwitchOff(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
g_Camera.target_distance = WALL_L;
|
g_Camera.target_distance = WALL_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_UseKey(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_UseKey(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -641,7 +641,7 @@ void Lara_State_UseKey(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
g_Camera.target_distance = WALL_L;
|
g_Camera.target_distance = WALL_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_UsePuzzle(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_UsePuzzle(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -650,29 +650,29 @@ void Lara_State_UsePuzzle(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
g_Camera.target_distance = WALL_L;
|
g_Camera.target_distance = WALL_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Roll(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Roll(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Roll2(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Roll2(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Special(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Special(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
g_Camera.flags = FOLLOW_CENTRE;
|
g_Camera.flags = FOLLOW_CENTRE;
|
||||||
g_Camera.target_angle = 170 * PHD_DEGREE;
|
g_Camera.target_angle = 170 * PHD_DEGREE;
|
||||||
g_Camera.target_elevation = -25 * PHD_DEGREE;
|
g_Camera.target_elevation = -25 * PHD_DEGREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_UseMidas(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_UseMidas(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
Twinkle_SparkleItem(item, (1 << LM_HAND_L) | (1 << LM_HAND_R));
|
Twinkle_SparkleItem(item, (1 << LM_HAND_L) | (1 << LM_HAND_R));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_DieMidas(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_DieMidas(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->gravity = 0;
|
item->gravity = 0;
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
|
@ -756,7 +756,7 @@ void Lara_State_DieMidas(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
Twinkle_SparkleItem(item, g_Lara.mesh_effects);
|
Twinkle_SparkleItem(item, g_Lara.mesh_effects);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_SwanDive(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_SwanDive(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 1;
|
coll->enable_baddie_push = 1;
|
||||||
|
@ -766,7 +766,7 @@ void Lara_State_SwanDive(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_FastDive(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_FastDive(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (g_Config.enable_jump_twists && g_Input.roll
|
if (g_Config.enable_jump_twists && g_Input.roll
|
||||||
&& item->goal_anim_state == LS_FAST_DIVE) {
|
&& item->goal_anim_state == LS_FAST_DIVE) {
|
||||||
|
@ -778,36 +778,36 @@ void Lara_State_FastDive(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
item->speed = (item->speed * 95) / 100;
|
item->speed = (item->speed * 95) / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Twist(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Twist(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_UWRoll(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_UWRoll(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->fall_speed = 0;
|
item->fall_speed = 0;
|
||||||
item->goal_anim_state = LS_TREAD;
|
item->goal_anim_state = LS_TREAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Null(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Null(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Gymnast(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Gymnast(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_WaterOut(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_WaterOut(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
g_Camera.flags = FOLLOW_CENTRE;
|
g_Camera.flags = FOLLOW_CENTRE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_SurfSwim(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_SurfSwim(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_UW_DEATH;
|
item->goal_anim_state = LS_UW_DEATH;
|
||||||
|
@ -838,7 +838,7 @@ void Lara_State_SurfSwim(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_SurfBack(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_SurfBack(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_UW_DEATH;
|
item->goal_anim_state = LS_UW_DEATH;
|
||||||
|
@ -866,7 +866,7 @@ void Lara_State_SurfBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_SurfLeft(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_SurfLeft(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_UW_DEATH;
|
item->goal_anim_state = LS_UW_DEATH;
|
||||||
|
@ -900,7 +900,7 @@ void Lara_State_SurfLeft(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_SurfRight(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_SurfRight(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_UW_DEATH;
|
item->goal_anim_state = LS_UW_DEATH;
|
||||||
|
@ -934,7 +934,7 @@ void Lara_State_SurfRight(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_SurfTread(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_SurfTread(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->fall_speed -= 4;
|
item->fall_speed -= 4;
|
||||||
if (item->fall_speed < 0) {
|
if (item->fall_speed < 0) {
|
||||||
|
@ -993,7 +993,7 @@ void Lara_State_SurfTread(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Swim(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Swim(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_UW_DEATH;
|
item->goal_anim_state = LS_UW_DEATH;
|
||||||
|
@ -1047,7 +1047,7 @@ void Lara_State_Swim(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Glide(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Glide(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = LS_UW_DEATH;
|
item->goal_anim_state = LS_UW_DEATH;
|
||||||
|
@ -1100,7 +1100,7 @@ void Lara_State_Glide(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Tread(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Tread(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (g_Config.enable_enhanced_look) {
|
if (g_Config.enable_enhanced_look) {
|
||||||
if (g_Input.look) {
|
if (g_Input.look) {
|
||||||
|
@ -1155,14 +1155,14 @@ void Lara_State_Tread(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_Dive(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_Dive(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (g_Input.forward) {
|
if (g_Input.forward) {
|
||||||
item->rot.x -= PHD_DEGREE;
|
item->rot.x -= PHD_DEGREE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Lara_State_UWDeath(ITEM_INFO *item, COLL_INFO *coll)
|
void Lara_State_UWDeath(ITEM *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
item->fall_speed -= 8;
|
item->fall_speed -= 8;
|
||||||
|
|
|
@ -4,64 +4,64 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
extern void (*g_LaraStateRoutines[])(ITEM_INFO *item, COLL_INFO *coll);
|
extern void (*g_LaraStateRoutines[])(ITEM *item, COLL_INFO *coll);
|
||||||
|
|
||||||
void Lara_State_Walk(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Walk(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Run(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Run(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Stop(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Stop(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_ForwardJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_ForwardJump(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Pose(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Pose(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_FastBack(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_FastBack(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_TurnR(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_TurnR(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_TurnL(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_TurnL(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Death(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Death(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_FastFall(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_FastFall(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Hang(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Hang(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Reach(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Reach(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Splat(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Splat(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Tread(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Tread(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Land(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Land(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Compress(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Compress(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Back(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Back(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Swim(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Swim(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Glide(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Glide(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Null(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Null(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_FastTurn(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_FastTurn(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_StepRight(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_StepRight(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_StepLeft(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_StepLeft(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Roll2(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Roll2(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Slide(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Slide(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_BackJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_BackJump(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_RightJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_RightJump(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_LeftJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_LeftJump(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_UpJump(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_UpJump(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_FallBack(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_FallBack(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_HangLeft(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_HangLeft(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_HangRight(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_HangRight(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_SlideBack(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_SlideBack(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_SurfTread(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_SurfTread(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_SurfSwim(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_SurfSwim(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Dive(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Dive(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_PushBlock(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_PushBlock(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_PullBlock(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_PullBlock(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_PPReady(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_PPReady(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Pickup(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Pickup(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Controlled(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Controlled(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_SwitchOn(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_SwitchOn(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_SwitchOff(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_SwitchOff(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_UseKey(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_UseKey(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_UsePuzzle(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_UsePuzzle(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_UWDeath(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_UWDeath(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Roll(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Roll(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Special(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Special(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_SurfBack(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_SurfBack(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_SurfLeft(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_SurfLeft(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_SurfRight(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_SurfRight(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_UseMidas(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_UseMidas(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_DieMidas(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_DieMidas(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_SwanDive(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_SwanDive(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_FastDive(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_FastDive(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Gymnast(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Gymnast(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_WaterOut(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_WaterOut(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_Twist(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_Twist(ITEM *item, COLL_INFO *coll);
|
||||||
void Lara_State_UWRoll(ITEM_INFO *item, COLL_INFO *coll);
|
void Lara_State_UWRoll(ITEM *item, COLL_INFO *coll);
|
||||||
|
|
|
@ -147,10 +147,9 @@ static void M_LoadRooms(VFILE *file)
|
||||||
g_RoomCount = VFile_ReadU16(file);
|
g_RoomCount = VFile_ReadU16(file);
|
||||||
LOG_INFO("%d rooms", g_RoomCount);
|
LOG_INFO("%d rooms", g_RoomCount);
|
||||||
|
|
||||||
g_RoomInfo =
|
g_RoomInfo = GameBuf_Alloc(sizeof(ROOM) * g_RoomCount, GBUF_ROOMS);
|
||||||
GameBuf_Alloc(sizeof(ROOM_INFO) * g_RoomCount, GBUF_ROOM_INFOS);
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (ROOM_INFO *current_room_info = g_RoomInfo; i < g_RoomCount;
|
for (ROOM *current_room_info = g_RoomInfo; i < g_RoomCount;
|
||||||
i++, current_room_info++) {
|
i++, current_room_info++) {
|
||||||
// Room position
|
// Room position
|
||||||
current_room_info->x = VFile_ReadS32(file);
|
current_room_info->x = VFile_ReadS32(file);
|
||||||
|
@ -172,22 +171,21 @@ static void M_LoadRooms(VFILE *file)
|
||||||
// Doors
|
// Doors
|
||||||
const uint16_t num_doors = VFile_ReadS16(file);
|
const uint16_t num_doors = VFile_ReadS16(file);
|
||||||
if (!num_doors) {
|
if (!num_doors) {
|
||||||
current_room_info->doors = NULL;
|
current_room_info->portals = NULL;
|
||||||
} else {
|
} else {
|
||||||
current_room_info->doors = GameBuf_Alloc(
|
current_room_info->portals = GameBuf_Alloc(
|
||||||
sizeof(uint16_t) + sizeof(DOOR_INFO) * num_doors,
|
sizeof(uint16_t) + sizeof(PORTAL) * num_doors, GBUF_ROOM_DOOR);
|
||||||
GBUF_ROOM_DOOR);
|
current_room_info->portals->count = num_doors;
|
||||||
current_room_info->doors->count = num_doors;
|
|
||||||
for (int32_t j = 0; j < num_doors; j++) {
|
for (int32_t j = 0; j < num_doors; j++) {
|
||||||
DOOR_INFO *door = ¤t_room_info->doors->door[j];
|
PORTAL *const portal = ¤t_room_info->portals->portal[j];
|
||||||
door->room_num = VFile_ReadS16(file);
|
portal->room_num = VFile_ReadS16(file);
|
||||||
door->normal.x = VFile_ReadS16(file);
|
portal->normal.x = VFile_ReadS16(file);
|
||||||
door->normal.y = VFile_ReadS16(file);
|
portal->normal.y = VFile_ReadS16(file);
|
||||||
door->normal.z = VFile_ReadS16(file);
|
portal->normal.z = VFile_ReadS16(file);
|
||||||
for (int32_t k = 0; k < 4; k++) {
|
for (int32_t k = 0; k < 4; k++) {
|
||||||
door->vertex[k].x = VFile_ReadS16(file);
|
portal->vertex[k].x = VFile_ReadS16(file);
|
||||||
door->vertex[k].y = VFile_ReadS16(file);
|
portal->vertex[k].y = VFile_ReadS16(file);
|
||||||
door->vertex[k].z = VFile_ReadS16(file);
|
portal->vertex[k].z = VFile_ReadS16(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -198,9 +196,9 @@ static void M_LoadRooms(VFILE *file)
|
||||||
const int32_t sector_count =
|
const int32_t sector_count =
|
||||||
current_room_info->x_size * current_room_info->z_size;
|
current_room_info->x_size * current_room_info->z_size;
|
||||||
current_room_info->sectors =
|
current_room_info->sectors =
|
||||||
GameBuf_Alloc(sizeof(SECTOR_INFO) * sector_count, GBUF_ROOM_SECTOR);
|
GameBuf_Alloc(sizeof(SECTOR) * sector_count, GBUF_ROOM_SECTOR);
|
||||||
for (int32_t j = 0; j < sector_count; j++) {
|
for (int32_t j = 0; j < sector_count; j++) {
|
||||||
SECTOR_INFO *const sector = ¤t_room_info->sectors[j];
|
SECTOR *const sector = ¤t_room_info->sectors[j];
|
||||||
sector->index = VFile_ReadU16(file);
|
sector->index = VFile_ReadU16(file);
|
||||||
sector->box = VFile_ReadS16(file);
|
sector->box = VFile_ReadS16(file);
|
||||||
sector->portal_room.pit = VFile_ReadU8(file);
|
sector->portal_room.pit = VFile_ReadU8(file);
|
||||||
|
@ -219,10 +217,10 @@ static void M_LoadRooms(VFILE *file)
|
||||||
current_room_info->light = NULL;
|
current_room_info->light = NULL;
|
||||||
} else {
|
} else {
|
||||||
current_room_info->light = GameBuf_Alloc(
|
current_room_info->light = GameBuf_Alloc(
|
||||||
sizeof(LIGHT_INFO) * current_room_info->num_lights,
|
sizeof(LIGHT) * current_room_info->num_lights,
|
||||||
GBUF_ROOM_LIGHTS);
|
GBUF_ROOM_LIGHTS);
|
||||||
for (int32_t j = 0; j < current_room_info->num_lights; j++) {
|
for (int32_t j = 0; j < current_room_info->num_lights; j++) {
|
||||||
LIGHT_INFO *light = ¤t_room_info->light[j];
|
LIGHT *light = ¤t_room_info->light[j];
|
||||||
light->pos.x = VFile_ReadS32(file);
|
light->pos.x = VFile_ReadS32(file);
|
||||||
light->pos.y = VFile_ReadS32(file);
|
light->pos.y = VFile_ReadS32(file);
|
||||||
light->pos.z = VFile_ReadS32(file);
|
light->pos.z = VFile_ReadS32(file);
|
||||||
|
@ -237,10 +235,10 @@ static void M_LoadRooms(VFILE *file)
|
||||||
current_room_info->mesh = NULL;
|
current_room_info->mesh = NULL;
|
||||||
} else {
|
} else {
|
||||||
current_room_info->mesh = GameBuf_Alloc(
|
current_room_info->mesh = GameBuf_Alloc(
|
||||||
sizeof(MESH_INFO) * current_room_info->num_meshes,
|
sizeof(MESH) * current_room_info->num_meshes,
|
||||||
GBUF_ROOM_STATIC_MESH_INFOS);
|
GBUF_ROOM_STATIC_MESHES);
|
||||||
for (int32_t j = 0; j < current_room_info->num_meshes; j++) {
|
for (int32_t j = 0; j < current_room_info->num_meshes; j++) {
|
||||||
MESH_INFO *mesh = ¤t_room_info->mesh[j];
|
MESH *mesh = ¤t_room_info->mesh[j];
|
||||||
mesh->pos.x = VFile_ReadS32(file);
|
mesh->pos.x = VFile_ReadS32(file);
|
||||||
mesh->pos.y = VFile_ReadS32(file);
|
mesh->pos.y = VFile_ReadS32(file);
|
||||||
mesh->pos.z = VFile_ReadS32(file);
|
mesh->pos.z = VFile_ReadS32(file);
|
||||||
|
@ -485,7 +483,7 @@ static void M_LoadObjects(VFILE *file)
|
||||||
LOG_INFO("%d objects", m_LevelInfo.object_count);
|
LOG_INFO("%d objects", m_LevelInfo.object_count);
|
||||||
for (int i = 0; i < m_LevelInfo.object_count; i++) {
|
for (int i = 0; i < m_LevelInfo.object_count; i++) {
|
||||||
const GAME_OBJECT_ID object_id = VFile_ReadS32(file);
|
const GAME_OBJECT_ID object_id = VFile_ReadS32(file);
|
||||||
OBJECT_INFO *object = &g_Objects[object_id];
|
OBJECT *object = &g_Objects[object_id];
|
||||||
|
|
||||||
object->nmeshes = VFile_ReadS16(file);
|
object->nmeshes = VFile_ReadS16(file);
|
||||||
object->mesh_idx = VFile_ReadS16(file);
|
object->mesh_idx = VFile_ReadS16(file);
|
||||||
|
@ -585,7 +583,7 @@ static void M_LoadSprites(VFILE *file)
|
||||||
const int16_t mesh_idx = VFile_ReadS16(file);
|
const int16_t mesh_idx = VFile_ReadS16(file);
|
||||||
|
|
||||||
if (object_id < O_NUMBER_OF) {
|
if (object_id < O_NUMBER_OF) {
|
||||||
OBJECT_INFO *object = &g_Objects[object_id];
|
OBJECT *object = &g_Objects[object_id];
|
||||||
object->nmeshes = num_meshes;
|
object->nmeshes = num_meshes;
|
||||||
object->mesh_idx = mesh_idx;
|
object->mesh_idx = mesh_idx;
|
||||||
object->loaded = 1;
|
object->loaded = 1;
|
||||||
|
@ -741,12 +739,12 @@ static void M_LoadItems(VFILE *file)
|
||||||
Shell_ExitSystem("M_LoadItems(): Too Many g_Items being Loaded!!");
|
Shell_ExitSystem("M_LoadItems(): Too Many g_Items being Loaded!!");
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Items = GameBuf_Alloc(sizeof(ITEM_INFO) * MAX_ITEMS, GBUF_ITEMS);
|
g_Items = GameBuf_Alloc(sizeof(ITEM) * MAX_ITEMS, GBUF_ITEMS);
|
||||||
g_LevelItemCount = m_LevelInfo.item_count;
|
g_LevelItemCount = m_LevelInfo.item_count;
|
||||||
Item_InitialiseArray(MAX_ITEMS);
|
Item_InitialiseArray(MAX_ITEMS);
|
||||||
|
|
||||||
for (int i = 0; i < m_LevelInfo.item_count; i++) {
|
for (int i = 0; i < m_LevelInfo.item_count; i++) {
|
||||||
ITEM_INFO *item = &g_Items[i];
|
ITEM *item = &g_Items[i];
|
||||||
item->object_id = VFile_ReadS16(file);
|
item->object_id = VFile_ReadS16(file);
|
||||||
item->room_num = VFile_ReadS16(file);
|
item->room_num = VFile_ReadS16(file);
|
||||||
item->pos.x = VFile_ReadS32(file);
|
item->pos.x = VFile_ReadS32(file);
|
||||||
|
@ -996,7 +994,7 @@ static void M_MarkWaterEdgeVertices(void)
|
||||||
|
|
||||||
BENCHMARK *const benchmark = Benchmark_Start();
|
BENCHMARK *const benchmark = Benchmark_Start();
|
||||||
for (int32_t i = 0; i < g_RoomCount; i++) {
|
for (int32_t i = 0; i < g_RoomCount; i++) {
|
||||||
const ROOM_INFO *const room = &g_RoomInfo[i];
|
const ROOM *const room = &g_RoomInfo[i];
|
||||||
const int32_t y_test =
|
const int32_t y_test =
|
||||||
(room->flags & RF_UNDERWATER) ? room->max_ceiling : room->min_floor;
|
(room->flags & RF_UNDERWATER) ? room->max_ceiling : room->min_floor;
|
||||||
int16_t *data = room->data;
|
int16_t *data = room->data;
|
||||||
|
@ -1017,7 +1015,7 @@ static size_t M_CalculateMaxVertices(void)
|
||||||
BENCHMARK *const benchmark = Benchmark_Start();
|
BENCHMARK *const benchmark = Benchmark_Start();
|
||||||
size_t max_vertices = 0;
|
size_t max_vertices = 0;
|
||||||
for (int32_t i = 0; i < O_NUMBER_OF; i++) {
|
for (int32_t i = 0; i < O_NUMBER_OF; i++) {
|
||||||
const OBJECT_INFO *object_info = &g_Objects[i];
|
const OBJECT *object_info = &g_Objects[i];
|
||||||
if (!object_info->loaded) {
|
if (!object_info->loaded) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1148,7 +1146,7 @@ bool Level_Initialise(int32_t level_num)
|
||||||
Lara_Initialise(level_num);
|
Lara_Initialise(level_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_Effects = GameBuf_Alloc(NUM_EFFECTS * sizeof(FX_INFO), GBUF_EFFECTS);
|
g_Effects = GameBuf_Alloc(NUM_EFFECTS * sizeof(FX), GBUF_EFFECTS);
|
||||||
Effect_InitialiseArray();
|
Effect_InitialiseArray();
|
||||||
LOT_InitialiseArray();
|
LOT_InitialiseArray();
|
||||||
|
|
||||||
|
|
|
@ -10,12 +10,12 @@
|
||||||
static int32_t M_CheckX(const GAME_VECTOR *start, GAME_VECTOR *target);
|
static int32_t M_CheckX(const GAME_VECTOR *start, GAME_VECTOR *target);
|
||||||
static int32_t M_CheckZ(const GAME_VECTOR *start, GAME_VECTOR *target);
|
static int32_t M_CheckZ(const GAME_VECTOR *start, GAME_VECTOR *target);
|
||||||
static bool M_ClipTarget(
|
static bool M_ClipTarget(
|
||||||
const GAME_VECTOR *start, GAME_VECTOR *target, const SECTOR_INFO *sector);
|
const GAME_VECTOR *start, GAME_VECTOR *target, const SECTOR *sector);
|
||||||
|
|
||||||
static int32_t M_CheckX(
|
static int32_t M_CheckX(
|
||||||
const GAME_VECTOR *const start, GAME_VECTOR *const target)
|
const GAME_VECTOR *const start, GAME_VECTOR *const target)
|
||||||
{
|
{
|
||||||
const SECTOR_INFO *sector;
|
const SECTOR *sector;
|
||||||
|
|
||||||
int32_t dx = target->x - start->x;
|
int32_t dx = target->x - start->x;
|
||||||
if (dx == 0) {
|
if (dx == 0) {
|
||||||
|
@ -101,7 +101,7 @@ static int32_t M_CheckX(
|
||||||
static int32_t M_CheckZ(
|
static int32_t M_CheckZ(
|
||||||
const GAME_VECTOR *const start, GAME_VECTOR *const target)
|
const GAME_VECTOR *const start, GAME_VECTOR *const target)
|
||||||
{
|
{
|
||||||
const SECTOR_INFO *sector;
|
const SECTOR *sector;
|
||||||
|
|
||||||
int32_t dz = target->z - start->z;
|
int32_t dz = target->z - start->z;
|
||||||
if (dz == 0) {
|
if (dz == 0) {
|
||||||
|
@ -186,7 +186,7 @@ static int32_t M_CheckZ(
|
||||||
|
|
||||||
static bool M_ClipTarget(
|
static bool M_ClipTarget(
|
||||||
const GAME_VECTOR *const start, GAME_VECTOR *const target,
|
const GAME_VECTOR *const start, GAME_VECTOR *const target,
|
||||||
const SECTOR_INFO *const sector)
|
const SECTOR *const sector)
|
||||||
{
|
{
|
||||||
int32_t dx = target->x - start->x;
|
int32_t dx = target->x - start->x;
|
||||||
int32_t dy = target->y - start->y;
|
int32_t dy = target->y - start->y;
|
||||||
|
@ -230,7 +230,7 @@ bool LOS_Check(const GAME_VECTOR *const start, GAME_VECTOR *const target)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SECTOR_INFO *const sector =
|
const SECTOR *const sector =
|
||||||
Room_GetSector(target->x, target->y, target->z, &target->room_num);
|
Room_GetSector(target->x, target->y, target->z, &target->room_num);
|
||||||
|
|
||||||
return M_ClipTarget(start, target, sector) && los1 == 1 && los2 == 1;
|
return M_ClipTarget(start, target, sector) && los1 == 1 && los2 == 1;
|
||||||
|
|
|
@ -11,14 +11,14 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
static int32_t m_SlotsUsed = 0;
|
static int32_t m_SlotsUsed = 0;
|
||||||
static CREATURE_INFO *m_BaddieSlots = NULL;
|
static CREATURE *m_BaddieSlots = NULL;
|
||||||
|
|
||||||
void LOT_InitialiseArray(void)
|
void LOT_InitialiseArray(void)
|
||||||
{
|
{
|
||||||
m_BaddieSlots =
|
m_BaddieSlots =
|
||||||
GameBuf_Alloc(NUM_SLOTS * sizeof(CREATURE_INFO), GBUF_CREATURE_INFO);
|
GameBuf_Alloc(NUM_SLOTS * sizeof(CREATURE), GBUF_CREATURE_INFO);
|
||||||
for (int i = 0; i < NUM_SLOTS; i++) {
|
for (int i = 0; i < NUM_SLOTS; i++) {
|
||||||
CREATURE_INFO *creature = &m_BaddieSlots[i];
|
CREATURE *creature = &m_BaddieSlots[i];
|
||||||
creature->item_num = NO_ITEM;
|
creature->item_num = NO_ITEM;
|
||||||
creature->lot.node =
|
creature->lot.node =
|
||||||
GameBuf_Alloc(sizeof(BOX_NODE) * g_NumberBoxes, GBUF_CREATURE_LOT);
|
GameBuf_Alloc(sizeof(BOX_NODE) * g_NumberBoxes, GBUF_CREATURE_LOT);
|
||||||
|
@ -28,8 +28,8 @@ void LOT_InitialiseArray(void)
|
||||||
|
|
||||||
void LOT_DisableBaddieAI(int16_t item_num)
|
void LOT_DisableBaddieAI(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
CREATURE_INFO *creature = item->data;
|
CREATURE *creature = item->data;
|
||||||
item->data = NULL;
|
item->data = NULL;
|
||||||
if (creature) {
|
if (creature) {
|
||||||
creature->item_num = NO_ITEM;
|
creature->item_num = NO_ITEM;
|
||||||
|
@ -45,7 +45,7 @@ bool LOT_EnableBaddieAI(int16_t item_num, int32_t always)
|
||||||
|
|
||||||
if (m_SlotsUsed < NUM_SLOTS) {
|
if (m_SlotsUsed < NUM_SLOTS) {
|
||||||
for (int32_t slot = 0; slot < NUM_SLOTS; slot++) {
|
for (int32_t slot = 0; slot < NUM_SLOTS; slot++) {
|
||||||
CREATURE_INFO *creature = &m_BaddieSlots[slot];
|
CREATURE *creature = &m_BaddieSlots[slot];
|
||||||
if (creature->item_num == NO_ITEM) {
|
if (creature->item_num == NO_ITEM) {
|
||||||
LOT_InitialiseSlot(item_num, slot);
|
LOT_InitialiseSlot(item_num, slot);
|
||||||
return true;
|
return true;
|
||||||
|
@ -56,7 +56,7 @@ bool LOT_EnableBaddieAI(int16_t item_num, int32_t always)
|
||||||
|
|
||||||
int32_t worst_dist = 0;
|
int32_t worst_dist = 0;
|
||||||
if (!always) {
|
if (!always) {
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
int32_t x = (item->pos.x - g_Camera.pos.x) >> 8;
|
int32_t x = (item->pos.x - g_Camera.pos.x) >> 8;
|
||||||
int32_t y = (item->pos.y - g_Camera.pos.y) >> 8;
|
int32_t y = (item->pos.y - g_Camera.pos.y) >> 8;
|
||||||
int32_t z = (item->pos.z - g_Camera.pos.z) >> 8;
|
int32_t z = (item->pos.z - g_Camera.pos.z) >> 8;
|
||||||
|
@ -65,8 +65,8 @@ bool LOT_EnableBaddieAI(int16_t item_num, int32_t always)
|
||||||
|
|
||||||
int32_t worst_slot = -1;
|
int32_t worst_slot = -1;
|
||||||
for (int32_t slot = 0; slot < NUM_SLOTS; slot++) {
|
for (int32_t slot = 0; slot < NUM_SLOTS; slot++) {
|
||||||
CREATURE_INFO *creature = &m_BaddieSlots[slot];
|
CREATURE *creature = &m_BaddieSlots[slot];
|
||||||
ITEM_INFO *item = &g_Items[creature->item_num];
|
ITEM *item = &g_Items[creature->item_num];
|
||||||
int32_t x = (item->pos.x - g_Camera.pos.x) >> 8;
|
int32_t x = (item->pos.x - g_Camera.pos.x) >> 8;
|
||||||
int32_t y = (item->pos.y - g_Camera.pos.y) >> 8;
|
int32_t y = (item->pos.y - g_Camera.pos.y) >> 8;
|
||||||
int32_t z = (item->pos.z - g_Camera.pos.z) >> 8;
|
int32_t z = (item->pos.z - g_Camera.pos.z) >> 8;
|
||||||
|
@ -89,8 +89,8 @@ bool LOT_EnableBaddieAI(int16_t item_num, int32_t always)
|
||||||
|
|
||||||
void LOT_InitialiseSlot(int16_t item_num, int32_t slot)
|
void LOT_InitialiseSlot(int16_t item_num, int32_t slot)
|
||||||
{
|
{
|
||||||
CREATURE_INFO *creature = &m_BaddieSlots[slot];
|
CREATURE *creature = &m_BaddieSlots[slot];
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
item->data = creature;
|
item->data = creature;
|
||||||
creature->item_num = item_num;
|
creature->item_num = item_num;
|
||||||
creature->mood = MOOD_BORED;
|
creature->mood = MOOD_BORED;
|
||||||
|
@ -141,9 +141,9 @@ void LOT_InitialiseSlot(int16_t item_num, int32_t slot)
|
||||||
m_SlotsUsed++;
|
m_SlotsUsed++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LOT_CreateZone(ITEM_INFO *item)
|
void LOT_CreateZone(ITEM *item)
|
||||||
{
|
{
|
||||||
CREATURE_INFO *creature = item->data;
|
CREATURE *creature = item->data;
|
||||||
|
|
||||||
int16_t *zone;
|
int16_t *zone;
|
||||||
int16_t *flip;
|
int16_t *flip;
|
||||||
|
@ -158,7 +158,7 @@ void LOT_CreateZone(ITEM_INFO *item)
|
||||||
flip = g_GroundZone2[1];
|
flip = g_GroundZone2[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
const ROOM_INFO *const r = &g_RoomInfo[item->room_num];
|
const ROOM *const r = &g_RoomInfo[item->room_num];
|
||||||
const int32_t z_sector = (item->pos.z - r->z) >> WALL_SHIFT;
|
const int32_t z_sector = (item->pos.z - r->z) >> WALL_SHIFT;
|
||||||
const int32_t x_sector = (item->pos.x - r->x) >> WALL_SHIFT;
|
const int32_t x_sector = (item->pos.x - r->x) >> WALL_SHIFT;
|
||||||
item->box_num = r->sectors[z_sector + x_sector * r->z_size].box;
|
item->box_num = r->sectors[z_sector + x_sector * r->z_size].box;
|
||||||
|
|
|
@ -9,6 +9,6 @@ void LOT_InitialiseArray(void);
|
||||||
void LOT_DisableBaddieAI(int16_t item_num);
|
void LOT_DisableBaddieAI(int16_t item_num);
|
||||||
bool LOT_EnableBaddieAI(int16_t item_num, int32_t always);
|
bool LOT_EnableBaddieAI(int16_t item_num, int32_t always);
|
||||||
void LOT_InitialiseSlot(int16_t item_num, int32_t slot);
|
void LOT_InitialiseSlot(int16_t item_num, int32_t slot);
|
||||||
void LOT_CreateZone(ITEM_INFO *item);
|
void LOT_CreateZone(ITEM *item);
|
||||||
void LOT_InitialiseLOT(LOT_INFO *LOT);
|
void LOT_InitialiseLOT(LOT_INFO *LOT);
|
||||||
void LOT_ClearLOT(LOT_INFO *LOT);
|
void LOT_ClearLOT(LOT_INFO *LOT);
|
||||||
|
|
|
@ -32,7 +32,7 @@ static const GAME_OBJECT_PAIR m_KeyItemToReceptacleMap[] = {
|
||||||
// clang-format on
|
// clang-format on
|
||||||
};
|
};
|
||||||
|
|
||||||
OBJECT_INFO *Object_GetObject(GAME_OBJECT_ID object_id)
|
OBJECT *Object_GetObject(GAME_OBJECT_ID object_id)
|
||||||
{
|
{
|
||||||
return &g_Objects[object_id];
|
return &g_Objects[object_id];
|
||||||
}
|
}
|
||||||
|
@ -70,9 +70,9 @@ int16_t Object_FindReceptacle(GAME_OBJECT_ID object_id)
|
||||||
GAME_OBJECT_ID receptacle_to_check =
|
GAME_OBJECT_ID receptacle_to_check =
|
||||||
Object_GetCognate(object_id, m_KeyItemToReceptacleMap);
|
Object_GetCognate(object_id, m_KeyItemToReceptacleMap);
|
||||||
for (int item_num = 0; item_num < g_LevelItemCount; item_num++) {
|
for (int item_num = 0; item_num < g_LevelItemCount; item_num++) {
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
if (item->object_id == receptacle_to_check) {
|
if (item->object_id == receptacle_to_check) {
|
||||||
const OBJECT_INFO *const obj = &g_Objects[item->object_id];
|
const OBJECT *const obj = &g_Objects[item->object_id];
|
||||||
if (Lara_TestPosition(item, obj->bounds())) {
|
if (Lara_TestPosition(item, obj->bounds())) {
|
||||||
return item_num;
|
return item_num;
|
||||||
}
|
}
|
||||||
|
@ -93,9 +93,9 @@ bool Object_IsObjectType(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object_Collision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
void Object_Collision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (!Lara_TestBoundsCollide(item, coll->radius)) {
|
if (!Lara_TestBoundsCollide(item, coll->radius)) {
|
||||||
return;
|
return;
|
||||||
|
@ -109,10 +109,9 @@ void Object_Collision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object_CollisionTrap(
|
void Object_CollisionTrap(int16_t item_num, ITEM *lara_item, COLL_INFO *coll)
|
||||||
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_ACTIVE) {
|
if (item->status == IS_ACTIVE) {
|
||||||
if (Lara_TestBoundsCollide(item, coll->radius)) {
|
if (Lara_TestBoundsCollide(item, coll->radius)) {
|
||||||
|
@ -123,11 +122,11 @@ void Object_CollisionTrap(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object_DrawDummyItem(ITEM_INFO *item)
|
void Object_DrawDummyItem(ITEM *item)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object_DrawSpriteItem(ITEM_INFO *item)
|
void Object_DrawSpriteItem(ITEM *item)
|
||||||
{
|
{
|
||||||
Output_DrawSprite(
|
Output_DrawSprite(
|
||||||
item->interp.result.pos.x, item->interp.result.pos.y,
|
item->interp.result.pos.x, item->interp.result.pos.y,
|
||||||
|
@ -135,7 +134,7 @@ void Object_DrawSpriteItem(ITEM_INFO *item)
|
||||||
g_Objects[item->object_id].mesh_idx - item->frame_num, item->shade);
|
g_Objects[item->object_id].mesh_idx - item->frame_num, item->shade);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object_DrawPickupItem(ITEM_INFO *item)
|
void Object_DrawPickupItem(ITEM *item)
|
||||||
{
|
{
|
||||||
if (!g_Config.enable_3d_pickups) {
|
if (!g_Config.enable_3d_pickups) {
|
||||||
Object_DrawSpriteItem(item);
|
Object_DrawSpriteItem(item);
|
||||||
|
@ -149,7 +148,7 @@ void Object_DrawPickupItem(ITEM_INFO *item)
|
||||||
// Modify item to be the anim for inv item and animation 0.
|
// Modify item to be the anim for inv item and animation 0.
|
||||||
Item_SwitchToObjAnim(item, 0, 0, item_num_option);
|
Item_SwitchToObjAnim(item, 0, 0, item_num_option);
|
||||||
|
|
||||||
OBJECT_INFO *object = &g_Objects[item_num_option];
|
OBJECT *object = &g_Objects[item_num_option];
|
||||||
|
|
||||||
const FRAME_INFO *frame = g_Anims[item->anim_num].frame_ptr;
|
const FRAME_INFO *frame = g_Anims[item->anim_num].frame_ptr;
|
||||||
|
|
||||||
|
@ -168,7 +167,7 @@ void Object_DrawPickupItem(ITEM_INFO *item)
|
||||||
// This is mostly true, but for example the 4 items in the Obelisk of
|
// This is mostly true, but for example the 4 items in the Obelisk of
|
||||||
// Khamoon the 4 items are sitting on top of a static mesh which is not
|
// Khamoon the 4 items are sitting on top of a static mesh which is not
|
||||||
// floor.
|
// floor.
|
||||||
const SECTOR_INFO *const sector =
|
const SECTOR *const sector =
|
||||||
Room_GetSector(item->pos.x, item->pos.y, item->pos.z, &item->room_num);
|
Room_GetSector(item->pos.x, item->pos.y, item->pos.z, &item->room_num);
|
||||||
const int16_t floor_height =
|
const int16_t floor_height =
|
||||||
Room_GetHeight(sector, item->pos.x, item->pos.y, item->pos.z);
|
Room_GetHeight(sector, item->pos.x, item->pos.y, item->pos.z);
|
||||||
|
@ -292,9 +291,9 @@ void Object_DrawPickupItem(ITEM_INFO *item)
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object_DrawInterpolatedObject(
|
void Object_DrawInterpolatedObject(
|
||||||
const OBJECT_INFO *const object, uint32_t meshes,
|
const OBJECT *const object, uint32_t meshes, const int16_t *extra_rotation,
|
||||||
const int16_t *extra_rotation, const FRAME_INFO *const frame1,
|
const FRAME_INFO *const frame1, const FRAME_INFO *const frame2,
|
||||||
const FRAME_INFO *const frame2, const int32_t frac, const int32_t rate)
|
const int32_t frac, const int32_t rate)
|
||||||
{
|
{
|
||||||
assert(frame1);
|
assert(frame1);
|
||||||
int32_t clip = Output_GetObjectBounds(&frame1->bounds);
|
int32_t clip = Output_GetObjectBounds(&frame1->bounds);
|
||||||
|
@ -400,12 +399,12 @@ void Object_DrawInterpolatedObject(
|
||||||
Matrix_Pop();
|
Matrix_Pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object_DrawAnimatingItem(ITEM_INFO *item)
|
void Object_DrawAnimatingItem(ITEM *item)
|
||||||
{
|
{
|
||||||
FRAME_INFO *frmptr[2];
|
FRAME_INFO *frmptr[2];
|
||||||
int32_t rate;
|
int32_t rate;
|
||||||
int32_t frac = Item_GetFrames(item, frmptr, &rate);
|
int32_t frac = Item_GetFrames(item, frmptr, &rate);
|
||||||
OBJECT_INFO *object = &g_Objects[item->object_id];
|
OBJECT *object = &g_Objects[item->object_id];
|
||||||
|
|
||||||
if (object->shadow_size) {
|
if (object->shadow_size) {
|
||||||
Output_DrawShadow(object->shadow_size, &frmptr[0]->bounds, item);
|
Output_DrawShadow(object->shadow_size, &frmptr[0]->bounds, item);
|
||||||
|
@ -428,7 +427,7 @@ void Object_DrawAnimatingItem(ITEM_INFO *item)
|
||||||
Matrix_Pop();
|
Matrix_Pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object_DrawUnclippedItem(ITEM_INFO *item)
|
void Object_DrawUnclippedItem(ITEM *item)
|
||||||
{
|
{
|
||||||
int32_t left = g_PhdLeft;
|
int32_t left = g_PhdLeft;
|
||||||
int32_t top = g_PhdTop;
|
int32_t top = g_PhdTop;
|
||||||
|
@ -451,7 +450,7 @@ void Object_DrawUnclippedItem(ITEM_INFO *item)
|
||||||
void Object_SetMeshReflective(
|
void Object_SetMeshReflective(
|
||||||
const GAME_OBJECT_ID object_id, const int32_t mesh_idx, const bool enabled)
|
const GAME_OBJECT_ID object_id, const int32_t mesh_idx, const bool enabled)
|
||||||
{
|
{
|
||||||
const OBJECT_INFO *const object = &g_Objects[object_id];
|
const OBJECT *const object = &g_Objects[object_id];
|
||||||
if (!object->loaded) {
|
if (!object->loaded) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -504,7 +503,7 @@ void Object_SetMeshReflective(
|
||||||
|
|
||||||
void Object_SetReflective(const GAME_OBJECT_ID object_id, const bool enabled)
|
void Object_SetReflective(const GAME_OBJECT_ID object_id, const bool enabled)
|
||||||
{
|
{
|
||||||
const OBJECT_INFO *const object = &g_Objects[object_id];
|
const OBJECT *const object = &g_Objects[object_id];
|
||||||
for (int32_t i = 0; i < object->nmeshes; i++) {
|
for (int32_t i = 0; i < object->nmeshes; i++) {
|
||||||
Object_SetMeshReflective(object_id, i, enabled);
|
Object_SetMeshReflective(object_id, i, enabled);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
typedef struct GAME_OBJECT_PAIR {
|
typedef struct {
|
||||||
const GAME_OBJECT_ID key_id;
|
const GAME_OBJECT_ID key_id;
|
||||||
const GAME_OBJECT_ID value_id;
|
const GAME_OBJECT_ID value_id;
|
||||||
} GAME_OBJECT_PAIR;
|
} GAME_OBJECT_PAIR;
|
||||||
|
@ -16,19 +16,18 @@ GAME_OBJECT_ID Object_GetCognateInverse(
|
||||||
int16_t Object_FindReceptacle(GAME_OBJECT_ID object_id);
|
int16_t Object_FindReceptacle(GAME_OBJECT_ID object_id);
|
||||||
bool Object_IsObjectType(
|
bool Object_IsObjectType(
|
||||||
GAME_OBJECT_ID object_id, const GAME_OBJECT_ID *test_arr);
|
GAME_OBJECT_ID object_id, const GAME_OBJECT_ID *test_arr);
|
||||||
void Object_Collision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
void Object_Collision(int16_t item_num, ITEM *lara_item, COLL_INFO *coll);
|
||||||
void Object_CollisionTrap(
|
void Object_CollisionTrap(int16_t item_num, ITEM *lara_item, COLL_INFO *coll);
|
||||||
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
|
||||||
|
|
||||||
void Object_DrawInterpolatedObject(
|
void Object_DrawInterpolatedObject(
|
||||||
const OBJECT_INFO *object, uint32_t meshes, const int16_t *extra_rotation,
|
const OBJECT *object, uint32_t meshes, const int16_t *extra_rotation,
|
||||||
const FRAME_INFO *frame1, const FRAME_INFO *frame2, int32_t frac,
|
const FRAME_INFO *frame1, const FRAME_INFO *frame2, int32_t frac,
|
||||||
int32_t rate);
|
int32_t rate);
|
||||||
void Object_DrawDummyItem(ITEM_INFO *item);
|
void Object_DrawDummyItem(ITEM *item);
|
||||||
void Object_DrawSpriteItem(ITEM_INFO *item);
|
void Object_DrawSpriteItem(ITEM *item);
|
||||||
void Object_DrawPickupItem(ITEM_INFO *item);
|
void Object_DrawPickupItem(ITEM *item);
|
||||||
void Object_DrawAnimatingItem(ITEM_INFO *item);
|
void Object_DrawAnimatingItem(ITEM *item);
|
||||||
void Object_DrawUnclippedItem(ITEM_INFO *item);
|
void Object_DrawUnclippedItem(ITEM *item);
|
||||||
void Object_SetMeshReflective(
|
void Object_SetMeshReflective(
|
||||||
GAME_OBJECT_ID object_id, int32_t mesh_idx, bool enabled);
|
GAME_OBJECT_ID object_id, int32_t mesh_idx, bool enabled);
|
||||||
void Object_SetReflective(GAME_OBJECT_ID object_id, bool enabled);
|
void Object_SetReflective(GAME_OBJECT_ID object_id, bool enabled);
|
||||||
|
|
|
@ -46,14 +46,14 @@ typedef enum {
|
||||||
APE_VAULT = 11,
|
APE_VAULT = 11,
|
||||||
} APE_ANIM;
|
} APE_ANIM;
|
||||||
|
|
||||||
static BITE_INFO m_ApeBite = { 0, -19, 75, 15 };
|
static BITE m_ApeBite = { 0, -19, 75, 15 };
|
||||||
|
|
||||||
static bool M_Vault(int16_t item_num, int16_t angle);
|
static bool M_Vault(int16_t item_num, int16_t angle);
|
||||||
|
|
||||||
static bool M_Vault(int16_t item_num, int16_t angle)
|
static bool M_Vault(int16_t item_num, int16_t angle)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
CREATURE_INFO *ape = item->data;
|
CREATURE *ape = item->data;
|
||||||
int32_t x = item->pos.x >> WALL_SHIFT;
|
int32_t x = item->pos.x >> WALL_SHIFT;
|
||||||
int32_t y = item->pos.y;
|
int32_t y = item->pos.y;
|
||||||
int32_t z = item->pos.z >> WALL_SHIFT;
|
int32_t z = item->pos.z >> WALL_SHIFT;
|
||||||
|
@ -108,7 +108,7 @@ static bool M_Vault(int16_t item_num, int16_t angle)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ape_Setup(OBJECT_INFO *obj)
|
void Ape_Setup(OBJECT *obj)
|
||||||
{
|
{
|
||||||
if (!obj->loaded) {
|
if (!obj->loaded) {
|
||||||
return;
|
return;
|
||||||
|
@ -131,7 +131,7 @@ void Ape_Setup(OBJECT_INFO *obj)
|
||||||
|
|
||||||
void Ape_Control(int16_t item_num)
|
void Ape_Control(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -140,7 +140,7 @@ void Ape_Control(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO *ape = item->data;
|
CREATURE *ape = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void Ape_Setup(OBJECT_INFO *obj);
|
void Ape_Setup(OBJECT *obj);
|
||||||
void Ape_Control(int16_t item_num);
|
void Ape_Control(int16_t item_num);
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
static int32_t m_AnchorX = -1;
|
static int32_t m_AnchorX = -1;
|
||||||
static int32_t m_AnchorZ = -1;
|
static int32_t m_AnchorZ = -1;
|
||||||
|
|
||||||
void BaconLara_Setup(OBJECT_INFO *obj)
|
void BaconLara_Setup(OBJECT *obj)
|
||||||
{
|
{
|
||||||
obj->initialise = BaconLara_Initialise;
|
obj->initialise = BaconLara_Initialise;
|
||||||
obj->control = BaconLara_Control;
|
obj->control = BaconLara_Control;
|
||||||
|
@ -41,7 +41,7 @@ bool BaconLara_InitialiseAnchor(int32_t room_index)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOM_INFO *r = &g_RoomInfo[room_index];
|
ROOM *r = &g_RoomInfo[room_index];
|
||||||
m_AnchorX = r->x + r->x_size * (WALL_L >> 1);
|
m_AnchorX = r->x + r->x_size * (WALL_L >> 1);
|
||||||
m_AnchorZ = r->z + r->z_size * (WALL_L >> 1);
|
m_AnchorZ = r->z + r->z_size * (WALL_L >> 1);
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ void BaconLara_Control(int16_t item_num)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->hit_points < LARA_MAX_HITPOINTS) {
|
if (item->hit_points < LARA_MAX_HITPOINTS) {
|
||||||
Lara_TakeDamage((LARA_MAX_HITPOINTS - item->hit_points) * 10, false);
|
Lara_TakeDamage((LARA_MAX_HITPOINTS - item->hit_points) * 10, false);
|
||||||
|
@ -67,7 +67,7 @@ void BaconLara_Control(int16_t item_num)
|
||||||
int32_t z = 2 * m_AnchorZ - g_LaraItem->pos.z;
|
int32_t z = 2 * m_AnchorZ - g_LaraItem->pos.z;
|
||||||
|
|
||||||
int16_t room_num = item->room_num;
|
int16_t room_num = item->room_num;
|
||||||
const SECTOR_INFO *sector = Room_GetSector(x, y, z, &room_num);
|
const SECTOR *sector = Room_GetSector(x, y, z, &room_num);
|
||||||
const int32_t h = Room_GetHeight(sector, x, y, z);
|
const int32_t h = Room_GetHeight(sector, x, y, z);
|
||||||
item->floor = h;
|
item->floor = h;
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ void BaconLara_Control(int16_t item_num)
|
||||||
int32_t z = item->pos.z;
|
int32_t z = item->pos.z;
|
||||||
|
|
||||||
int16_t room_num = item->room_num;
|
int16_t room_num = item->room_num;
|
||||||
const SECTOR_INFO *sector = Room_GetSector(x, y, z, &room_num);
|
const SECTOR *sector = Room_GetSector(x, y, z, &room_num);
|
||||||
const int32_t h = Room_GetHeight(sector, x, y, z);
|
const int32_t h = Room_GetHeight(sector, x, y, z);
|
||||||
item->floor = h;
|
item->floor = h;
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ void BaconLara_Control(int16_t item_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaconLara_Draw(ITEM_INFO *item)
|
void BaconLara_Draw(ITEM *item)
|
||||||
{
|
{
|
||||||
if (item->current_anim_state == LS_DEATH) {
|
if (item->current_anim_state == LS_DEATH) {
|
||||||
Object_DrawAnimatingItem(item);
|
Object_DrawAnimatingItem(item);
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void BaconLara_Setup(OBJECT_INFO *obj);
|
void BaconLara_Setup(OBJECT *obj);
|
||||||
void BaconLara_Initialise(int16_t item_num);
|
void BaconLara_Initialise(int16_t item_num);
|
||||||
bool BaconLara_InitialiseAnchor(int32_t room_index);
|
bool BaconLara_InitialiseAnchor(int32_t room_index);
|
||||||
void BaconLara_Control(int16_t item_num);
|
void BaconLara_Control(int16_t item_num);
|
||||||
void BaconLara_Draw(ITEM_INFO *item);
|
void BaconLara_Draw(ITEM *item);
|
||||||
|
|
|
@ -27,9 +27,9 @@ typedef enum {
|
||||||
BALDY_SHOOT = 6,
|
BALDY_SHOOT = 6,
|
||||||
} BALDY_ANIM;
|
} BALDY_ANIM;
|
||||||
|
|
||||||
static BITE_INFO m_BaldyGun = { -20, 440, 20, 9 };
|
static BITE m_BaldyGun = { -20, 440, 20, 9 };
|
||||||
|
|
||||||
void Baldy_Setup(OBJECT_INFO *obj)
|
void Baldy_Setup(OBJECT *obj)
|
||||||
{
|
{
|
||||||
if (!obj->loaded) {
|
if (!obj->loaded) {
|
||||||
return;
|
return;
|
||||||
|
@ -57,7 +57,7 @@ void Baldy_Initialise(int16_t item_num)
|
||||||
|
|
||||||
void Baldy_Control(int16_t item_num)
|
void Baldy_Control(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -66,7 +66,7 @@ void Baldy_Control(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO *baldy = item->data;
|
CREATURE *baldy = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
int16_t tilt = 0;
|
int16_t tilt = 0;
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void Baldy_Setup(OBJECT_INFO *obj);
|
void Baldy_Setup(OBJECT *obj);
|
||||||
void Baldy_Initialise(int16_t item_num);
|
void Baldy_Initialise(int16_t item_num);
|
||||||
void Baldy_Control(int16_t item_num);
|
void Baldy_Control(int16_t item_num);
|
||||||
|
|
|
@ -27,13 +27,13 @@ typedef enum {
|
||||||
BAT_DEATH = 5,
|
BAT_DEATH = 5,
|
||||||
} BAT_ANIM;
|
} BAT_ANIM;
|
||||||
|
|
||||||
static BITE_INFO m_BatBite = { 0, 16, 45, 4 };
|
static BITE m_BatBite = { 0, 16, 45, 4 };
|
||||||
|
|
||||||
static void M_FixEmbeddedPosition(int16_t item_num);
|
static void M_FixEmbeddedPosition(int16_t item_num);
|
||||||
|
|
||||||
static void M_FixEmbeddedPosition(int16_t item_num)
|
static void M_FixEmbeddedPosition(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
if (item->status == IS_ACTIVE) {
|
if (item->status == IS_ACTIVE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ static void M_FixEmbeddedPosition(int16_t item_num)
|
||||||
const int32_t y = item->pos.y;
|
const int32_t y = item->pos.y;
|
||||||
const int32_t z = item->pos.z;
|
const int32_t z = item->pos.z;
|
||||||
int16_t room_num = item->room_num;
|
int16_t room_num = item->room_num;
|
||||||
const SECTOR_INFO *const sector = Room_GetSector(x, y, z, &room_num);
|
const SECTOR *const sector = Room_GetSector(x, y, z, &room_num);
|
||||||
const int16_t ceiling = Room_GetCeiling(sector, x, y, z);
|
const int16_t ceiling = Room_GetCeiling(sector, x, y, z);
|
||||||
|
|
||||||
// The bats animation and frame have to be changed to the hanging
|
// The bats animation and frame have to be changed to the hanging
|
||||||
|
@ -65,7 +65,7 @@ static void M_FixEmbeddedPosition(int16_t item_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bat_Setup(OBJECT_INFO *obj)
|
void Bat_Setup(OBJECT *obj)
|
||||||
{
|
{
|
||||||
if (!obj->loaded) {
|
if (!obj->loaded) {
|
||||||
return;
|
return;
|
||||||
|
@ -86,7 +86,7 @@ void Bat_Setup(OBJECT_INFO *obj)
|
||||||
|
|
||||||
void Bat_Control(int16_t item_num)
|
void Bat_Control(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -95,7 +95,7 @@ void Bat_Control(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO *bat = item->data;
|
CREATURE *bat = item->data;
|
||||||
PHD_ANGLE angle = 0;
|
PHD_ANGLE angle = 0;
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
if (item->pos.y < item->floor) {
|
if (item->pos.y < item->floor) {
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void Bat_Setup(OBJECT_INFO *obj);
|
void Bat_Setup(OBJECT *obj);
|
||||||
void Bat_Initialise(int16_t item_num);
|
void Bat_Initialise(int16_t item_num);
|
||||||
void Bat_Control(int16_t item_num);
|
void Bat_Control(int16_t item_num);
|
||||||
|
|
|
@ -45,9 +45,9 @@ typedef enum {
|
||||||
BEAR_DEATH = 9,
|
BEAR_DEATH = 9,
|
||||||
} BEAR_ANIM;
|
} BEAR_ANIM;
|
||||||
|
|
||||||
static BITE_INFO m_BearHeadBite = { 0, 96, 335, 14 };
|
static BITE m_BearHeadBite = { 0, 96, 335, 14 };
|
||||||
|
|
||||||
void Bear_Setup(OBJECT_INFO *obj)
|
void Bear_Setup(OBJECT *obj)
|
||||||
{
|
{
|
||||||
if (!obj->loaded) {
|
if (!obj->loaded) {
|
||||||
return;
|
return;
|
||||||
|
@ -74,7 +74,7 @@ void Bear_Setup(OBJECT_INFO *obj)
|
||||||
|
|
||||||
void Bear_Control(int16_t item_num)
|
void Bear_Control(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -83,7 +83,7 @@ void Bear_Control(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO *bear = (CREATURE_INFO *)item->data;
|
CREATURE *bear = (CREATURE *)item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
PHD_ANGLE angle = 0;
|
PHD_ANGLE angle = 0;
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void Bear_Setup(OBJECT_INFO *obj);
|
void Bear_Setup(OBJECT *obj);
|
||||||
void Bear_Control(int16_t item_num);
|
void Bear_Control(int16_t item_num);
|
||||||
|
|
|
@ -36,10 +36,10 @@ typedef enum {
|
||||||
CENTAUR_WARNING = 6,
|
CENTAUR_WARNING = 6,
|
||||||
} CENTAUR_ANIM;
|
} CENTAUR_ANIM;
|
||||||
|
|
||||||
static BITE_INFO m_CentaurRocket = { 11, 415, 41, 13 };
|
static BITE m_CentaurRocket = { 11, 415, 41, 13 };
|
||||||
static BITE_INFO m_CentaurRear = { 50, 30, 0, 5 };
|
static BITE m_CentaurRear = { 50, 30, 0, 5 };
|
||||||
|
|
||||||
void Centaur_Setup(OBJECT_INFO *obj)
|
void Centaur_Setup(OBJECT *obj)
|
||||||
{
|
{
|
||||||
if (!obj->loaded) {
|
if (!obj->loaded) {
|
||||||
return;
|
return;
|
||||||
|
@ -62,7 +62,7 @@ void Centaur_Setup(OBJECT_INFO *obj)
|
||||||
|
|
||||||
void Centaur_Control(int16_t item_num)
|
void Centaur_Control(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -71,7 +71,7 @@ void Centaur_Control(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO *centaur = item->data;
|
CREATURE *centaur = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void Centaur_Setup(OBJECT_INFO *obj);
|
void Centaur_Setup(OBJECT *obj);
|
||||||
void Centaur_Control(int16_t item_num);
|
void Centaur_Control(int16_t item_num);
|
||||||
|
|
|
@ -29,10 +29,10 @@ typedef enum {
|
||||||
COWBOY_SHOOT = 6,
|
COWBOY_SHOOT = 6,
|
||||||
} COWBOY_ANIM;
|
} COWBOY_ANIM;
|
||||||
|
|
||||||
static BITE_INFO m_CowboyGun1 = { 1, 200, 41, 5 };
|
static BITE m_CowboyGun1 = { 1, 200, 41, 5 };
|
||||||
static BITE_INFO m_CowboyGun2 = { -2, 200, 40, 8 };
|
static BITE m_CowboyGun2 = { -2, 200, 40, 8 };
|
||||||
|
|
||||||
void Cowboy_Setup(OBJECT_INFO *obj)
|
void Cowboy_Setup(OBJECT *obj)
|
||||||
{
|
{
|
||||||
if (!obj->loaded) {
|
if (!obj->loaded) {
|
||||||
return;
|
return;
|
||||||
|
@ -54,7 +54,7 @@ void Cowboy_Setup(OBJECT_INFO *obj)
|
||||||
|
|
||||||
void Cowboy_Control(int16_t item_num)
|
void Cowboy_Control(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -63,7 +63,7 @@ void Cowboy_Control(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO *cowboy = item->data;
|
CREATURE *cowboy = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
int16_t tilt = 0;
|
int16_t tilt = 0;
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void Cowboy_Setup(OBJECT_INFO *obj);
|
void Cowboy_Setup(OBJECT *obj);
|
||||||
void Cowboy_Control(int16_t item_num);
|
void Cowboy_Control(int16_t item_num);
|
||||||
|
|
|
@ -52,7 +52,7 @@ typedef enum {
|
||||||
ALLIGATOR_DEATH = 3,
|
ALLIGATOR_DEATH = 3,
|
||||||
} ALLIGATOR_ANIM;
|
} ALLIGATOR_ANIM;
|
||||||
|
|
||||||
static BITE_INFO m_CrocodileBite = { 5, -21, 467, 9 };
|
static BITE m_CrocodileBite = { 5, -21, 467, 9 };
|
||||||
|
|
||||||
static const HYBRID_INFO m_CrocodileInfo = {
|
static const HYBRID_INFO m_CrocodileInfo = {
|
||||||
.land.id = O_CROCODILE,
|
.land.id = O_CROCODILE,
|
||||||
|
@ -63,7 +63,7 @@ static const HYBRID_INFO m_CrocodileInfo = {
|
||||||
.water.active_anim = ALLIGATOR_EMPTY,
|
.water.active_anim = ALLIGATOR_EMPTY,
|
||||||
};
|
};
|
||||||
|
|
||||||
void Croc_Setup(OBJECT_INFO *obj)
|
void Croc_Setup(OBJECT *obj)
|
||||||
{
|
{
|
||||||
if (!obj->loaded) {
|
if (!obj->loaded) {
|
||||||
return;
|
return;
|
||||||
|
@ -86,7 +86,7 @@ void Croc_Setup(OBJECT_INFO *obj)
|
||||||
|
|
||||||
void Croc_Control(int16_t item_num)
|
void Croc_Control(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -95,7 +95,7 @@ void Croc_Control(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO *croc = item->data;
|
CREATURE *croc = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ void Croc_Control(int16_t item_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Alligator_Setup(OBJECT_INFO *obj)
|
void Alligator_Setup(OBJECT *obj)
|
||||||
{
|
{
|
||||||
if (!obj->loaded) {
|
if (!obj->loaded) {
|
||||||
return;
|
return;
|
||||||
|
@ -224,7 +224,7 @@ void Alligator_Setup(OBJECT_INFO *obj)
|
||||||
|
|
||||||
void Alligator_Control(int16_t item_num)
|
void Alligator_Control(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -233,8 +233,8 @@ void Alligator_Control(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO *gator = item->data;
|
CREATURE *gator = item->data;
|
||||||
const SECTOR_INFO *sector;
|
const SECTOR *sector;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
int16_t room_num;
|
int16_t room_num;
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void Croc_Setup(OBJECT_INFO *obj);
|
void Croc_Setup(OBJECT *obj);
|
||||||
void Croc_Control(int16_t item_num);
|
void Croc_Control(int16_t item_num);
|
||||||
|
|
||||||
void Alligator_Setup(OBJECT_INFO *obj);
|
void Alligator_Setup(OBJECT *obj);
|
||||||
void Alligator_Control(int16_t item_num);
|
void Alligator_Control(int16_t item_num);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "game/items.h"
|
#include "game/items.h"
|
||||||
#include "global/vars.h"
|
#include "global/vars.h"
|
||||||
|
|
||||||
void CutscenePlayer_Setup(OBJECT_INFO *obj)
|
void CutscenePlayer_Setup(OBJECT *obj)
|
||||||
{
|
{
|
||||||
obj->initialise = CutscenePlayer_Initialise;
|
obj->initialise = CutscenePlayer_Initialise;
|
||||||
obj->control = CutscenePlayer_Control;
|
obj->control = CutscenePlayer_Control;
|
||||||
|
@ -14,7 +14,7 @@ void CutscenePlayer_Initialise(int16_t item_num)
|
||||||
{
|
{
|
||||||
Item_AddActive(item_num);
|
Item_AddActive(item_num);
|
||||||
|
|
||||||
ITEM_INFO *const item = &g_Items[item_num];
|
ITEM *const item = &g_Items[item_num];
|
||||||
if (item->object_id == O_PLAYER_1) {
|
if (item->object_id == O_PLAYER_1) {
|
||||||
g_Camera.pos.room_num = item->room_num;
|
g_Camera.pos.room_num = item->room_num;
|
||||||
g_CinePosition.pos.x = item->pos.x;
|
g_CinePosition.pos.x = item->pos.x;
|
||||||
|
@ -27,7 +27,7 @@ void CutscenePlayer_Initialise(int16_t item_num)
|
||||||
|
|
||||||
void CutscenePlayer_Control(int16_t item_num)
|
void CutscenePlayer_Control(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *const item = &g_Items[item_num];
|
ITEM *const item = &g_Items[item_num];
|
||||||
if (item->object_id != O_PLAYER_4) {
|
if (item->object_id != O_PLAYER_4) {
|
||||||
item->rot.y = g_Camera.target_angle;
|
item->rot.y = g_Camera.target_angle;
|
||||||
item->pos.x = g_CinePosition.pos.x;
|
item->pos.x = g_CinePosition.pos.x;
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void CutscenePlayer_Setup(OBJECT_INFO *obj);
|
void CutscenePlayer_Setup(OBJECT *obj);
|
||||||
void CutscenePlayer_Initialise(int16_t item_num);
|
void CutscenePlayer_Initialise(int16_t item_num);
|
||||||
void CutscenePlayer_Control(int16_t item_num);
|
void CutscenePlayer_Control(int16_t item_num);
|
||||||
|
|
|
@ -30,9 +30,9 @@ typedef enum {
|
||||||
LARSON_SHOOT = 7,
|
LARSON_SHOOT = 7,
|
||||||
} LARSON_ANIM;
|
} LARSON_ANIM;
|
||||||
|
|
||||||
static BITE_INFO m_LarsonGun = { -60, 170, 0, 14 };
|
static BITE m_LarsonGun = { -60, 170, 0, 14 };
|
||||||
|
|
||||||
void Larson_Setup(OBJECT_INFO *obj)
|
void Larson_Setup(OBJECT *obj)
|
||||||
{
|
{
|
||||||
if (!obj->loaded) {
|
if (!obj->loaded) {
|
||||||
return;
|
return;
|
||||||
|
@ -54,7 +54,7 @@ void Larson_Setup(OBJECT_INFO *obj)
|
||||||
|
|
||||||
void Larson_Control(int16_t item_num)
|
void Larson_Control(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO *item = &g_Items[item_num];
|
ITEM *item = &g_Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
if (!LOT_EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -63,7 +63,7 @@ void Larson_Control(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO *person = item->data;
|
CREATURE *person = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
int16_t tilt = 0;
|
int16_t tilt = 0;
|
||||||
|
|
|
@ -2,5 +2,5 @@
|
||||||
|
|
||||||
#include "global/types.h"
|
#include "global/types.h"
|
||||||
|
|
||||||
void Larson_Setup(OBJECT_INFO *obj);
|
void Larson_Setup(OBJECT *obj);
|
||||||
void Larson_Control(int16_t item_num);
|
void Larson_Control(int16_t item_num);
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue