mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 20:58:07 +03:00
move pointer alignment to right
This commit is contained in:
parent
76707fdfb2
commit
64e1d247b8
80 changed files with 1612 additions and 1599 deletions
|
@ -6,3 +6,4 @@ AllowShortFunctionsOnASingleLine: InlineOnly
|
||||||
BreakBeforeBinaryOperators: NonAssignment
|
BreakBeforeBinaryOperators: NonAssignment
|
||||||
AlignAfterOpenBracket: AlwaysBreak
|
AlignAfterOpenBracket: AlwaysBreak
|
||||||
SortIncludes: false
|
SortIncludes: false
|
||||||
|
PointerAlignment: Right
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#define EXTRACT_ROT_X(rots) (((rots >> 20) & 0x3FF) << 6)
|
#define EXTRACT_ROT_X(rots) (((rots >> 20) & 0x3FF) << 6)
|
||||||
#define EXTRACT_ROT_Z(rots) ((rots & 0x3FF) << 6)
|
#define EXTRACT_ROT_Z(rots) ((rots & 0x3FF) << 6)
|
||||||
|
|
||||||
void phd_GenerateW2V(PHD_3DPOS* viewpos)
|
void phd_GenerateW2V(PHD_3DPOS *viewpos)
|
||||||
{
|
{
|
||||||
PhdMatrixPtr = &MatrixStack;
|
PhdMatrixPtr = &MatrixStack;
|
||||||
int32_t sx = phd_sin(viewpos->x_rot);
|
int32_t sx = phd_sin(viewpos->x_rot);
|
||||||
|
@ -56,7 +56,7 @@ void phd_LookAt(
|
||||||
phd_GenerateW2V(&viewer);
|
phd_GenerateW2V(&viewer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void phd_GetVectorAngles(int32_t x, int32_t y, int32_t z, int16_t* dest)
|
void phd_GetVectorAngles(int32_t x, int32_t y, int32_t z, int16_t *dest)
|
||||||
{
|
{
|
||||||
dest[0] = phd_atan(z, x);
|
dest[0] = phd_atan(z, x);
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ void phd_RotX(PHD_ANGLE rx)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
int32_t sx = phd_sin(rx);
|
int32_t sx = phd_sin(rx);
|
||||||
int32_t cx = phd_cos(rx);
|
int32_t cx = phd_cos(rx);
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ void phd_RotY(PHD_ANGLE ry)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
int32_t sy = phd_sin(ry);
|
int32_t sy = phd_sin(ry);
|
||||||
int32_t cy = phd_cos(ry);
|
int32_t cy = phd_cos(ry);
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ void phd_RotZ(PHD_ANGLE rz)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
int32_t sz = phd_sin(rz);
|
int32_t sz = phd_sin(rz);
|
||||||
int32_t cz = phd_cos(rz);
|
int32_t cz = phd_cos(rz);
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ void phd_RotZ(PHD_ANGLE rz)
|
||||||
|
|
||||||
void phd_RotYXZ(PHD_ANGLE ry, PHD_ANGLE rx, PHD_ANGLE rz)
|
void phd_RotYXZ(PHD_ANGLE ry, PHD_ANGLE rx, PHD_ANGLE rz)
|
||||||
{
|
{
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
int32_t r0, r1;
|
int32_t r0, r1;
|
||||||
|
|
||||||
if (ry) {
|
if (ry) {
|
||||||
|
@ -223,7 +223,7 @@ void phd_RotYXZ(PHD_ANGLE ry, PHD_ANGLE rx, PHD_ANGLE rz)
|
||||||
|
|
||||||
void phd_RotYXZpack(int32_t rots)
|
void phd_RotYXZpack(int32_t rots)
|
||||||
{
|
{
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
int32_t r0, r1;
|
int32_t r0, r1;
|
||||||
|
|
||||||
PHD_ANGLE ry = EXTRACT_ROT_Y(rots);
|
PHD_ANGLE ry = EXTRACT_ROT_Y(rots);
|
||||||
|
@ -292,7 +292,7 @@ void phd_RotYXZpack(int32_t rots)
|
||||||
|
|
||||||
int32_t phd_TranslateRel(int32_t x, int32_t y, int32_t z)
|
int32_t phd_TranslateRel(int32_t x, int32_t y, int32_t z)
|
||||||
{
|
{
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
mptr->_03 += mptr->_00 * x + mptr->_01 * y + mptr->_02 * z;
|
mptr->_03 += mptr->_00 * x + mptr->_01 * y + mptr->_02 * z;
|
||||||
mptr->_13 += mptr->_10 * x + mptr->_11 * y + mptr->_12 * z;
|
mptr->_13 += mptr->_10 * x + mptr->_11 * y + mptr->_12 * z;
|
||||||
mptr->_23 += mptr->_20 * x + mptr->_21 * y + mptr->_22 * z;
|
mptr->_23 += mptr->_20 * x + mptr->_21 * y + mptr->_22 * z;
|
||||||
|
@ -302,7 +302,7 @@ int32_t phd_TranslateRel(int32_t x, int32_t y, int32_t z)
|
||||||
|
|
||||||
void phd_TranslateAbs(int32_t x, int32_t y, int32_t z)
|
void phd_TranslateAbs(int32_t x, int32_t y, int32_t z)
|
||||||
{
|
{
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
x -= W2VMatrix._03;
|
x -= W2VMatrix._03;
|
||||||
y -= W2VMatrix._13;
|
y -= W2VMatrix._13;
|
||||||
z -= W2VMatrix._23;
|
z -= W2VMatrix._23;
|
||||||
|
@ -311,7 +311,7 @@ void phd_TranslateAbs(int32_t x, int32_t y, int32_t z)
|
||||||
mptr->_23 = mptr->_20 * x + mptr->_21 * y + mptr->_22 * z;
|
mptr->_23 = mptr->_20 * x + mptr->_21 * y + mptr->_22 * z;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t visible_zclip(PHD_VBUF* vn1, PHD_VBUF* vn2, PHD_VBUF* vn3)
|
int32_t visible_zclip(PHD_VBUF *vn1, PHD_VBUF *vn2, PHD_VBUF *vn3)
|
||||||
{
|
{
|
||||||
double v1x = vn1->xv;
|
double v1x = vn1->xv;
|
||||||
double v1y = vn1->yv;
|
double v1y = vn1->yv;
|
||||||
|
@ -331,7 +331,7 @@ int32_t visible_zclip(PHD_VBUF* vn1, PHD_VBUF* vn2, PHD_VBUF* vn3)
|
||||||
void phd_InitWindow(
|
void phd_InitWindow(
|
||||||
int32_t x, int32_t y, int32_t width, int32_t height, int32_t nearz,
|
int32_t x, int32_t y, int32_t width, int32_t height, int32_t nearz,
|
||||||
int32_t farz, int32_t view_angle, int32_t scrwidth, int32_t scrheight,
|
int32_t farz, int32_t view_angle, int32_t scrwidth, int32_t scrheight,
|
||||||
uint8_t* scrptr)
|
uint8_t *scrptr)
|
||||||
{
|
{
|
||||||
PhdWinPtr = &scrptr[x + y * scrwidth];
|
PhdWinPtr = &scrptr[x + y * scrwidth];
|
||||||
PhdWinMaxX = width - 1;
|
PhdWinMaxX = width - 1;
|
||||||
|
@ -390,7 +390,7 @@ void phd_PushMatrix()
|
||||||
// originally in shell.c
|
// originally in shell.c
|
||||||
void phd_PushUnitMatrix()
|
void phd_PushUnitMatrix()
|
||||||
{
|
{
|
||||||
PHD_MATRIX* mptr = ++PhdMatrixPtr;
|
PHD_MATRIX *mptr = ++PhdMatrixPtr;
|
||||||
mptr->_00 = W2V_SCALE;
|
mptr->_00 = W2V_SCALE;
|
||||||
mptr->_01 = 0;
|
mptr->_01 = 0;
|
||||||
mptr->_02 = 0;
|
mptr->_02 = 0;
|
||||||
|
|
|
@ -10,11 +10,11 @@
|
||||||
#define phd_RotateLight ((void (*)(PHD_ANGLE pitch, PHD_ANGLE yaw))0x004023A0)
|
#define phd_RotateLight ((void (*)(PHD_ANGLE pitch, PHD_ANGLE yaw))0x004023A0)
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
void phd_GenerateW2V(PHD_3DPOS* viewpos);
|
void phd_GenerateW2V(PHD_3DPOS *viewpos);
|
||||||
void phd_LookAt(
|
void phd_LookAt(
|
||||||
int32_t xsrc, int32_t ysrc, int32_t zsrc, int32_t xtar, int32_t ytar,
|
int32_t xsrc, int32_t ysrc, int32_t zsrc, int32_t xtar, int32_t ytar,
|
||||||
int32_t ztar, int16_t roll);
|
int32_t ztar, int16_t roll);
|
||||||
void phd_GetVectorAngles(int32_t x, int32_t y, int32_t z, int16_t* dest);
|
void phd_GetVectorAngles(int32_t x, int32_t y, int32_t z, int16_t *dest);
|
||||||
void phd_RotX(PHD_ANGLE rx);
|
void phd_RotX(PHD_ANGLE rx);
|
||||||
void phd_RotY(PHD_ANGLE ry);
|
void phd_RotY(PHD_ANGLE ry);
|
||||||
void phd_RotZ(PHD_ANGLE rz);
|
void phd_RotZ(PHD_ANGLE rz);
|
||||||
|
@ -22,11 +22,11 @@ void phd_RotYXZ(PHD_ANGLE ry, PHD_ANGLE rx, PHD_ANGLE rz);
|
||||||
void phd_RotYXZpack(int32_t rots);
|
void phd_RotYXZpack(int32_t rots);
|
||||||
int32_t phd_TranslateRel(int32_t x, int32_t y, int32_t z);
|
int32_t phd_TranslateRel(int32_t x, int32_t y, int32_t z);
|
||||||
void phd_TranslateAbs(int32_t x, int32_t y, int32_t z);
|
void phd_TranslateAbs(int32_t x, int32_t y, int32_t z);
|
||||||
int32_t visible_zclip(PHD_VBUF* vn1, PHD_VBUF* vn2, PHD_VBUF* vn3);
|
int32_t visible_zclip(PHD_VBUF *vn1, PHD_VBUF *vn2, PHD_VBUF *vn3);
|
||||||
void phd_InitWindow(
|
void phd_InitWindow(
|
||||||
int32_t x, int32_t y, int32_t width, int32_t height, int32_t nearz,
|
int32_t x, int32_t y, int32_t width, int32_t height, int32_t nearz,
|
||||||
int32_t farz, int32_t view_angle, int32_t scrwidth, int32_t scrheight,
|
int32_t farz, int32_t view_angle, int32_t scrwidth, int32_t scrheight,
|
||||||
uint8_t* scrptr);
|
uint8_t *scrptr);
|
||||||
void AlterFOV(PHD_ANGLE fov);
|
void AlterFOV(PHD_ANGLE fov);
|
||||||
|
|
||||||
void phd_PushMatrix();
|
void phd_PushMatrix();
|
||||||
|
|
20
src/config.c
20
src/config.c
|
@ -31,9 +31,9 @@
|
||||||
READ_CUSTOM(ReadBarColor, opt, default_value)
|
READ_CUSTOM(ReadBarColor, opt, default_value)
|
||||||
|
|
||||||
static int8_t ReadBarShowingMode(
|
static int8_t ReadBarShowingMode(
|
||||||
struct json_value_s* root, const char* name, int8_t default_value)
|
struct json_value_s *root, const char *name, int8_t default_value)
|
||||||
{
|
{
|
||||||
const char* value_str;
|
const char *value_str;
|
||||||
if (JSONGetStringValue(root, name, &value_str)) {
|
if (JSONGetStringValue(root, name, &value_str)) {
|
||||||
if (!strcmp(value_str, "flashing-or-default")) {
|
if (!strcmp(value_str, "flashing-or-default")) {
|
||||||
return T1M_BSM_FLASHING_OR_DEFAULT;
|
return T1M_BSM_FLASHING_OR_DEFAULT;
|
||||||
|
@ -49,9 +49,9 @@ static int8_t ReadBarShowingMode(
|
||||||
}
|
}
|
||||||
|
|
||||||
static int8_t ReadBarLocation(
|
static int8_t ReadBarLocation(
|
||||||
struct json_value_s* root, const char* name, int8_t default_value)
|
struct json_value_s *root, const char *name, int8_t default_value)
|
||||||
{
|
{
|
||||||
const char* value_str;
|
const char *value_str;
|
||||||
if (JSONGetStringValue(root, name, &value_str)) {
|
if (JSONGetStringValue(root, name, &value_str)) {
|
||||||
if (!strcmp(value_str, "top-left")) {
|
if (!strcmp(value_str, "top-left")) {
|
||||||
return T1M_BL_TOP_LEFT;
|
return T1M_BL_TOP_LEFT;
|
||||||
|
@ -71,9 +71,9 @@ static int8_t ReadBarLocation(
|
||||||
}
|
}
|
||||||
|
|
||||||
static int8_t
|
static int8_t
|
||||||
ReadBarColor(struct json_value_s* root, const char* name, int8_t default_value)
|
ReadBarColor(struct json_value_s *root, const char *name, int8_t default_value)
|
||||||
{
|
{
|
||||||
const char* value_str;
|
const char *value_str;
|
||||||
if (JSONGetStringValue(root, name, &value_str)) {
|
if (JSONGetStringValue(root, name, &value_str)) {
|
||||||
if (!strcmp(value_str, "gold")) {
|
if (!strcmp(value_str, "gold")) {
|
||||||
return T1M_BC_GOLD;
|
return T1M_BC_GOLD;
|
||||||
|
@ -98,9 +98,9 @@ ReadBarColor(struct json_value_s* root, const char* name, int8_t default_value)
|
||||||
return default_value;
|
return default_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void T1MReadConfigFromJson(const char* cfg_data)
|
void T1MReadConfigFromJson(const char *cfg_data)
|
||||||
{
|
{
|
||||||
struct json_value_s* json = json_parse_ex(
|
struct json_value_s *json = json_parse_ex(
|
||||||
cfg_data, strlen(cfg_data), json_parse_flags_allow_json5, NULL, NULL,
|
cfg_data, strlen(cfg_data), json_parse_flags_allow_json5, NULL, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ void T1MReadConfigFromJson(const char* cfg_data)
|
||||||
|
|
||||||
int T1MReadConfig()
|
int T1MReadConfig()
|
||||||
{
|
{
|
||||||
FILE* fp = fopen("Tomb1Main.json5", "rb");
|
FILE *fp = fopen("Tomb1Main.json5", "rb");
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
T1MReadConfigFromJson("");
|
T1MReadConfigFromJson("");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -152,7 +152,7 @@ int T1MReadConfig()
|
||||||
int cfg_size = ftell(fp);
|
int cfg_size = ftell(fp);
|
||||||
fseek(fp, 0, SEEK_SET);
|
fseek(fp, 0, SEEK_SET);
|
||||||
|
|
||||||
char* cfg_data = malloc(cfg_size);
|
char *cfg_data = malloc(cfg_size);
|
||||||
if (!cfg_data) {
|
if (!cfg_data) {
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
T1MReadConfigFromJson("");
|
T1MReadConfigFromJson("");
|
||||||
|
|
|
@ -64,7 +64,7 @@ struct {
|
||||||
int8_t fov_vertical;
|
int8_t fov_vertical;
|
||||||
} T1MConfig;
|
} T1MConfig;
|
||||||
|
|
||||||
void T1MReadConfigFromJson(const char* json);
|
void T1MReadConfigFromJson(const char *json);
|
||||||
int T1MReadConfig();
|
int T1MReadConfig();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,7 +22,7 @@ static BITE_INFO BatBite = { 0, 16, 45, 4 };
|
||||||
|
|
||||||
void BatControl(int16_t item_num)
|
void BatControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -31,7 +31,7 @@ void BatControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* bat = item->data;
|
CREATURE_INFO *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) {
|
||||||
|
|
|
@ -39,7 +39,7 @@ static BITE_INFO BearHeadBite = { 0, 96, 335, 14 };
|
||||||
|
|
||||||
void BearControl(int16_t item_num)
|
void BearControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -48,7 +48,7 @@ void BearControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* bear = (CREATURE_INFO*)item->data;
|
CREATURE_INFO *bear = (CREATURE_INFO *)item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
PHD_ANGLE angle = 0;
|
PHD_ANGLE angle = 0;
|
||||||
|
|
||||||
|
|
|
@ -11,21 +11,21 @@
|
||||||
|
|
||||||
void InitialiseCreature(int16_t item_num)
|
void InitialiseCreature(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
item->pos.y_rot += (PHD_ANGLE)((GetRandomControl() - PHD_90) >> 1);
|
item->pos.y_rot += (PHD_ANGLE)((GetRandomControl() - PHD_90) >> 1);
|
||||||
item->collidable = 1;
|
item->collidable = 1;
|
||||||
item->data = NULL;
|
item->data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureAIInfo(ITEM_INFO* item, AI_INFO* info)
|
void CreatureAIInfo(ITEM_INFO *item, AI_INFO *info)
|
||||||
{
|
{
|
||||||
CREATURE_INFO* creature = item->data;
|
CREATURE_INFO *creature = item->data;
|
||||||
if (!creature) {
|
if (!creature) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t* zone;
|
int16_t *zone;
|
||||||
if (creature->LOT.fly) {
|
if (creature->LOT.fly) {
|
||||||
zone = FlyZone[FlipStatus];
|
zone = FlyZone[FlipStatus];
|
||||||
} else if (creature->LOT.step == STEP_L) {
|
} else if (creature->LOT.step == STEP_L) {
|
||||||
|
@ -34,7 +34,7 @@ void CreatureAIInfo(ITEM_INFO* item, AI_INFO* info)
|
||||||
zone = GroundZone2[FlipStatus];
|
zone = GroundZone2[FlipStatus];
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOM_INFO* r = &RoomInfo[item->room_number];
|
ROOM_INFO *r = &RoomInfo[item->room_number];
|
||||||
int32_t x_floor = (item->pos.z - r->z) >> WALL_SHIFT;
|
int32_t x_floor = (item->pos.z - r->z) >> WALL_SHIFT;
|
||||||
int32_t y_floor = (item->pos.x - r->x) >> WALL_SHIFT;
|
int32_t y_floor = (item->pos.x - r->x) >> WALL_SHIFT;
|
||||||
item->box_number = r->floor[x_floor + y_floor * r->x_size].box;
|
item->box_number = r->floor[x_floor + y_floor * r->x_size].box;
|
||||||
|
@ -54,7 +54,7 @@ void CreatureAIInfo(ITEM_INFO* item, AI_INFO* info)
|
||||||
info->enemy_zone |= BLOCKED;
|
info->enemy_zone |= BLOCKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJECT_INFO* object = &Objects[item->object_number];
|
OBJECT_INFO *object = &Objects[item->object_number];
|
||||||
GetBestFrame(item);
|
GetBestFrame(item);
|
||||||
|
|
||||||
int32_t z = LaraItem->pos.z
|
int32_t z = LaraItem->pos.z
|
||||||
|
@ -73,9 +73,9 @@ void CreatureAIInfo(ITEM_INFO* item, AI_INFO* info)
|
||||||
&& (LaraItem->pos.y < item->pos.y + STEP_L);
|
&& (LaraItem->pos.y < item->pos.y + STEP_L);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t SearchLOT(LOT_INFO* LOT, int32_t expansion)
|
int32_t SearchLOT(LOT_INFO *LOT, int32_t expansion)
|
||||||
{
|
{
|
||||||
int16_t* zone;
|
int16_t *zone;
|
||||||
if (LOT->fly) {
|
if (LOT->fly) {
|
||||||
zone = FlyZone[FlipStatus];
|
zone = FlyZone[FlipStatus];
|
||||||
} else if (LOT->step == STEP_L) {
|
} else if (LOT->step == STEP_L) {
|
||||||
|
@ -90,8 +90,8 @@ int32_t SearchLOT(LOT_INFO* LOT, int32_t expansion)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOX_NODE* node = &LOT->node[LOT->head];
|
BOX_NODE *node = &LOT->node[LOT->head];
|
||||||
BOX_INFO* box = &Boxes[LOT->head];
|
BOX_INFO *box = &Boxes[LOT->head];
|
||||||
|
|
||||||
int done = 0;
|
int done = 0;
|
||||||
int index = box->overlap_index & OVERLAP_INDEX;
|
int index = box->overlap_index & OVERLAP_INDEX;
|
||||||
|
@ -111,7 +111,7 @@ int32_t SearchLOT(LOT_INFO* LOT, int32_t expansion)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOX_NODE* expand = &LOT->node[box_number];
|
BOX_NODE *expand = &LOT->node[box_number];
|
||||||
if ((node->search_number & SEARCH_NUMBER)
|
if ((node->search_number & SEARCH_NUMBER)
|
||||||
< (expand->search_number & SEARCH_NUMBER)) {
|
< (expand->search_number & SEARCH_NUMBER)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -152,12 +152,12 @@ int32_t SearchLOT(LOT_INFO* LOT, int32_t expansion)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t UpdateLOT(LOT_INFO* LOT, int32_t expansion)
|
int32_t UpdateLOT(LOT_INFO *LOT, int32_t expansion)
|
||||||
{
|
{
|
||||||
if (LOT->required_box != NO_BOX && LOT->required_box != LOT->target_box) {
|
if (LOT->required_box != NO_BOX && LOT->required_box != LOT->target_box) {
|
||||||
LOT->target_box = LOT->required_box;
|
LOT->target_box = LOT->required_box;
|
||||||
|
|
||||||
BOX_NODE* expand = &LOT->node[LOT->target_box];
|
BOX_NODE *expand = &LOT->node[LOT->target_box];
|
||||||
if (expand->next_expansion == NO_BOX && LOT->tail != LOT->target_box) {
|
if (expand->next_expansion == NO_BOX && LOT->tail != LOT->target_box) {
|
||||||
expand->next_expansion = LOT->head;
|
expand->next_expansion = LOT->head;
|
||||||
|
|
||||||
|
@ -175,11 +175,11 @@ int32_t UpdateLOT(LOT_INFO* LOT, int32_t expansion)
|
||||||
return SearchLOT(LOT, expansion);
|
return SearchLOT(LOT, expansion);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TargetBox(LOT_INFO* LOT, int16_t box_number)
|
void TargetBox(LOT_INFO *LOT, int16_t box_number)
|
||||||
{
|
{
|
||||||
box_number &= BOX_NUMBER;
|
box_number &= BOX_NUMBER;
|
||||||
|
|
||||||
BOX_INFO* box = &Boxes[box_number];
|
BOX_INFO *box = &Boxes[box_number];
|
||||||
|
|
||||||
LOT->target.z = box->left + WALL_L / 2
|
LOT->target.z = box->left + WALL_L / 2
|
||||||
+ (GetRandomControl() * (box->right - box->left - WALL_L) >> 15);
|
+ (GetRandomControl() * (box->right - box->left - WALL_L) >> 15);
|
||||||
|
@ -194,9 +194,9 @@ void TargetBox(LOT_INFO* LOT, int16_t box_number)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t StalkBox(ITEM_INFO* item, int16_t box_number)
|
int32_t StalkBox(ITEM_INFO *item, int16_t box_number)
|
||||||
{
|
{
|
||||||
BOX_INFO* box = &Boxes[box_number];
|
BOX_INFO *box = &Boxes[box_number];
|
||||||
int32_t z = ((box->left + box->right) >> 1) - LaraItem->pos.z;
|
int32_t z = ((box->left + box->right) >> 1) - LaraItem->pos.z;
|
||||||
int32_t x = ((box->top + box->bottom) >> 1) - LaraItem->pos.x;
|
int32_t x = ((box->top + box->bottom) >> 1) - LaraItem->pos.x;
|
||||||
|
|
||||||
|
@ -223,9 +223,9 @@ int32_t StalkBox(ITEM_INFO* item, int16_t box_number)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t EscapeBox(ITEM_INFO* item, int16_t box_number)
|
int32_t EscapeBox(ITEM_INFO *item, int16_t box_number)
|
||||||
{
|
{
|
||||||
BOX_INFO* box = &Boxes[box_number];
|
BOX_INFO *box = &Boxes[box_number];
|
||||||
int32_t z = ((box->left + box->right) >> 1) - LaraItem->pos.z;
|
int32_t z = ((box->left + box->right) >> 1) - LaraItem->pos.z;
|
||||||
int32_t x = ((box->top + box->bottom) >> 1) - LaraItem->pos.x;
|
int32_t x = ((box->top + box->bottom) >> 1) - LaraItem->pos.x;
|
||||||
|
|
||||||
|
@ -242,11 +242,11 @@ int32_t EscapeBox(ITEM_INFO* item, int16_t box_number)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ValidBox(ITEM_INFO* item, int16_t zone_number, int16_t box_number)
|
int32_t ValidBox(ITEM_INFO *item, int16_t zone_number, int16_t box_number)
|
||||||
{
|
{
|
||||||
CREATURE_INFO* creature = item->data;
|
CREATURE_INFO *creature = item->data;
|
||||||
|
|
||||||
int16_t* zone;
|
int16_t *zone;
|
||||||
if (creature->LOT.fly) {
|
if (creature->LOT.fly) {
|
||||||
zone = FlyZone[FlipStatus];
|
zone = FlyZone[FlipStatus];
|
||||||
} else if (creature->LOT.step == STEP_L) {
|
} else if (creature->LOT.step == STEP_L) {
|
||||||
|
@ -259,7 +259,7 @@ int32_t ValidBox(ITEM_INFO* item, int16_t zone_number, int16_t box_number)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOX_INFO* box = &Boxes[box_number];
|
BOX_INFO *box = &Boxes[box_number];
|
||||||
if (box->overlap_index & creature->LOT.block_mask) {
|
if (box->overlap_index & creature->LOT.block_mask) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -272,14 +272,14 @@ int32_t ValidBox(ITEM_INFO* item, int16_t zone_number, int16_t box_number)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureMood(ITEM_INFO* item, AI_INFO* info, int32_t violent)
|
void CreatureMood(ITEM_INFO *item, AI_INFO *info, int32_t violent)
|
||||||
{
|
{
|
||||||
CREATURE_INFO* creature = item->data;
|
CREATURE_INFO *creature = item->data;
|
||||||
if (!creature) {
|
if (!creature) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOT_INFO* LOT = &creature->LOT;
|
LOT_INFO *LOT = &creature->LOT;
|
||||||
if (LOT->node[item->box_number].search_number
|
if (LOT->node[item->box_number].search_number
|
||||||
== (LOT->search_number | BLOCKED_SEARCH)) {
|
== (LOT->search_number | BLOCKED_SEARCH)) {
|
||||||
LOT->required_box = NO_BOX;
|
LOT->required_box = NO_BOX;
|
||||||
|
@ -373,7 +373,7 @@ void CreatureMood(ITEM_INFO* item, AI_INFO* info, int32_t violent)
|
||||||
LOT->target.z = LaraItem->pos.z;
|
LOT->target.z = LaraItem->pos.z;
|
||||||
LOT->required_box = LaraItem->box_number;
|
LOT->required_box = LaraItem->box_number;
|
||||||
if (LOT->fly && Lara.water_status == LWS_ABOVEWATER) {
|
if (LOT->fly && Lara.water_status == LWS_ABOVEWATER) {
|
||||||
int16_t* bounds = GetBestFrame(LaraItem);
|
int16_t *bounds = GetBestFrame(LaraItem);
|
||||||
LOT->target.y += bounds[FRAME_BOUND_MIN_Y];
|
LOT->target.y += bounds[FRAME_BOUND_MIN_Y];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -437,7 +437,7 @@ void CreatureMood(ITEM_INFO* item, AI_INFO* info, int32_t violent)
|
||||||
CalculateTarget(&creature->target, item, &creature->LOT);
|
CalculateTarget(&creature->target, item, &creature->LOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CalculateTarget(PHD_VECTOR* target, ITEM_INFO* item, LOT_INFO* LOT)
|
int32_t CalculateTarget(PHD_VECTOR *target, ITEM_INFO *item, LOT_INFO *LOT)
|
||||||
{
|
{
|
||||||
int32_t left = 0;
|
int32_t left = 0;
|
||||||
int32_t right = 0;
|
int32_t right = 0;
|
||||||
|
@ -455,7 +455,7 @@ int32_t CalculateTarget(PHD_VECTOR* target, ITEM_INFO* item, LOT_INFO* LOT)
|
||||||
return TARGET_NONE;
|
return TARGET_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOX_INFO* box;
|
BOX_INFO *box;
|
||||||
int32_t prime_free = ALL_CLIP;
|
int32_t prime_free = ALL_CLIP;
|
||||||
do {
|
do {
|
||||||
box = &Boxes[box_number];
|
box = &Boxes[box_number];
|
||||||
|
@ -655,7 +655,7 @@ int32_t CalculateTarget(PHD_VECTOR* target, ITEM_INFO* item, LOT_INFO* LOT)
|
||||||
|
|
||||||
int32_t CreatureCreature(int16_t item_num)
|
int32_t CreatureCreature(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &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;
|
||||||
|
@ -686,9 +686,9 @@ int32_t CreatureCreature(int16_t item_num)
|
||||||
|
|
||||||
int32_t BadFloor(
|
int32_t 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_number, LOT_INFO* LOT)
|
int16_t room_number, LOT_INFO *LOT)
|
||||||
{
|
{
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &room_number);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &room_number);
|
||||||
if (floor->box == NO_BOX) {
|
if (floor->box == NO_BOX) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -715,12 +715,12 @@ int32_t BadFloor(
|
||||||
|
|
||||||
int32_t CreatureAnimation(int16_t item_num, int16_t angle, int16_t tilt)
|
int32_t CreatureAnimation(int16_t item_num, int16_t angle, int16_t tilt)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
CREATURE_INFO* creature = item->data;
|
CREATURE_INFO *creature = item->data;
|
||||||
if (!creature) {
|
if (!creature) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
LOT_INFO* LOT = &creature->LOT;
|
LOT_INFO *LOT = &creature->LOT;
|
||||||
|
|
||||||
PHD_VECTOR old;
|
PHD_VECTOR old;
|
||||||
old.x = item->pos.x;
|
old.x = item->pos.x;
|
||||||
|
@ -729,7 +729,7 @@ int32_t CreatureAnimation(int16_t item_num, int16_t angle, int16_t tilt)
|
||||||
|
|
||||||
int32_t box_height = Boxes[item->box_number].height;
|
int32_t box_height = Boxes[item->box_number].height;
|
||||||
|
|
||||||
int16_t* zone;
|
int16_t *zone;
|
||||||
if (LOT->fly) {
|
if (LOT->fly) {
|
||||||
zone = FlyZone[FlipStatus];
|
zone = FlyZone[FlipStatus];
|
||||||
} else if (LOT->step == STEP_L) {
|
} else if (LOT->step == STEP_L) {
|
||||||
|
@ -747,11 +747,11 @@ int32_t CreatureAnimation(int16_t item_num, int16_t angle, int16_t tilt)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t* bounds = GetBoundsAccurate(item);
|
int16_t *bounds = GetBoundsAccurate(item);
|
||||||
int32_t y = item->pos.y + bounds[FRAME_BOUND_MIN_Y];
|
int32_t y = item->pos.y + bounds[FRAME_BOUND_MIN_Y];
|
||||||
|
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(item->pos.x, y, item->pos.z, &room_num);
|
FLOOR_INFO *floor = GetFloor(item->pos.x, y, item->pos.z, &room_num);
|
||||||
int32_t height = Boxes[floor->box].height;
|
int32_t height = Boxes[floor->box].height;
|
||||||
int16_t next_box = LOT->node[floor->box].exit_box;
|
int16_t next_box = LOT->node[floor->box].exit_box;
|
||||||
int32_t next_height;
|
int32_t next_height;
|
||||||
|
@ -973,9 +973,9 @@ int32_t CreatureAnimation(int16_t item_num, int16_t angle, int16_t tilt)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t CreatureTurn(ITEM_INFO* item, int16_t maximum_turn)
|
int16_t CreatureTurn(ITEM_INFO *item, int16_t maximum_turn)
|
||||||
{
|
{
|
||||||
CREATURE_INFO* creature = item->data;
|
CREATURE_INFO *creature = item->data;
|
||||||
if (!creature) {
|
if (!creature) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1006,7 +1006,7 @@ int16_t CreatureTurn(ITEM_INFO* item, int16_t maximum_turn)
|
||||||
return angle;
|
return angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureTilt(ITEM_INFO* item, int16_t angle)
|
void CreatureTilt(ITEM_INFO *item, int16_t angle)
|
||||||
{
|
{
|
||||||
angle = angle * 4 - item->pos.z_rot;
|
angle = angle * 4 - item->pos.z_rot;
|
||||||
if (angle < -MAX_TILT) {
|
if (angle < -MAX_TILT) {
|
||||||
|
@ -1017,9 +1017,9 @@ void CreatureTilt(ITEM_INFO* item, int16_t angle)
|
||||||
item->pos.z_rot += angle;
|
item->pos.z_rot += angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureHead(ITEM_INFO* item, int16_t required)
|
void CreatureHead(ITEM_INFO *item, int16_t required)
|
||||||
{
|
{
|
||||||
CREATURE_INFO* creature = item->data;
|
CREATURE_INFO *creature = item->data;
|
||||||
if (!creature) {
|
if (!creature) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1041,7 +1041,7 @@ void CreatureHead(ITEM_INFO* item, int16_t required)
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t CreatureEffect(
|
int16_t CreatureEffect(
|
||||||
ITEM_INFO* item, BITE_INFO* bite,
|
ITEM_INFO *item, BITE_INFO *bite,
|
||||||
int16_t (*generate)(
|
int16_t (*generate)(
|
||||||
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))
|
||||||
|
|
|
@ -5,25 +5,25 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void InitialiseCreature(int16_t item_num);
|
void InitialiseCreature(int16_t item_num);
|
||||||
void CreatureAIInfo(ITEM_INFO* item, AI_INFO* info);
|
void CreatureAIInfo(ITEM_INFO *item, AI_INFO *info);
|
||||||
int32_t SearchLOT(LOT_INFO* LOT, int32_t expansion);
|
int32_t SearchLOT(LOT_INFO *LOT, int32_t expansion);
|
||||||
int32_t UpdateLOT(LOT_INFO* LOT, int32_t expansion);
|
int32_t UpdateLOT(LOT_INFO *LOT, int32_t expansion);
|
||||||
void TargetBox(LOT_INFO* LOT, int16_t box_number);
|
void TargetBox(LOT_INFO *LOT, int16_t box_number);
|
||||||
int32_t StalkBox(ITEM_INFO* item, int16_t box_number);
|
int32_t StalkBox(ITEM_INFO *item, int16_t box_number);
|
||||||
int32_t EscapeBox(ITEM_INFO* item, int16_t box_number);
|
int32_t EscapeBox(ITEM_INFO *item, int16_t box_number);
|
||||||
int32_t ValidBox(ITEM_INFO* item, int16_t zone_number, int16_t box_number);
|
int32_t ValidBox(ITEM_INFO *item, int16_t zone_number, int16_t box_number);
|
||||||
void CreatureMood(ITEM_INFO* item, AI_INFO* info, int32_t violent);
|
void CreatureMood(ITEM_INFO *item, AI_INFO *info, int32_t violent);
|
||||||
int32_t CalculateTarget(PHD_VECTOR* target, ITEM_INFO* item, LOT_INFO* LOT);
|
int32_t CalculateTarget(PHD_VECTOR *target, ITEM_INFO *item, LOT_INFO *LOT);
|
||||||
int32_t CreatureCreature(int16_t item_num);
|
int32_t CreatureCreature(int16_t item_num);
|
||||||
int32_t BadFloor(
|
int32_t 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_number, LOT_INFO* LOT);
|
int16_t room_number, LOT_INFO *LOT);
|
||||||
int32_t CreatureAnimation(int16_t item_num, int16_t angle, int16_t tilt);
|
int32_t CreatureAnimation(int16_t item_num, int16_t angle, int16_t tilt);
|
||||||
int16_t CreatureTurn(ITEM_INFO* item, int16_t maximum_turn);
|
int16_t CreatureTurn(ITEM_INFO *item, int16_t maximum_turn);
|
||||||
void CreatureTilt(ITEM_INFO* item, int16_t angle);
|
void CreatureTilt(ITEM_INFO *item, int16_t angle);
|
||||||
void CreatureHead(ITEM_INFO* item, int16_t required);
|
void CreatureHead(ITEM_INFO *item, int16_t required);
|
||||||
int16_t CreatureEffect(
|
int16_t CreatureEffect(
|
||||||
ITEM_INFO* item, BITE_INFO* bite,
|
ITEM_INFO *item, BITE_INFO *bite,
|
||||||
int16_t (*generate)(
|
int16_t (*generate)(
|
||||||
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));
|
||||||
|
|
|
@ -37,7 +37,7 @@ void InitialiseCamera()
|
||||||
CalculateCamera();
|
CalculateCamera();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveCamera(GAME_VECTOR* ideal, int32_t speed)
|
void MoveCamera(GAME_VECTOR *ideal, int32_t speed)
|
||||||
{
|
{
|
||||||
Camera.pos.x += (ideal->x - Camera.pos.x) / speed;
|
Camera.pos.x += (ideal->x - Camera.pos.x) / speed;
|
||||||
Camera.pos.z += (ideal->z - Camera.pos.z) / speed;
|
Camera.pos.z += (ideal->z - Camera.pos.z) / speed;
|
||||||
|
@ -46,7 +46,7 @@ void MoveCamera(GAME_VECTOR* ideal, int32_t speed)
|
||||||
|
|
||||||
ChunkyFlag = 0;
|
ChunkyFlag = 0;
|
||||||
|
|
||||||
FLOOR_INFO* floor = GetFloor(
|
FLOOR_INFO *floor = GetFloor(
|
||||||
Camera.pos.x, Camera.pos.y, Camera.pos.z, &Camera.pos.room_number);
|
Camera.pos.x, Camera.pos.y, Camera.pos.z, &Camera.pos.room_number);
|
||||||
int32_t height = GetHeight(floor, Camera.pos.x, Camera.pos.y, Camera.pos.z)
|
int32_t height = GetHeight(floor, Camera.pos.x, Camera.pos.y, Camera.pos.z)
|
||||||
- GROUND_SHIFT;
|
- GROUND_SHIFT;
|
||||||
|
@ -108,7 +108,7 @@ void MoveCamera(GAME_VECTOR* ideal, int32_t speed)
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClipCamera(
|
void ClipCamera(
|
||||||
int32_t* x, int32_t* y, int32_t target_x, int32_t target_y, int32_t left,
|
int32_t *x, int32_t *y, int32_t target_x, int32_t target_y, int32_t left,
|
||||||
int32_t top, int32_t right, int32_t bottom)
|
int32_t top, int32_t right, int32_t bottom)
|
||||||
{
|
{
|
||||||
if ((right > left) != (target_x < left)) {
|
if ((right > left) != (target_x < left)) {
|
||||||
|
@ -124,7 +124,7 @@ void ClipCamera(
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShiftCamera(
|
void ShiftCamera(
|
||||||
int32_t* x, int32_t* y, int32_t target_x, int32_t target_y, int32_t left,
|
int32_t *x, int32_t *y, int32_t target_x, int32_t target_y, int32_t left,
|
||||||
int32_t top, int32_t right, int32_t bottom)
|
int32_t top, int32_t right, int32_t bottom)
|
||||||
{
|
{
|
||||||
int32_t shift;
|
int32_t shift;
|
||||||
|
@ -174,7 +174,7 @@ void ShiftCamera(
|
||||||
|
|
||||||
int32_t BadPosition(int32_t x, int32_t y, int32_t z, int16_t room_num)
|
int32_t BadPosition(int32_t x, int32_t y, int32_t z, int16_t room_num)
|
||||||
{
|
{
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &room_num);
|
||||||
if (y >= GetHeight(floor, x, y, z) || y <= GetCeiling(floor, x, y, z)) {
|
if (y >= GetHeight(floor, x, y, z) || y <= GetCeiling(floor, x, y, z)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -182,19 +182,19 @@ int32_t BadPosition(int32_t x, int32_t y, int32_t z, int16_t room_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
void SmartShift(
|
void SmartShift(
|
||||||
GAME_VECTOR* ideal,
|
GAME_VECTOR *ideal,
|
||||||
void (*shift)(
|
void (*shift)(
|
||||||
int32_t* x, int32_t* y, int32_t target_x, int32_t target_y,
|
int32_t *x, int32_t *y, int32_t target_x, int32_t target_y,
|
||||||
int32_t left, int32_t top, int32_t right, int32_t bottom))
|
int32_t left, int32_t top, int32_t right, int32_t bottom))
|
||||||
{
|
{
|
||||||
LOS(&Camera.target, ideal);
|
LOS(&Camera.target, ideal);
|
||||||
|
|
||||||
ROOM_INFO* r = &RoomInfo[Camera.target.room_number];
|
ROOM_INFO *r = &RoomInfo[Camera.target.room_number];
|
||||||
int32_t x_floor = (Camera.target.z - r->z) >> WALL_SHIFT;
|
int32_t x_floor = (Camera.target.z - r->z) >> WALL_SHIFT;
|
||||||
int32_t y_floor = (Camera.target.x - r->x) >> WALL_SHIFT;
|
int32_t y_floor = (Camera.target.x - r->x) >> WALL_SHIFT;
|
||||||
|
|
||||||
int16_t item_box = r->floor[x_floor + y_floor * r->x_size].box;
|
int16_t item_box = r->floor[x_floor + y_floor * r->x_size].box;
|
||||||
BOX_INFO* box = &Boxes[item_box];
|
BOX_INFO *box = &Boxes[item_box];
|
||||||
|
|
||||||
r = &RoomInfo[ideal->room_number];
|
r = &RoomInfo[ideal->room_number];
|
||||||
x_floor = (ideal->z - r->z) >> WALL_SHIFT;
|
x_floor = (ideal->z - r->z) >> WALL_SHIFT;
|
||||||
|
@ -312,7 +312,7 @@ void SmartShift(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChaseCamera(ITEM_INFO* item)
|
void ChaseCamera(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
GAME_VECTOR ideal;
|
GAME_VECTOR ideal;
|
||||||
|
|
||||||
|
@ -345,15 +345,15 @@ void ChaseCamera(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ShiftClamp(GAME_VECTOR* pos, int32_t clamp)
|
int32_t ShiftClamp(GAME_VECTOR *pos, int32_t clamp)
|
||||||
{
|
{
|
||||||
int32_t x = pos->x;
|
int32_t x = pos->x;
|
||||||
int32_t y = pos->y;
|
int32_t y = pos->y;
|
||||||
int32_t z = pos->z;
|
int32_t z = pos->z;
|
||||||
|
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &pos->room_number);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &pos->room_number);
|
||||||
|
|
||||||
BOX_INFO* box = &Boxes[floor->box];
|
BOX_INFO *box = &Boxes[floor->box];
|
||||||
if (z < box->left + clamp
|
if (z < box->left + clamp
|
||||||
&& BadPosition(x, y, z - clamp, pos->room_number)) {
|
&& BadPosition(x, y, z - clamp, pos->room_number)) {
|
||||||
pos->z = box->left + clamp;
|
pos->z = box->left + clamp;
|
||||||
|
@ -389,7 +389,7 @@ int32_t ShiftClamp(GAME_VECTOR* pos, int32_t clamp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CombatCamera(ITEM_INFO* item)
|
void CombatCamera(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
GAME_VECTOR ideal;
|
GAME_VECTOR ideal;
|
||||||
|
|
||||||
|
@ -424,7 +424,7 @@ void CombatCamera(ITEM_INFO* item)
|
||||||
MoveCamera(&ideal, Camera.speed);
|
MoveCamera(&ideal, Camera.speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LookCamera(ITEM_INFO* item)
|
void LookCamera(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
GAME_VECTOR old;
|
GAME_VECTOR old;
|
||||||
GAME_VECTOR ideal;
|
GAME_VECTOR ideal;
|
||||||
|
@ -476,7 +476,7 @@ void LookCamera(ITEM_INFO* item)
|
||||||
void FixedCamera()
|
void FixedCamera()
|
||||||
{
|
{
|
||||||
GAME_VECTOR ideal;
|
GAME_VECTOR ideal;
|
||||||
OBJECT_VECTOR* fixed;
|
OBJECT_VECTOR *fixed;
|
||||||
|
|
||||||
fixed = &Camera.fixed[Camera.number];
|
fixed = &Camera.fixed[Camera.number];
|
||||||
ideal.x = fixed->x;
|
ideal.x = fixed->x;
|
||||||
|
@ -527,9 +527,9 @@ void CalculateCamera()
|
||||||
|
|
||||||
int32_t fixed_camera =
|
int32_t fixed_camera =
|
||||||
Camera.item && (Camera.type == CAM_FIXED || Camera.type == CAM_HEAVY);
|
Camera.item && (Camera.type == CAM_FIXED || Camera.type == CAM_HEAVY);
|
||||||
ITEM_INFO* item = fixed_camera ? Camera.item : LaraItem;
|
ITEM_INFO *item = fixed_camera ? Camera.item : LaraItem;
|
||||||
|
|
||||||
int16_t* bounds = GetBoundsAccurate(item);
|
int16_t *bounds = GetBoundsAccurate(item);
|
||||||
|
|
||||||
int32_t y = item->pos.y;
|
int32_t y = item->pos.y;
|
||||||
if (!fixed_camera) {
|
if (!fixed_camera) {
|
||||||
|
@ -627,7 +627,7 @@ void CalculateCamera()
|
||||||
Camera.fixed_camera = 0;
|
Camera.fixed_camera = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FLOOR_INFO* floor = GetFloor(
|
FLOOR_INFO *floor = GetFloor(
|
||||||
Camera.target.x, Camera.target.y, Camera.target.z,
|
Camera.target.x, Camera.target.y, Camera.target.z,
|
||||||
&Camera.target.room_number);
|
&Camera.target.room_number);
|
||||||
if (Camera.target.y > GetHeight(
|
if (Camera.target.y > GetHeight(
|
||||||
|
|
|
@ -5,23 +5,23 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void InitialiseCamera();
|
void InitialiseCamera();
|
||||||
void MoveCamera(GAME_VECTOR* ideal, int32_t speed);
|
void MoveCamera(GAME_VECTOR *ideal, int32_t speed);
|
||||||
void ClipCamera(
|
void ClipCamera(
|
||||||
int32_t* x, int32_t* y, int32_t target_x, int32_t target_y, int32_t left,
|
int32_t *x, int32_t *y, int32_t target_x, int32_t target_y, int32_t left,
|
||||||
int32_t top, int32_t right, int32_t bottom);
|
int32_t top, int32_t right, int32_t bottom);
|
||||||
void ShiftCamera(
|
void ShiftCamera(
|
||||||
int32_t* x, int32_t* y, int32_t target_x, int32_t target_y, int32_t left,
|
int32_t *x, int32_t *y, int32_t target_x, int32_t target_y, int32_t left,
|
||||||
int32_t top, int32_t right, int32_t bottom);
|
int32_t top, int32_t right, int32_t bottom);
|
||||||
int32_t BadPosition(int32_t x, int32_t y, int32_t z, int16_t room_num);
|
int32_t BadPosition(int32_t x, int32_t y, int32_t z, int16_t room_num);
|
||||||
void SmartShift(
|
void SmartShift(
|
||||||
GAME_VECTOR* ideal,
|
GAME_VECTOR *ideal,
|
||||||
void (*shift)(
|
void (*shift)(
|
||||||
int32_t* x, int32_t* y, int32_t target_x, int32_t target_y,
|
int32_t *x, int32_t *y, int32_t target_x, int32_t target_y,
|
||||||
int32_t left, int32_t top, int32_t right, int32_t bottom));
|
int32_t left, int32_t top, int32_t right, int32_t bottom));
|
||||||
void ChaseCamera(ITEM_INFO* item);
|
void ChaseCamera(ITEM_INFO *item);
|
||||||
int32_t ShiftClamp(GAME_VECTOR* pos, int32_t clamp);
|
int32_t ShiftClamp(GAME_VECTOR *pos, int32_t clamp);
|
||||||
void CombatCamera(ITEM_INFO* item);
|
void CombatCamera(ITEM_INFO *item);
|
||||||
void LookCamera(ITEM_INFO* item);
|
void LookCamera(ITEM_INFO *item);
|
||||||
void FixedCamera();
|
void FixedCamera();
|
||||||
void CalculateCamera();
|
void CalculateCamera();
|
||||||
|
|
||||||
|
|
|
@ -95,8 +95,8 @@ int32_t DoCinematic(int32_t nframes)
|
||||||
|
|
||||||
int16_t item_num = NextItemActive;
|
int16_t item_num = NextItemActive;
|
||||||
while (item_num != NO_ITEM) {
|
while (item_num != NO_ITEM) {
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
OBJECT_INFO* object = &Objects[item->object_number];
|
OBJECT_INFO *object = &Objects[item->object_number];
|
||||||
int16_t next_item_num = item->next_active;
|
int16_t next_item_num = item->next_active;
|
||||||
|
|
||||||
if (object->control) {
|
if (object->control) {
|
||||||
|
@ -108,8 +108,8 @@ int32_t DoCinematic(int32_t nframes)
|
||||||
|
|
||||||
int16_t fx_num = NextFxActive;
|
int16_t fx_num = NextFxActive;
|
||||||
while (fx_num != NO_ITEM) {
|
while (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
OBJECT_INFO* object = &Objects[fx->object_number];
|
OBJECT_INFO *object = &Objects[fx->object_number];
|
||||||
int16_t next_fx_num = fx->next_active;
|
int16_t next_fx_num = fx->next_active;
|
||||||
|
|
||||||
if (object->control) {
|
if (object->control) {
|
||||||
|
@ -137,7 +137,7 @@ void CalculateCinematicCamera()
|
||||||
PHD_VECTOR campos;
|
PHD_VECTOR campos;
|
||||||
PHD_VECTOR camtar;
|
PHD_VECTOR camtar;
|
||||||
|
|
||||||
int16_t* ptr = &Cine[8 * CineFrame];
|
int16_t *ptr = &Cine[8 * CineFrame];
|
||||||
int32_t tx = ptr[0];
|
int32_t tx = ptr[0];
|
||||||
int32_t ty = ptr[1];
|
int32_t ty = ptr[1];
|
||||||
int32_t tz = ptr[2];
|
int32_t tz = ptr[2];
|
||||||
|
@ -166,7 +166,7 @@ void InitialisePlayer1(int16_t item_num)
|
||||||
{
|
{
|
||||||
AddActiveItem(item_num);
|
AddActiveItem(item_num);
|
||||||
|
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
Camera.pos.room_number = item->room_number;
|
Camera.pos.room_number = item->room_number;
|
||||||
Camera.pos.x = item->pos.x;
|
Camera.pos.x = item->pos.x;
|
||||||
Camera.pos.y = item->pos.y;
|
Camera.pos.y = item->pos.y;
|
||||||
|
@ -175,7 +175,7 @@ void InitialisePlayer1(int16_t item_num)
|
||||||
item->pos.y_rot = 0;
|
item->pos.y_rot = 0;
|
||||||
|
|
||||||
if (CinematicLevel == LV_CUTSCENE2 || CinematicLevel == LV_CUTSCENE4) {
|
if (CinematicLevel == LV_CUTSCENE2 || CinematicLevel == LV_CUTSCENE4) {
|
||||||
int16_t* temp;
|
int16_t *temp;
|
||||||
|
|
||||||
temp = Meshes[Objects[O_PLAYER_1].mesh_index + LM_THIGH_L];
|
temp = Meshes[Objects[O_PLAYER_1].mesh_index + LM_THIGH_L];
|
||||||
Meshes[Objects[O_PLAYER_1].mesh_index + LM_THIGH_L] =
|
Meshes[Objects[O_PLAYER_1].mesh_index + LM_THIGH_L] =
|
||||||
|
@ -191,7 +191,7 @@ void InitialisePlayer1(int16_t item_num)
|
||||||
|
|
||||||
void ControlCinematicPlayer(int16_t item_num)
|
void ControlCinematicPlayer(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
item->pos.y_rot = Camera.target_angle;
|
item->pos.y_rot = Camera.target_angle;
|
||||||
item->pos.x = Camera.pos.x;
|
item->pos.x = Camera.pos.x;
|
||||||
item->pos.y = Camera.pos.y;
|
item->pos.y = Camera.pos.y;
|
||||||
|
@ -217,7 +217,7 @@ void InGameCinematicCamera()
|
||||||
CineFrame = NumCineFrames - 1;
|
CineFrame = NumCineFrames - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t* ptr = &Cine[8 * CineFrame];
|
int16_t *ptr = &Cine[8 * CineFrame];
|
||||||
int32_t tx = ptr[0];
|
int32_t tx = ptr[0];
|
||||||
int32_t ty = ptr[1];
|
int32_t ty = ptr[1];
|
||||||
int32_t tz = ptr[2];
|
int32_t tz = ptr[2];
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
void GetCollisionInfo(
|
void GetCollisionInfo(
|
||||||
COLL_INFO* coll, int32_t xpos, int32_t ypos, int32_t zpos, int16_t room_num,
|
COLL_INFO *coll, int32_t xpos, int32_t ypos, int32_t zpos, int16_t room_num,
|
||||||
int32_t objheight)
|
int32_t objheight)
|
||||||
{
|
{
|
||||||
coll->coll_type = COLL_NONE;
|
coll->coll_type = COLL_NONE;
|
||||||
|
@ -25,7 +25,7 @@ void GetCollisionInfo(
|
||||||
int32_t z = zpos;
|
int32_t z = zpos;
|
||||||
int32_t ytop = y - 160;
|
int32_t ytop = y - 160;
|
||||||
|
|
||||||
FLOOR_INFO* floor = GetFloor(x, ytop, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, ytop, z, &room_num);
|
||||||
int32_t height = GetHeight(floor, x, ytop, z);
|
int32_t height = GetHeight(floor, x, ytop, z);
|
||||||
if (height != NO_HEIGHT) {
|
if (height != NO_HEIGHT) {
|
||||||
height -= ypos;
|
height -= ypos;
|
||||||
|
@ -289,7 +289,7 @@ int32_t FindGridShift(int32_t src, int32_t dst)
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CollideStaticObjects(
|
int32_t CollideStaticObjects(
|
||||||
COLL_INFO* coll, int32_t x, int32_t y, int32_t z, int16_t room_number,
|
COLL_INFO *coll, int32_t x, int32_t y, int32_t z, int16_t room_number,
|
||||||
int32_t hite)
|
int32_t hite)
|
||||||
{
|
{
|
||||||
PHD_VECTOR shifter;
|
PHD_VECTOR shifter;
|
||||||
|
@ -309,11 +309,11 @@ int32_t CollideStaticObjects(
|
||||||
GetNearByRooms(x, y, z, coll->radius + 50, hite + 50, room_number);
|
GetNearByRooms(x, y, z, coll->radius + 50, hite + 50, room_number);
|
||||||
|
|
||||||
for (int i = 0; i < RoomsToDrawNum; i++) {
|
for (int i = 0; i < RoomsToDrawNum; i++) {
|
||||||
ROOM_INFO* r = &RoomInfo[RoomsToDraw[i]];
|
ROOM_INFO *r = &RoomInfo[RoomsToDraw[i]];
|
||||||
MESH_INFO* mesh = r->mesh;
|
MESH_INFO *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 = &StaticObjects[mesh->static_number];
|
STATIC_INFO *sinfo = &StaticObjects[mesh->static_number];
|
||||||
if (sinfo->flags & 1) {
|
if (sinfo->flags & 1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -485,7 +485,7 @@ void GetNewRoom(int32_t x, int32_t y, int32_t z, int16_t room_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShiftItem(ITEM_INFO* item, COLL_INFO* coll)
|
void ShiftItem(ITEM_INFO *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;
|
||||||
|
@ -495,22 +495,22 @@ void ShiftItem(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
coll->shift.z = 0;
|
coll->shift.z = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateLaraRoom(ITEM_INFO* item, int32_t height)
|
void UpdateLaraRoom(ITEM_INFO *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_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &room_num);
|
||||||
item->floor = GetHeight(floor, x, y, z);
|
item->floor = GetHeight(floor, x, y, z);
|
||||||
if (item->room_number != room_num) {
|
if (item->room_number != room_num) {
|
||||||
ItemNewRoom(Lara.item_number, room_num);
|
ItemNewRoom(Lara.item_number, room_num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t GetTiltType(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z)
|
int16_t GetTiltType(FLOOR_INFO *floor, int32_t x, int32_t y, int32_t z)
|
||||||
{
|
{
|
||||||
ROOM_INFO* r;
|
ROOM_INFO *r;
|
||||||
|
|
||||||
while (floor->pit_room != NO_ROOM) {
|
while (floor->pit_room != NO_ROOM) {
|
||||||
r = &RoomInfo[floor->pit_room];
|
r = &RoomInfo[floor->pit_room];
|
||||||
|
@ -524,7 +524,7 @@ int16_t GetTiltType(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (floor->index) {
|
if (floor->index) {
|
||||||
int16_t* data = &FloorData[floor->index];
|
int16_t *data = &FloorData[floor->index];
|
||||||
if ((data[0] & DATA_TYPE) == FT_TILT) {
|
if ((data[0] & DATA_TYPE) == FT_TILT) {
|
||||||
return data[1];
|
return data[1];
|
||||||
}
|
}
|
||||||
|
@ -533,7 +533,7 @@ int16_t GetTiltType(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraBaddieCollision(ITEM_INFO* lara_item, COLL_INFO* coll)
|
void LaraBaddieCollision(ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
lara_item->hit_status = 0;
|
lara_item->hit_status = 0;
|
||||||
Lara.hit_direction = -1;
|
Lara.hit_direction = -1;
|
||||||
|
@ -546,7 +546,7 @@ void LaraBaddieCollision(ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
|
|
||||||
roomies[numroom++] = lara_item->room_number;
|
roomies[numroom++] = lara_item->room_number;
|
||||||
|
|
||||||
DOOR_INFOS* door = RoomInfo[lara_item->room_number].doors;
|
DOOR_INFOS *door = RoomInfo[lara_item->room_number].doors;
|
||||||
if (door) {
|
if (door) {
|
||||||
for (int i = 0; i < door->count; i++) {
|
for (int i = 0; i < door->count; i++) {
|
||||||
// NOTE: this access violation check was not present in the original
|
// NOTE: this access violation check was not present in the original
|
||||||
|
@ -561,9 +561,9 @@ void LaraBaddieCollision(ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
for (int i = 0; i < numroom; i++) {
|
for (int i = 0; i < numroom; i++) {
|
||||||
int16_t item_num = RoomInfo[roomies[i]].item_number;
|
int16_t item_num = RoomInfo[roomies[i]].item_number;
|
||||||
while (item_num != NO_ITEM) {
|
while (item_num != NO_ITEM) {
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (item->collidable && item->status != IS_INVISIBLE) {
|
if (item->collidable && item->status != IS_INVISIBLE) {
|
||||||
OBJECT_INFO* object = &Objects[item->object_number];
|
OBJECT_INFO *object = &Objects[item->object_number];
|
||||||
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;
|
||||||
|
@ -590,7 +590,7 @@ void LaraBaddieCollision(ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
InventoryChosen = -1;
|
InventoryChosen = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EffectSpaz(ITEM_INFO* lara_item, COLL_INFO* coll)
|
void EffectSpaz(ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
int32_t x = Lara.spaz_effect->pos.x - lara_item->pos.x;
|
int32_t x = Lara.spaz_effect->pos.x - lara_item->pos.x;
|
||||||
int32_t z = Lara.spaz_effect->pos.z - lara_item->pos.z;
|
int32_t z = Lara.spaz_effect->pos.z - lara_item->pos.z;
|
||||||
|
@ -608,9 +608,9 @@ void EffectSpaz(ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
Lara.spaz_effect_count--;
|
Lara.spaz_effect_count--;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void CreatureCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
||||||
return;
|
return;
|
||||||
|
@ -628,9 +628,9 @@ void CreatureCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void ObjectCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
||||||
return;
|
return;
|
||||||
|
@ -644,9 +644,9 @@ void ObjectCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoorCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void DoorCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
||||||
return;
|
return;
|
||||||
|
@ -664,9 +664,9 @@ void DoorCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrapCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void TrapCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_ACTIVE) {
|
if (item->status == IS_ACTIVE) {
|
||||||
if (TestBoundsCollide(item, lara_item, coll->radius)) {
|
if (TestBoundsCollide(item, lara_item, coll->radius)) {
|
||||||
|
@ -678,7 +678,7 @@ void TrapCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
|
|
||||||
void ItemPushLara(
|
void ItemPushLara(
|
||||||
ITEM_INFO* item, ITEM_INFO* lara_item, COLL_INFO* coll, int32_t spazon,
|
ITEM_INFO *item, ITEM_INFO *lara_item, COLL_INFO *coll, int32_t spazon,
|
||||||
int32_t bigpush)
|
int32_t bigpush)
|
||||||
{
|
{
|
||||||
int32_t x = lara_item->pos.x - item->pos.x;
|
int32_t x = lara_item->pos.x - item->pos.x;
|
||||||
|
@ -688,7 +688,7 @@ void ItemPushLara(
|
||||||
int32_t rx = (c * x - s * z) >> W2V_SHIFT;
|
int32_t rx = (c * x - s * z) >> W2V_SHIFT;
|
||||||
int32_t rz = (c * z + s * x) >> W2V_SHIFT;
|
int32_t rz = (c * z + s * x) >> W2V_SHIFT;
|
||||||
|
|
||||||
int16_t* bounds = GetBestFrame(item);
|
int16_t *bounds = GetBestFrame(item);
|
||||||
int32_t minx = bounds[FRAME_BOUND_MIN_X];
|
int32_t minx = bounds[FRAME_BOUND_MIN_X];
|
||||||
int32_t maxx = bounds[FRAME_BOUND_MAX_X];
|
int32_t maxx = bounds[FRAME_BOUND_MAX_X];
|
||||||
int32_t minz = bounds[FRAME_BOUND_MIN_Z];
|
int32_t minz = bounds[FRAME_BOUND_MIN_Z];
|
||||||
|
@ -766,10 +766,10 @@ void ItemPushLara(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t TestBoundsCollide(ITEM_INFO* item, ITEM_INFO* lara_item, int32_t radius)
|
int32_t TestBoundsCollide(ITEM_INFO *item, ITEM_INFO *lara_item, int32_t radius)
|
||||||
{
|
{
|
||||||
int16_t* bounds = GetBestFrame(item);
|
int16_t *bounds = GetBestFrame(item);
|
||||||
int16_t* larabounds = GetBestFrame(lara_item);
|
int16_t *larabounds = GetBestFrame(lara_item);
|
||||||
if (item->pos.y + bounds[FRAME_BOUND_MAX_Y]
|
if (item->pos.y + bounds[FRAME_BOUND_MAX_Y]
|
||||||
<= lara_item->pos.y + larabounds[FRAME_BOUND_MIN_Y]
|
<= lara_item->pos.y + larabounds[FRAME_BOUND_MIN_Y]
|
||||||
|| item->pos.y + bounds[FRAME_BOUND_MIN_Y]
|
|| item->pos.y + bounds[FRAME_BOUND_MIN_Y]
|
||||||
|
@ -794,7 +794,7 @@ int32_t TestBoundsCollide(ITEM_INFO* item, ITEM_INFO* lara_item, int32_t radius)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t TestLaraPosition(int16_t* bounds, ITEM_INFO* item, ITEM_INFO* lara_item)
|
int32_t TestLaraPosition(int16_t *bounds, ITEM_INFO *item, ITEM_INFO *lara_item)
|
||||||
{
|
{
|
||||||
PHD_ANGLE xrotrel = lara_item->pos.x_rot - item->pos.x_rot;
|
PHD_ANGLE xrotrel = lara_item->pos.x_rot - item->pos.x_rot;
|
||||||
PHD_ANGLE yrotrel = lara_item->pos.y_rot - item->pos.y_rot;
|
PHD_ANGLE yrotrel = lara_item->pos.y_rot - item->pos.y_rot;
|
||||||
|
@ -814,7 +814,7 @@ int32_t TestLaraPosition(int16_t* bounds, ITEM_INFO* item, ITEM_INFO* lara_item)
|
||||||
int32_t z = lara_item->pos.z - item->pos.z;
|
int32_t z = lara_item->pos.z - item->pos.z;
|
||||||
phd_PushUnitMatrix();
|
phd_PushUnitMatrix();
|
||||||
phd_RotYXZ(item->pos.y_rot, item->pos.x_rot, item->pos.z_rot);
|
phd_RotYXZ(item->pos.y_rot, item->pos.x_rot, item->pos.z_rot);
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
int32_t rx = (mptr->_00 * x + mptr->_10 * y + mptr->_20 * z) >> W2V_SHIFT;
|
int32_t rx = (mptr->_00 * x + mptr->_10 * y + mptr->_20 * z) >> W2V_SHIFT;
|
||||||
int32_t ry = (mptr->_01 * x + mptr->_11 * y + mptr->_21 * z) >> W2V_SHIFT;
|
int32_t ry = (mptr->_01 * x + mptr->_11 * y + mptr->_21 * z) >> W2V_SHIFT;
|
||||||
int32_t rz = (mptr->_02 * x + mptr->_12 * y + mptr->_22 * z) >> W2V_SHIFT;
|
int32_t rz = (mptr->_02 * x + mptr->_12 * y + mptr->_22 * z) >> W2V_SHIFT;
|
||||||
|
@ -832,7 +832,7 @@ int32_t TestLaraPosition(int16_t* bounds, ITEM_INFO* item, ITEM_INFO* lara_item)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlignLaraPosition(PHD_VECTOR* vec, ITEM_INFO* item, ITEM_INFO* lara_item)
|
void AlignLaraPosition(PHD_VECTOR *vec, ITEM_INFO *item, ITEM_INFO *lara_item)
|
||||||
{
|
{
|
||||||
lara_item->pos.x_rot = item->pos.x_rot;
|
lara_item->pos.x_rot = item->pos.x_rot;
|
||||||
lara_item->pos.y_rot = item->pos.y_rot;
|
lara_item->pos.y_rot = item->pos.y_rot;
|
||||||
|
@ -840,7 +840,7 @@ void AlignLaraPosition(PHD_VECTOR* vec, ITEM_INFO* item, ITEM_INFO* lara_item)
|
||||||
|
|
||||||
phd_PushUnitMatrix();
|
phd_PushUnitMatrix();
|
||||||
phd_RotYXZ(item->pos.y_rot, item->pos.x_rot, item->pos.z_rot);
|
phd_RotYXZ(item->pos.y_rot, item->pos.x_rot, item->pos.z_rot);
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
lara_item->pos.x = item->pos.x
|
lara_item->pos.x = item->pos.x
|
||||||
+ ((mptr->_00 * vec->x + mptr->_01 * vec->y + mptr->_02 * vec->z)
|
+ ((mptr->_00 * vec->x + mptr->_01 * vec->y + mptr->_02 * vec->z)
|
||||||
>> W2V_SHIFT);
|
>> W2V_SHIFT);
|
||||||
|
@ -853,7 +853,7 @@ void AlignLaraPosition(PHD_VECTOR* vec, ITEM_INFO* item, ITEM_INFO* lara_item)
|
||||||
phd_PopMatrix();
|
phd_PopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t MoveLaraPosition(PHD_VECTOR* vec, ITEM_INFO* item, ITEM_INFO* lara_item)
|
int32_t MoveLaraPosition(PHD_VECTOR *vec, ITEM_INFO *item, ITEM_INFO *lara_item)
|
||||||
{
|
{
|
||||||
PHD_3DPOS dest;
|
PHD_3DPOS dest;
|
||||||
dest.x_rot = item->pos.x_rot;
|
dest.x_rot = item->pos.x_rot;
|
||||||
|
@ -861,7 +861,7 @@ int32_t MoveLaraPosition(PHD_VECTOR* vec, ITEM_INFO* item, ITEM_INFO* lara_item)
|
||||||
dest.z_rot = item->pos.z_rot;
|
dest.z_rot = item->pos.z_rot;
|
||||||
phd_PushUnitMatrix();
|
phd_PushUnitMatrix();
|
||||||
phd_RotYXZ(item->pos.y_rot, item->pos.x_rot, item->pos.z_rot);
|
phd_RotYXZ(item->pos.y_rot, item->pos.x_rot, item->pos.z_rot);
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
dest.x = item->pos.x
|
dest.x = item->pos.x
|
||||||
+ ((mptr->_00 * vec->x + mptr->_01 * vec->y + mptr->_02 * vec->z)
|
+ ((mptr->_00 * vec->x + mptr->_01 * vec->y + mptr->_02 * vec->z)
|
||||||
>> W2V_SHIFT);
|
>> W2V_SHIFT);
|
||||||
|
@ -876,7 +876,7 @@ int32_t MoveLaraPosition(PHD_VECTOR* vec, ITEM_INFO* item, ITEM_INFO* lara_item)
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Move3DPosTo3DPos(
|
int32_t Move3DPosTo3DPos(
|
||||||
PHD_3DPOS* srcpos, PHD_3DPOS* destpos, int32_t velocity, PHD_ANGLE angadd)
|
PHD_3DPOS *srcpos, PHD_3DPOS *destpos, int32_t velocity, PHD_ANGLE angadd)
|
||||||
{
|
{
|
||||||
PHD_ANGLE angdif;
|
PHD_ANGLE angdif;
|
||||||
|
|
||||||
|
|
|
@ -5,36 +5,36 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void GetCollisionInfo(
|
void GetCollisionInfo(
|
||||||
COLL_INFO* coll, int32_t xpos, int32_t ypos, int32_t zpos, int16_t room_num,
|
COLL_INFO *coll, int32_t xpos, int32_t ypos, int32_t zpos, int16_t room_num,
|
||||||
int32_t objheight);
|
int32_t objheight);
|
||||||
int32_t FindGridShift(int32_t src, int32_t dst);
|
int32_t FindGridShift(int32_t src, int32_t dst);
|
||||||
int32_t CollideStaticObjects(
|
int32_t CollideStaticObjects(
|
||||||
COLL_INFO* coll, int32_t x, int32_t y, int32_t z, int16_t room_number,
|
COLL_INFO *coll, int32_t x, int32_t y, int32_t z, int16_t room_number,
|
||||||
int32_t hite);
|
int32_t hite);
|
||||||
void GetNearByRooms(
|
void GetNearByRooms(
|
||||||
int32_t x, int32_t y, int32_t z, int32_t r, int32_t h, int16_t room_num);
|
int32_t x, int32_t y, int32_t z, int32_t r, int32_t h, int16_t room_num);
|
||||||
void GetNewRoom(int32_t x, int32_t y, int32_t z, int16_t room_num);
|
void GetNewRoom(int32_t x, int32_t y, int32_t z, int16_t room_num);
|
||||||
void ShiftItem(ITEM_INFO* item, COLL_INFO* coll);
|
void ShiftItem(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void UpdateLaraRoom(ITEM_INFO* item, int32_t height);
|
void UpdateLaraRoom(ITEM_INFO *item, int32_t height);
|
||||||
int16_t GetTiltType(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z);
|
int16_t GetTiltType(FLOOR_INFO *floor, int32_t x, int32_t y, int32_t z);
|
||||||
void LaraBaddieCollision(ITEM_INFO* lara_item, COLL_INFO* coll);
|
void LaraBaddieCollision(ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void EffectSpaz(ITEM_INFO* lara_item, COLL_INFO* coll);
|
void EffectSpaz(ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void CreatureCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
void CreatureCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void ObjectCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
void ObjectCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void DoorCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
void DoorCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void TrapCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
void TrapCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void ItemPushLara(
|
void ItemPushLara(
|
||||||
ITEM_INFO* item, ITEM_INFO* lara_item, COLL_INFO* coll, int32_t spazon,
|
ITEM_INFO *item, ITEM_INFO *lara_item, COLL_INFO *coll, int32_t spazon,
|
||||||
int32_t bigpush);
|
int32_t bigpush);
|
||||||
int32_t
|
int32_t
|
||||||
TestBoundsCollide(ITEM_INFO* item, ITEM_INFO* lara_item, int32_t radius);
|
TestBoundsCollide(ITEM_INFO *item, ITEM_INFO *lara_item, int32_t radius);
|
||||||
int32_t
|
int32_t
|
||||||
TestLaraPosition(int16_t* bounds, ITEM_INFO* item, ITEM_INFO* lara_item);
|
TestLaraPosition(int16_t *bounds, ITEM_INFO *item, ITEM_INFO *lara_item);
|
||||||
void AlignLaraPosition(PHD_VECTOR* vec, ITEM_INFO* item, ITEM_INFO* lara_item);
|
void AlignLaraPosition(PHD_VECTOR *vec, ITEM_INFO *item, ITEM_INFO *lara_item);
|
||||||
int32_t
|
int32_t
|
||||||
MoveLaraPosition(PHD_VECTOR* vec, ITEM_INFO* item, ITEM_INFO* lara_item);
|
MoveLaraPosition(PHD_VECTOR *vec, ITEM_INFO *item, ITEM_INFO *lara_item);
|
||||||
int32_t Move3DPosTo3DPos(
|
int32_t Move3DPosTo3DPos(
|
||||||
PHD_3DPOS* srcpos, PHD_3DPOS* destpos, int32_t velocity, PHD_ANGLE angadd);
|
PHD_3DPOS *srcpos, PHD_3DPOS *destpos, int32_t velocity, PHD_ANGLE angadd);
|
||||||
|
|
||||||
void T1MInjectGameCollide();
|
void T1MInjectGameCollide();
|
||||||
|
|
||||||
|
|
|
@ -159,12 +159,12 @@ int32_t ControlPhase(int32_t nframes, int32_t demo_mode)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimateItem(ITEM_INFO* item)
|
void AnimateItem(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
item->touch_bits = 0;
|
item->touch_bits = 0;
|
||||||
item->hit_status = 0;
|
item->hit_status = 0;
|
||||||
|
|
||||||
ANIM_STRUCT* anim = &Anims[item->anim_number];
|
ANIM_STRUCT *anim = &Anims[item->anim_number];
|
||||||
|
|
||||||
item->frame_number++;
|
item->frame_number++;
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ void AnimateItem(ITEM_INFO* item)
|
||||||
|
|
||||||
if (item->frame_number > anim->frame_end) {
|
if (item->frame_number > anim->frame_end) {
|
||||||
if (anim->number_commands > 0) {
|
if (anim->number_commands > 0) {
|
||||||
int16_t* command = &AnimCommands[anim->command_index];
|
int16_t *command = &AnimCommands[anim->command_index];
|
||||||
for (int i = 0; i < anim->number_commands; i++) {
|
for (int i = 0; i < anim->number_commands; i++) {
|
||||||
switch (*command++) {
|
switch (*command++) {
|
||||||
case AC_MOVE_ORIGIN:
|
case AC_MOVE_ORIGIN:
|
||||||
|
@ -220,7 +220,7 @@ void AnimateItem(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (anim->number_commands > 0) {
|
if (anim->number_commands > 0) {
|
||||||
int16_t* command = &AnimCommands[anim->command_index];
|
int16_t *command = &AnimCommands[anim->command_index];
|
||||||
for (int i = 0; i < anim->number_commands; i++) {
|
for (int i = 0; i < anim->number_commands; i++) {
|
||||||
switch (*command++) {
|
switch (*command++) {
|
||||||
case AC_MOVE_ORIGIN:
|
case AC_MOVE_ORIGIN:
|
||||||
|
@ -266,16 +266,16 @@ void AnimateItem(ITEM_INFO* item)
|
||||||
item->pos.z += (phd_cos(item->pos.y_rot) * item->speed) >> W2V_SHIFT;
|
item->pos.z += (phd_cos(item->pos.y_rot) * item->speed) >> W2V_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t GetChange(ITEM_INFO* item, ANIM_STRUCT* anim)
|
int32_t GetChange(ITEM_INFO *item, ANIM_STRUCT *anim)
|
||||||
{
|
{
|
||||||
if (item->current_anim_state == item->goal_anim_state) {
|
if (item->current_anim_state == item->goal_anim_state) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ANIM_CHANGE_STRUCT* change = &AnimChanges[anim->change_index];
|
ANIM_CHANGE_STRUCT *change = &AnimChanges[anim->change_index];
|
||||||
for (int i = 0; i < anim->number_changes; i++, change++) {
|
for (int i = 0; i < anim->number_changes; i++, change++) {
|
||||||
if (change->goal_anim_state == item->goal_anim_state) {
|
if (change->goal_anim_state == item->goal_anim_state) {
|
||||||
ANIM_RANGE_STRUCT* range = &AnimRanges[change->range_index];
|
ANIM_RANGE_STRUCT *range = &AnimRanges[change->range_index];
|
||||||
for (int j = 0; j < change->number_ranges; j++, range++) {
|
for (int j = 0; j < change->number_ranges; j++, range++) {
|
||||||
if (item->frame_number >= range->start_frame
|
if (item->frame_number >= range->start_frame
|
||||||
&& item->frame_number <= range->end_frame) {
|
&& item->frame_number <= range->end_frame) {
|
||||||
|
@ -290,7 +290,7 @@ int32_t GetChange(ITEM_INFO* item, ANIM_STRUCT* anim)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TranslateItem(ITEM_INFO* item, int32_t x, int32_t y, int32_t z)
|
void TranslateItem(ITEM_INFO *item, int32_t x, int32_t y, int32_t z)
|
||||||
{
|
{
|
||||||
int32_t c = phd_cos(item->pos.y_rot);
|
int32_t c = phd_cos(item->pos.y_rot);
|
||||||
int32_t s = phd_sin(item->pos.y_rot);
|
int32_t s = phd_sin(item->pos.y_rot);
|
||||||
|
@ -300,11 +300,11 @@ void TranslateItem(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;
|
||||||
}
|
}
|
||||||
|
|
||||||
FLOOR_INFO* GetFloor(int32_t x, int32_t y, int32_t z, int16_t* room_num)
|
FLOOR_INFO *GetFloor(int32_t x, int32_t y, int32_t z, int16_t *room_num)
|
||||||
{
|
{
|
||||||
int16_t data;
|
int16_t data;
|
||||||
FLOOR_INFO* floor;
|
FLOOR_INFO *floor;
|
||||||
ROOM_INFO* r = &RoomInfo[*room_num];
|
ROOM_INFO *r = &RoomInfo[*room_num];
|
||||||
do {
|
do {
|
||||||
int32_t x_floor = (z - r->z) >> WALL_SHIFT;
|
int32_t x_floor = (z - r->z) >> WALL_SHIFT;
|
||||||
int32_t y_floor = (x - r->x) >> WALL_SHIFT;
|
int32_t y_floor = (x - r->x) >> WALL_SHIFT;
|
||||||
|
@ -374,13 +374,13 @@ FLOOR_INFO* GetFloor(int32_t x, int32_t y, int32_t z, int16_t* room_num)
|
||||||
|
|
||||||
int16_t GetWaterHeight(int32_t x, int32_t y, int32_t z, int16_t room_num)
|
int16_t GetWaterHeight(int32_t x, int32_t y, int32_t z, int16_t room_num)
|
||||||
{
|
{
|
||||||
ROOM_INFO* r = &RoomInfo[room_num];
|
ROOM_INFO *r = &RoomInfo[room_num];
|
||||||
|
|
||||||
#ifdef T1M_FEAT_OG_FIXES
|
#ifdef T1M_FEAT_OG_FIXES
|
||||||
// TR2 code. Fixes infinite loops and crashes when x, y, z are outside of
|
// TR2 code. Fixes infinite loops and crashes when x, y, z are outside of
|
||||||
// room_num's coordinates.
|
// room_num's coordinates.
|
||||||
int16_t data;
|
int16_t data;
|
||||||
FLOOR_INFO* floor;
|
FLOOR_INFO *floor;
|
||||||
int32_t x_floor, y_floor;
|
int32_t x_floor, y_floor;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
@ -416,7 +416,7 @@ int16_t GetWaterHeight(int32_t x, int32_t y, int32_t z, int16_t room_num)
|
||||||
#else
|
#else
|
||||||
int32_t x_floor = (z - r->z) >> WALL_SHIFT;
|
int32_t x_floor = (z - r->z) >> WALL_SHIFT;
|
||||||
int32_t y_floor = (x - r->x) >> WALL_SHIFT;
|
int32_t y_floor = (x - r->x) >> WALL_SHIFT;
|
||||||
FLOOR_INFO* floor = &r->floor[x_floor + y_floor * r->x_size];
|
FLOOR_INFO *floor = &r->floor[x_floor + y_floor * r->x_size];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (r->flags & RF_UNDERWATER) {
|
if (r->flags & RF_UNDERWATER) {
|
||||||
|
@ -444,11 +444,11 @@ int16_t GetWaterHeight(int32_t x, int32_t y, int32_t z, int16_t room_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t GetHeight(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z)
|
int16_t GetHeight(FLOOR_INFO *floor, int32_t x, int32_t y, int32_t z)
|
||||||
{
|
{
|
||||||
HeightType = HT_WALL;
|
HeightType = HT_WALL;
|
||||||
while (floor->pit_room != NO_ROOM) {
|
while (floor->pit_room != NO_ROOM) {
|
||||||
ROOM_INFO* r = &RoomInfo[floor->pit_room];
|
ROOM_INFO *r = &RoomInfo[floor->pit_room];
|
||||||
int32_t x_floor = (z - r->z) >> WALL_SHIFT;
|
int32_t x_floor = (z - r->z) >> WALL_SHIFT;
|
||||||
int32_t y_floor = (x - r->x) >> WALL_SHIFT;
|
int32_t y_floor = (x - r->x) >> WALL_SHIFT;
|
||||||
floor = &r->floor[x_floor + y_floor * r->x_size];
|
floor = &r->floor[x_floor + y_floor * r->x_size];
|
||||||
|
@ -462,7 +462,7 @@ int16_t GetHeight(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z)
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t* data = &FloorData[floor->index];
|
int16_t *data = &FloorData[floor->index];
|
||||||
int16_t type;
|
int16_t type;
|
||||||
int16_t trigger;
|
int16_t trigger;
|
||||||
do {
|
do {
|
||||||
|
@ -521,8 +521,8 @@ int16_t GetHeight(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z)
|
||||||
trigger = *data++;
|
trigger = *data++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ITEM_INFO* item = &Items[trigger & VALUE_BITS];
|
ITEM_INFO *item = &Items[trigger & VALUE_BITS];
|
||||||
OBJECT_INFO* object = &Objects[item->object_number];
|
OBJECT_INFO *object = &Objects[item->object_number];
|
||||||
if (object->floor) {
|
if (object->floor) {
|
||||||
object->floor(item, x, y, z, &height);
|
object->floor(item, x, y, z, &height);
|
||||||
}
|
}
|
||||||
|
@ -539,7 +539,7 @@ int16_t GetHeight(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z)
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RefreshCamera(int16_t type, int16_t* data)
|
void RefreshCamera(int16_t type, int16_t *data)
|
||||||
{
|
{
|
||||||
int16_t trigger;
|
int16_t trigger;
|
||||||
int16_t target_ok = 2;
|
int16_t target_ok = 2;
|
||||||
|
@ -584,7 +584,7 @@ void RefreshCamera(int16_t type, int16_t* data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestTriggers(int16_t* data, int32_t heavy)
|
void TestTriggers(int16_t *data, int32_t heavy)
|
||||||
{
|
{
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
|
@ -663,7 +663,7 @@ void TestTriggers(int16_t* data, int32_t heavy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_INFO* camera_item = NULL;
|
ITEM_INFO *camera_item = NULL;
|
||||||
int16_t trigger;
|
int16_t trigger;
|
||||||
do {
|
do {
|
||||||
trigger = *data++;
|
trigger = *data++;
|
||||||
|
@ -671,7 +671,7 @@ void TestTriggers(int16_t* data, int32_t heavy)
|
||||||
|
|
||||||
switch (TRIG_BITS(trigger)) {
|
switch (TRIG_BITS(trigger)) {
|
||||||
case TO_OBJECT: {
|
case TO_OBJECT: {
|
||||||
ITEM_INFO* item = &Items[value];
|
ITEM_INFO *item = &Items[value];
|
||||||
|
|
||||||
if (item->flags & IF_ONESHOT) {
|
if (item->flags & IF_ONESHOT) {
|
||||||
break;
|
break;
|
||||||
|
@ -769,7 +769,7 @@ void TestTriggers(int16_t* data, int32_t heavy)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TO_SINK: {
|
case TO_SINK: {
|
||||||
OBJECT_VECTOR* obvector = &Camera.fixed[value];
|
OBJECT_VECTOR *obvector = &Camera.fixed[value];
|
||||||
|
|
||||||
if (Lara.LOT.required_box != obvector->flags) {
|
if (Lara.LOT.required_box != obvector->flags) {
|
||||||
Lara.LOT.target.x = obvector->x;
|
Lara.LOT.target.x = obvector->x;
|
||||||
|
@ -855,7 +855,7 @@ void TestTriggers(int16_t* data, int32_t heavy)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t TriggerActive(ITEM_INFO* item)
|
int32_t TriggerActive(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
int32_t ok = (item->flags & IF_REVERSE) ? 0 : 1;
|
int32_t ok = (item->flags & IF_REVERSE) ? 0 : 1;
|
||||||
|
|
||||||
|
@ -880,15 +880,15 @@ int32_t TriggerActive(ITEM_INFO* item)
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t GetCeiling(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z)
|
int16_t GetCeiling(FLOOR_INFO *floor, int32_t x, int32_t y, int32_t z)
|
||||||
{
|
{
|
||||||
int16_t* data;
|
int16_t *data;
|
||||||
int16_t type;
|
int16_t type;
|
||||||
int16_t trigger;
|
int16_t trigger;
|
||||||
|
|
||||||
FLOOR_INFO* f = floor;
|
FLOOR_INFO *f = floor;
|
||||||
while (f->sky_room != NO_ROOM) {
|
while (f->sky_room != NO_ROOM) {
|
||||||
ROOM_INFO* r = &RoomInfo[f->sky_room];
|
ROOM_INFO *r = &RoomInfo[f->sky_room];
|
||||||
int32_t x_floor = (z - r->z) >> WALL_SHIFT;
|
int32_t x_floor = (z - r->z) >> WALL_SHIFT;
|
||||||
int32_t y_floor = (x - r->x) >> WALL_SHIFT;
|
int32_t y_floor = (x - r->x) >> WALL_SHIFT;
|
||||||
f = &r->floor[x_floor + y_floor * r->x_size];
|
f = &r->floor[x_floor + y_floor * r->x_size];
|
||||||
|
@ -929,7 +929,7 @@ int16_t GetCeiling(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z)
|
||||||
}
|
}
|
||||||
|
|
||||||
while (floor->pit_room != NO_ROOM) {
|
while (floor->pit_room != NO_ROOM) {
|
||||||
ROOM_INFO* r = &RoomInfo[floor->pit_room];
|
ROOM_INFO *r = &RoomInfo[floor->pit_room];
|
||||||
int32_t x_floor = (z - r->z) >> WALL_SHIFT;
|
int32_t x_floor = (z - r->z) >> WALL_SHIFT;
|
||||||
int32_t y_floor = (x - r->x) >> WALL_SHIFT;
|
int32_t y_floor = (x - r->x) >> WALL_SHIFT;
|
||||||
floor = &r->floor[x_floor + y_floor * r->x_size];
|
floor = &r->floor[x_floor + y_floor * r->x_size];
|
||||||
|
@ -962,8 +962,8 @@ int16_t GetCeiling(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z)
|
||||||
trigger = *data++;
|
trigger = *data++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ITEM_INFO* item = &Items[trigger & VALUE_BITS];
|
ITEM_INFO *item = &Items[trigger & VALUE_BITS];
|
||||||
OBJECT_INFO* object = &Objects[item->object_number];
|
OBJECT_INFO *object = &Objects[item->object_number];
|
||||||
if (object->ceiling) {
|
if (object->ceiling) {
|
||||||
object->ceiling(item, x, y, z, &height);
|
object->ceiling(item, x, y, z, &height);
|
||||||
}
|
}
|
||||||
|
@ -980,13 +980,13 @@ int16_t GetCeiling(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z)
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t GetDoor(FLOOR_INFO* floor)
|
int16_t GetDoor(FLOOR_INFO *floor)
|
||||||
{
|
{
|
||||||
if (!floor->index) {
|
if (!floor->index) {
|
||||||
return NO_ROOM;
|
return NO_ROOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t* data = &FloorData[floor->index];
|
int16_t *data = &FloorData[floor->index];
|
||||||
int16_t type = *data++;
|
int16_t type = *data++;
|
||||||
|
|
||||||
if (type == FT_TILT) {
|
if (type == FT_TILT) {
|
||||||
|
@ -1005,7 +1005,7 @@ int16_t GetDoor(FLOOR_INFO* floor)
|
||||||
return NO_ROOM;
|
return NO_ROOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LOS(GAME_VECTOR* start, GAME_VECTOR* target)
|
int32_t LOS(GAME_VECTOR *start, GAME_VECTOR *target)
|
||||||
{
|
{
|
||||||
int32_t los1;
|
int32_t los1;
|
||||||
int32_t los2;
|
int32_t los2;
|
||||||
|
@ -1022,7 +1022,7 @@ int32_t LOS(GAME_VECTOR* start, GAME_VECTOR* target)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(target->x, target->y, target->z, &target->room_number);
|
GetFloor(target->x, target->y, target->z, &target->room_number);
|
||||||
|
|
||||||
if (ClipTarget(start, target, floor) && los1 == 1 && los2 == 1) {
|
if (ClipTarget(start, target, floor) && los1 == 1 && los2 == 1) {
|
||||||
|
@ -1032,9 +1032,9 @@ int32_t LOS(GAME_VECTOR* start, GAME_VECTOR* target)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t zLOS(GAME_VECTOR* start, GAME_VECTOR* target)
|
int32_t zLOS(GAME_VECTOR *start, GAME_VECTOR *target)
|
||||||
{
|
{
|
||||||
FLOOR_INFO* floor;
|
FLOOR_INFO *floor;
|
||||||
|
|
||||||
int32_t dz = target->z - start->z;
|
int32_t dz = target->z - start->z;
|
||||||
if (dz == 0) {
|
if (dz == 0) {
|
||||||
|
@ -1117,9 +1117,9 @@ int32_t zLOS(GAME_VECTOR* start, GAME_VECTOR* target)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t xLOS(GAME_VECTOR* start, GAME_VECTOR* target)
|
int32_t xLOS(GAME_VECTOR *start, GAME_VECTOR *target)
|
||||||
{
|
{
|
||||||
FLOOR_INFO* floor;
|
FLOOR_INFO *floor;
|
||||||
|
|
||||||
int32_t dx = target->x - start->x;
|
int32_t dx = target->x - start->x;
|
||||||
if (dx == 0) {
|
if (dx == 0) {
|
||||||
|
@ -1202,7 +1202,7 @@ int32_t xLOS(GAME_VECTOR* start, GAME_VECTOR* target)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ClipTarget(GAME_VECTOR* start, GAME_VECTOR* target, FLOOR_INFO* floor)
|
int32_t ClipTarget(GAME_VECTOR *start, GAME_VECTOR *target, FLOOR_INFO *floor)
|
||||||
{
|
{
|
||||||
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;
|
||||||
|
@ -1232,14 +1232,14 @@ void FlipMap()
|
||||||
mn_stop_ambient_samples();
|
mn_stop_ambient_samples();
|
||||||
|
|
||||||
for (int i = 0; i < RoomCount; i++) {
|
for (int i = 0; i < RoomCount; i++) {
|
||||||
ROOM_INFO* r = &RoomInfo[i];
|
ROOM_INFO *r = &RoomInfo[i];
|
||||||
if (r->flipped_room < 0) {
|
if (r->flipped_room < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveRoomFlipItems(r);
|
RemoveRoomFlipItems(r);
|
||||||
|
|
||||||
ROOM_INFO* flipped = &RoomInfo[r->flipped_room];
|
ROOM_INFO *flipped = &RoomInfo[r->flipped_room];
|
||||||
ROOM_INFO temp = *r;
|
ROOM_INFO temp = *r;
|
||||||
*r = *flipped;
|
*r = *flipped;
|
||||||
*flipped = temp;
|
*flipped = temp;
|
||||||
|
@ -1257,11 +1257,11 @@ void FlipMap()
|
||||||
FlipStatus = !FlipStatus;
|
FlipStatus = !FlipStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveRoomFlipItems(ROOM_INFO* r)
|
void RemoveRoomFlipItems(ROOM_INFO *r)
|
||||||
{
|
{
|
||||||
for (int16_t item_num = r->item_number; item_num != NO_ITEM;
|
for (int16_t item_num = r->item_number; item_num != NO_ITEM;
|
||||||
item_num = Items[item_num].next_item) {
|
item_num = Items[item_num].next_item) {
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
switch (item->object_number) {
|
switch (item->object_number) {
|
||||||
case O_MOVABLE_BLOCK:
|
case O_MOVABLE_BLOCK:
|
||||||
|
@ -1278,11 +1278,11 @@ void RemoveRoomFlipItems(ROOM_INFO* r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddRoomFlipItems(ROOM_INFO* r)
|
void AddRoomFlipItems(ROOM_INFO *r)
|
||||||
{
|
{
|
||||||
for (int16_t item_num = r->item_number; item_num != NO_ITEM;
|
for (int16_t item_num = r->item_number; item_num != NO_ITEM;
|
||||||
item_num = Items[item_num].next_item) {
|
item_num = Items[item_num].next_item) {
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
switch (item->object_number) {
|
switch (item->object_number) {
|
||||||
case O_MOVABLE_BLOCK:
|
case O_MOVABLE_BLOCK:
|
||||||
|
|
|
@ -5,24 +5,24 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
int32_t ControlPhase(int32_t nframes, int32_t demo_mode);
|
int32_t ControlPhase(int32_t nframes, int32_t demo_mode);
|
||||||
void AnimateItem(ITEM_INFO* item);
|
void AnimateItem(ITEM_INFO *item);
|
||||||
int32_t GetChange(ITEM_INFO* item, ANIM_STRUCT* anim);
|
int32_t GetChange(ITEM_INFO *item, ANIM_STRUCT *anim);
|
||||||
void TranslateItem(ITEM_INFO* item, int32_t x, int32_t y, int32_t z);
|
void TranslateItem(ITEM_INFO *item, int32_t x, int32_t y, int32_t z);
|
||||||
FLOOR_INFO* GetFloor(int32_t x, int32_t y, int32_t z, int16_t* room_num);
|
FLOOR_INFO *GetFloor(int32_t x, int32_t y, int32_t z, int16_t *room_num);
|
||||||
int16_t GetWaterHeight(int32_t x, int32_t y, int32_t z, int16_t room_num);
|
int16_t GetWaterHeight(int32_t x, int32_t y, int32_t z, int16_t room_num);
|
||||||
int16_t GetHeight(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z);
|
int16_t GetHeight(FLOOR_INFO *floor, int32_t x, int32_t y, int32_t z);
|
||||||
void RefreshCamera(int16_t type, int16_t* data);
|
void RefreshCamera(int16_t type, int16_t *data);
|
||||||
void TestTriggers(int16_t* data, int32_t heavy);
|
void TestTriggers(int16_t *data, int32_t heavy);
|
||||||
int32_t TriggerActive(ITEM_INFO* item);
|
int32_t TriggerActive(ITEM_INFO *item);
|
||||||
int16_t GetCeiling(FLOOR_INFO* floor, int32_t x, int32_t y, int32_t z);
|
int16_t GetCeiling(FLOOR_INFO *floor, int32_t x, int32_t y, int32_t z);
|
||||||
int16_t GetDoor(FLOOR_INFO* floor);
|
int16_t GetDoor(FLOOR_INFO *floor);
|
||||||
int32_t LOS(GAME_VECTOR* start, GAME_VECTOR* target);
|
int32_t LOS(GAME_VECTOR *start, GAME_VECTOR *target);
|
||||||
int32_t zLOS(GAME_VECTOR* start, GAME_VECTOR* target);
|
int32_t zLOS(GAME_VECTOR *start, GAME_VECTOR *target);
|
||||||
int32_t xLOS(GAME_VECTOR* start, GAME_VECTOR* target);
|
int32_t xLOS(GAME_VECTOR *start, GAME_VECTOR *target);
|
||||||
int32_t ClipTarget(GAME_VECTOR* start, GAME_VECTOR* target, FLOOR_INFO* floor);
|
int32_t ClipTarget(GAME_VECTOR *start, GAME_VECTOR *target, FLOOR_INFO *floor);
|
||||||
void FlipMap();
|
void FlipMap();
|
||||||
void RemoveRoomFlipItems(ROOM_INFO* r);
|
void RemoveRoomFlipItems(ROOM_INFO *r);
|
||||||
void AddRoomFlipItems(ROOM_INFO* r);
|
void AddRoomFlipItems(ROOM_INFO *r);
|
||||||
void TriggerCDTrack(int16_t value, int16_t flags, int16_t type);
|
void TriggerCDTrack(int16_t value, int16_t flags, int16_t type);
|
||||||
void TriggerNormalCDTrack(int16_t value, int16_t flags, int16_t type);
|
void TriggerNormalCDTrack(int16_t value, int16_t flags, int16_t type);
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ static BITE_INFO CrocBite = { 5, -21, 467, 9 };
|
||||||
|
|
||||||
void AlligatorControl(int16_t item_num)
|
void AlligatorControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -53,8 +53,8 @@ void AlligatorControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* gator = item->data;
|
CREATURE_INFO *gator = item->data;
|
||||||
FLOOR_INFO* floor;
|
FLOOR_INFO *floor;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
int16_t room_num;
|
int16_t room_num;
|
||||||
|
@ -161,7 +161,7 @@ void AlligatorControl(int16_t item_num)
|
||||||
|
|
||||||
void CrocControl(int16_t item_num)
|
void CrocControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -170,7 +170,7 @@ void CrocControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* croc = item->data;
|
CREATURE_INFO *croc = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
int32_t StartDemo()
|
int32_t StartDemo()
|
||||||
{
|
{
|
||||||
TRACE("");
|
TRACE("");
|
||||||
TEXTSTRING* txt;
|
TEXTSTRING *txt;
|
||||||
START_INFO start, *s;
|
START_INFO start, *s;
|
||||||
|
|
||||||
int16_t level_num = DemoLevel;
|
int16_t level_num = DemoLevel;
|
||||||
|
@ -67,7 +67,7 @@ int32_t StartDemo()
|
||||||
|
|
||||||
void LoadLaraDemoPos()
|
void LoadLaraDemoPos()
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = LaraItem;
|
ITEM_INFO *item = LaraItem;
|
||||||
item->pos.x = DemoPtr[0];
|
item->pos.x = DemoPtr[0];
|
||||||
item->pos.y = DemoPtr[1];
|
item->pos.y = DemoPtr[1];
|
||||||
item->pos.z = DemoPtr[2];
|
item->pos.z = DemoPtr[2];
|
||||||
|
@ -81,7 +81,7 @@ void LoadLaraDemoPos()
|
||||||
ItemNewRoom(Lara.item_number, room_num);
|
ItemNewRoom(Lara.item_number, room_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
item->floor = GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
item->floor = GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ static BITE_INFO RaptorBite = { 0, 66, 318, 22 };
|
||||||
|
|
||||||
void RaptorControl(int16_t item_num)
|
void RaptorControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -69,7 +69,7 @@ void RaptorControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* raptor = item->data;
|
CREATURE_INFO *raptor = 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;
|
||||||
|
@ -185,7 +185,7 @@ void RaptorControl(int16_t item_num)
|
||||||
|
|
||||||
void DinoControl(int16_t item_num)
|
void DinoControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -194,7 +194,7 @@ void DinoControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* dino = item->data;
|
CREATURE_INFO *dino = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
|
|
||||||
|
@ -289,7 +289,7 @@ void DinoControl(int16_t item_num)
|
||||||
item->collidable = 1;
|
item->collidable = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraDinoDeath(ITEM_INFO* item)
|
void LaraDinoDeath(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
item->goal_anim_state = DINO_KILL;
|
item->goal_anim_state = DINO_KILL;
|
||||||
if (LaraItem->room_number != item->room_number) {
|
if (LaraItem->room_number != item->room_number) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
void RaptorControl(int16_t item_num);
|
void RaptorControl(int16_t item_num);
|
||||||
void DinoControl(int16_t item_num);
|
void DinoControl(int16_t item_num);
|
||||||
void LaraDinoDeath(ITEM_INFO* item);
|
void LaraDinoDeath(ITEM_INFO *item);
|
||||||
|
|
||||||
void T1MInjectGameDino();
|
void T1MInjectGameDino();
|
||||||
|
|
||||||
|
|
140
src/game/draw.c
140
src/game/draw.c
|
@ -18,7 +18,7 @@ int32_t DrawPhaseCinematic()
|
||||||
CameraUnderwater = 0;
|
CameraUnderwater = 0;
|
||||||
for (int i = 0; i < RoomsToDrawNum; i++) {
|
for (int i = 0; i < RoomsToDrawNum; i++) {
|
||||||
int32_t room_num = RoomsToDraw[i];
|
int32_t room_num = RoomsToDraw[i];
|
||||||
ROOM_INFO* r = &RoomInfo[room_num];
|
ROOM_INFO *r = &RoomInfo[room_num];
|
||||||
r->top = 0;
|
r->top = 0;
|
||||||
r->left = 0;
|
r->left = 0;
|
||||||
r->right = PhdWinMaxX;
|
r->right = PhdWinMaxX;
|
||||||
|
@ -49,7 +49,7 @@ void DrawRooms(int16_t current_room)
|
||||||
PhdRight = PhdWinMaxX;
|
PhdRight = PhdWinMaxX;
|
||||||
PhdBottom = PhdWinMaxY;
|
PhdBottom = PhdWinMaxY;
|
||||||
|
|
||||||
ROOM_INFO* r = &RoomInfo[current_room];
|
ROOM_INFO *r = &RoomInfo[current_room];
|
||||||
r->left = PhdLeft;
|
r->left = PhdLeft;
|
||||||
r->top = PhdTop;
|
r->top = PhdTop;
|
||||||
r->right = PhdRight;
|
r->right = PhdRight;
|
||||||
|
@ -65,7 +65,7 @@ void DrawRooms(int16_t current_room)
|
||||||
phd_TranslateAbs(r->x, r->y, r->z);
|
phd_TranslateAbs(r->x, r->y, r->z);
|
||||||
if (r->doors) {
|
if (r->doors) {
|
||||||
for (int i = 0; i < r->doors->count; i++) {
|
for (int i = 0; i < r->doors->count; i++) {
|
||||||
DOOR_INFO* door = &r->doors->door[i];
|
DOOR_INFO *door = &r->doors->door[i];
|
||||||
if (SetRoomBounds(&door->x, door->room_num, r)) {
|
if (SetRoomBounds(&door->x, door->room_num, r)) {
|
||||||
GetRoomBounds(door->room_num);
|
GetRoomBounds(door->room_num);
|
||||||
}
|
}
|
||||||
|
@ -90,12 +90,12 @@ void DrawRooms(int16_t current_room)
|
||||||
|
|
||||||
void GetRoomBounds(int16_t room_num)
|
void GetRoomBounds(int16_t room_num)
|
||||||
{
|
{
|
||||||
ROOM_INFO* r = &RoomInfo[room_num];
|
ROOM_INFO *r = &RoomInfo[room_num];
|
||||||
phd_PushMatrix();
|
phd_PushMatrix();
|
||||||
phd_TranslateAbs(r->x, r->y, r->z);
|
phd_TranslateAbs(r->x, r->y, r->z);
|
||||||
if (r->doors) {
|
if (r->doors) {
|
||||||
for (int i = 0; i < r->doors->count; i++) {
|
for (int i = 0; i < r->doors->count; i++) {
|
||||||
DOOR_INFO* door = &r->doors->door[i];
|
DOOR_INFO *door = &r->doors->door[i];
|
||||||
if (SetRoomBounds(&door->x, door->room_num, r)) {
|
if (SetRoomBounds(&door->x, door->room_num, r)) {
|
||||||
GetRoomBounds(door->room_num);
|
GetRoomBounds(door->room_num);
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ void GetRoomBounds(int16_t room_num)
|
||||||
phd_PopMatrix();
|
phd_PopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t SetRoomBounds(int16_t* objptr, int16_t room_num, ROOM_INFO* parent)
|
int32_t SetRoomBounds(int16_t *objptr, int16_t room_num, ROOM_INFO *parent)
|
||||||
{
|
{
|
||||||
// TODO: the way the game passes the objptr is dangerous and relies on
|
// TODO: the way the game passes the objptr is dangerous and relies on
|
||||||
// layout of DOOR_INFO
|
// layout of DOOR_INFO
|
||||||
|
@ -125,7 +125,7 @@ int32_t SetRoomBounds(int16_t* objptr, int16_t room_num, ROOM_INFO* parent)
|
||||||
int32_t z_toofar = 0;
|
int32_t z_toofar = 0;
|
||||||
int32_t z_behind = 0;
|
int32_t z_behind = 0;
|
||||||
|
|
||||||
const PHD_MATRIX* mptr = PhdMatrixPtr;
|
const PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
int32_t xv = mptr->_00 * objptr[0] + mptr->_01 * objptr[1]
|
int32_t xv = mptr->_00 * objptr[0] + mptr->_01 * objptr[1]
|
||||||
+ mptr->_02 * objptr[2] + mptr->_03;
|
+ mptr->_02 * objptr[2] + mptr->_03;
|
||||||
|
@ -175,8 +175,8 @@ int32_t SetRoomBounds(int16_t* objptr, int16_t room_num, ROOM_INFO* parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (z_behind > 0) {
|
if (z_behind > 0) {
|
||||||
DOOR_VBUF* dest = &DoorVBuf[0];
|
DOOR_VBUF *dest = &DoorVBuf[0];
|
||||||
DOOR_VBUF* last = &DoorVBuf[3];
|
DOOR_VBUF *last = &DoorVBuf[3];
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
if ((dest->zv < 0) ^ (last->zv < 0)) {
|
if ((dest->zv < 0) ^ (last->zv < 0)) {
|
||||||
if (dest->xv < 0 && last->xv < 0) {
|
if (dest->xv < 0 && last->xv < 0) {
|
||||||
|
@ -220,7 +220,7 @@ int32_t SetRoomBounds(int16_t* objptr, int16_t room_num, ROOM_INFO* parent)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOM_INFO* r = &RoomInfo[room_num];
|
ROOM_INFO *r = &RoomInfo[room_num];
|
||||||
if (left < r->left) {
|
if (left < r->left) {
|
||||||
r->left = left;
|
r->left = left;
|
||||||
}
|
}
|
||||||
|
@ -243,7 +243,7 @@ int32_t SetRoomBounds(int16_t* objptr, int16_t room_num, ROOM_INFO* parent)
|
||||||
|
|
||||||
void PrintRooms(int16_t room_number)
|
void PrintRooms(int16_t room_number)
|
||||||
{
|
{
|
||||||
ROOM_INFO* r = &RoomInfo[room_number];
|
ROOM_INFO *r = &RoomInfo[room_number];
|
||||||
if (r->flags & RF_UNDERWATER) {
|
if (r->flags & RF_UNDERWATER) {
|
||||||
S_SetupBelowWater(CameraUnderwater);
|
S_SetupBelowWater(CameraUnderwater);
|
||||||
} else {
|
} else {
|
||||||
|
@ -263,14 +263,14 @@ void PrintRooms(int16_t room_number)
|
||||||
S_InsertRoom(r->data);
|
S_InsertRoom(r->data);
|
||||||
|
|
||||||
for (int i = r->item_number; i != NO_ITEM; i = Items[i].next_item) {
|
for (int i = r->item_number; i != NO_ITEM; i = Items[i].next_item) {
|
||||||
ITEM_INFO* item = &Items[i];
|
ITEM_INFO *item = &Items[i];
|
||||||
if (item->status != IS_INVISIBLE) {
|
if (item->status != IS_INVISIBLE) {
|
||||||
Objects[item->object_number].draw_routine(item);
|
Objects[item->object_number].draw_routine(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < r->num_meshes; i++) {
|
for (int i = 0; i < r->num_meshes; i++) {
|
||||||
MESH_INFO* mesh = &r->mesh[i];
|
MESH_INFO *mesh = &r->mesh[i];
|
||||||
if (StaticObjects[mesh->static_number].flags & 2) {
|
if (StaticObjects[mesh->static_number].flags & 2) {
|
||||||
phd_PushMatrix();
|
phd_PushMatrix();
|
||||||
phd_TranslateAbs(mesh->x, mesh->y, mesh->z);
|
phd_TranslateAbs(mesh->x, mesh->y, mesh->z);
|
||||||
|
@ -301,8 +301,8 @@ void PrintRooms(int16_t room_number)
|
||||||
|
|
||||||
void DrawEffect(int16_t fxnum)
|
void DrawEffect(int16_t fxnum)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fxnum];
|
FX_INFO *fx = &Effects[fxnum];
|
||||||
OBJECT_INFO* object = &Objects[fx->object_number];
|
OBJECT_INFO *object = &Objects[fx->object_number];
|
||||||
if (!object->loaded) {
|
if (!object->loaded) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ void DrawEffect(int16_t fxnum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawSpriteItem(ITEM_INFO* item)
|
void DrawSpriteItem(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
S_DrawSprite(
|
S_DrawSprite(
|
||||||
item->pos.x, item->pos.y, item->pos.z,
|
item->pos.x, item->pos.y, item->pos.z,
|
||||||
|
@ -337,18 +337,18 @@ void DrawSpriteItem(ITEM_INFO* item)
|
||||||
item->shade);
|
item->shade);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawDummyItem(ITEM_INFO* item)
|
void DrawDummyItem(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawAnimatingItem(ITEM_INFO* item)
|
void DrawAnimatingItem(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
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 };
|
||||||
|
|
||||||
int16_t* frmptr[2];
|
int16_t *frmptr[2];
|
||||||
int32_t rate;
|
int32_t rate;
|
||||||
int32_t frac = GetFrames(item, frmptr, &rate);
|
int32_t frac = GetFrames(item, frmptr, &rate);
|
||||||
OBJECT_INFO* object = &Objects[item->object_number];
|
OBJECT_INFO *object = &Objects[item->object_number];
|
||||||
|
|
||||||
if (object->shadow_size) {
|
if (object->shadow_size) {
|
||||||
S_PrintShadow(object->shadow_size, frmptr[0], item);
|
S_PrintShadow(object->shadow_size, frmptr[0], item);
|
||||||
|
@ -364,18 +364,18 @@ void DrawAnimatingItem(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
CalculateObjectLighting(item, frmptr[0]);
|
CalculateObjectLighting(item, frmptr[0]);
|
||||||
int16_t* extra_rotation = item->data ? item->data : &null_rotation;
|
int16_t *extra_rotation = item->data ? item->data : &null_rotation;
|
||||||
|
|
||||||
int32_t bit = 1;
|
int32_t bit = 1;
|
||||||
int16_t** meshpp = &Meshes[object->mesh_index];
|
int16_t **meshpp = &Meshes[object->mesh_index];
|
||||||
int32_t* bone = &AnimBones[object->bone_index];
|
int32_t *bone = &AnimBones[object->bone_index];
|
||||||
|
|
||||||
if (!frac) {
|
if (!frac) {
|
||||||
phd_TranslateRel(
|
phd_TranslateRel(
|
||||||
frmptr[0][FRAME_POS_X], frmptr[0][FRAME_POS_Y],
|
frmptr[0][FRAME_POS_X], frmptr[0][FRAME_POS_Y],
|
||||||
frmptr[0][FRAME_POS_Z]);
|
frmptr[0][FRAME_POS_Z]);
|
||||||
|
|
||||||
int32_t* packed_rotation = (int32_t*)(frmptr[0] + FRAME_ROT);
|
int32_t *packed_rotation = (int32_t *)(frmptr[0] + FRAME_ROT);
|
||||||
phd_RotYXZpack(*packed_rotation++);
|
phd_RotYXZpack(*packed_rotation++);
|
||||||
|
|
||||||
if (item->mesh_bits & bit) {
|
if (item->mesh_bits & bit) {
|
||||||
|
@ -419,8 +419,8 @@ void DrawAnimatingItem(ITEM_INFO* item)
|
||||||
frmptr[0][FRAME_POS_X], frmptr[0][FRAME_POS_Y],
|
frmptr[0][FRAME_POS_X], frmptr[0][FRAME_POS_Y],
|
||||||
frmptr[0][FRAME_POS_Z], frmptr[1][FRAME_POS_X],
|
frmptr[0][FRAME_POS_Z], frmptr[1][FRAME_POS_X],
|
||||||
frmptr[1][FRAME_POS_Y], frmptr[1][FRAME_POS_Z]);
|
frmptr[1][FRAME_POS_Y], frmptr[1][FRAME_POS_Z]);
|
||||||
int32_t* packed_rotation1 = (int32_t*)(frmptr[0] + FRAME_ROT);
|
int32_t *packed_rotation1 = (int32_t *)(frmptr[0] + FRAME_ROT);
|
||||||
int32_t* packed_rotation2 = (int32_t*)(frmptr[1] + FRAME_ROT);
|
int32_t *packed_rotation2 = (int32_t *)(frmptr[1] + FRAME_ROT);
|
||||||
phd_RotYXZpack_I(*packed_rotation1++, *packed_rotation2++);
|
phd_RotYXZpack_I(*packed_rotation1++, *packed_rotation2++);
|
||||||
|
|
||||||
if (item->mesh_bits & bit) {
|
if (item->mesh_bits & bit) {
|
||||||
|
@ -464,7 +464,7 @@ void DrawAnimatingItem(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// originally in moveblok.c
|
// originally in moveblok.c
|
||||||
void DrawUnclippedItem(ITEM_INFO* item)
|
void DrawUnclippedItem(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
int32_t left = PhdLeft;
|
int32_t left = PhdLeft;
|
||||||
int32_t top = PhdTop;
|
int32_t top = PhdTop;
|
||||||
|
@ -484,11 +484,11 @@ void DrawUnclippedItem(ITEM_INFO* item)
|
||||||
PhdBottom = bottom;
|
PhdBottom = bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawLara(ITEM_INFO* item)
|
void DrawLara(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
OBJECT_INFO* object;
|
OBJECT_INFO *object;
|
||||||
int16_t* frame;
|
int16_t *frame;
|
||||||
int16_t* frmptr[2];
|
int16_t *frmptr[2];
|
||||||
PHD_MATRIX saved_matrix;
|
PHD_MATRIX saved_matrix;
|
||||||
|
|
||||||
int32_t top = PhdTop;
|
int32_t top = PhdTop;
|
||||||
|
@ -556,8 +556,8 @@ void DrawLara(ITEM_INFO* item)
|
||||||
|
|
||||||
CalculateObjectLighting(item, frame);
|
CalculateObjectLighting(item, frame);
|
||||||
|
|
||||||
int32_t* bone = &AnimBones[object->bone_index];
|
int32_t *bone = &AnimBones[object->bone_index];
|
||||||
int32_t* packed_rotation = (int32_t*)(frame + FRAME_ROT);
|
int32_t *packed_rotation = (int32_t *)(frame + FRAME_ROT);
|
||||||
|
|
||||||
phd_TranslateRel(
|
phd_TranslateRel(
|
||||||
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
||||||
|
@ -674,7 +674,8 @@ void DrawLara(ITEM_INFO* item)
|
||||||
PhdMatrixPtr->_22 = PhdMatrixPtr[-2]._22;
|
PhdMatrixPtr->_22 = PhdMatrixPtr[-2]._22;
|
||||||
|
|
||||||
packed_rotation =
|
packed_rotation =
|
||||||
(int32_t*)(Lara.right_arm.frame_base + Lara.right_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
(int32_t
|
||||||
|
*)(Lara.right_arm.frame_base + Lara.right_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
||||||
phd_RotYXZ(
|
phd_RotYXZ(
|
||||||
Lara.right_arm.y_rot, Lara.right_arm.x_rot, Lara.right_arm.z_rot);
|
Lara.right_arm.y_rot, Lara.right_arm.x_rot, Lara.right_arm.z_rot);
|
||||||
phd_RotYXZpack(packed_rotation[LM_UARM_R]);
|
phd_RotYXZpack(packed_rotation[LM_UARM_R]);
|
||||||
|
@ -709,7 +710,8 @@ void DrawLara(ITEM_INFO* item)
|
||||||
PhdMatrixPtr->_22 = PhdMatrixPtr[-2]._22;
|
PhdMatrixPtr->_22 = PhdMatrixPtr[-2]._22;
|
||||||
|
|
||||||
packed_rotation =
|
packed_rotation =
|
||||||
(int32_t*)(Lara.left_arm.frame_base + Lara.left_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
(int32_t
|
||||||
|
*)(Lara.left_arm.frame_base + Lara.left_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
||||||
phd_RotYXZ(
|
phd_RotYXZ(
|
||||||
Lara.left_arm.y_rot, Lara.left_arm.x_rot, Lara.left_arm.z_rot);
|
Lara.left_arm.y_rot, Lara.left_arm.x_rot, Lara.left_arm.z_rot);
|
||||||
phd_RotYXZpack(packed_rotation[LM_UARM_L]);
|
phd_RotYXZpack(packed_rotation[LM_UARM_L]);
|
||||||
|
@ -738,7 +740,8 @@ void DrawLara(ITEM_INFO* item)
|
||||||
phd_PushMatrix();
|
phd_PushMatrix();
|
||||||
|
|
||||||
packed_rotation =
|
packed_rotation =
|
||||||
(int32_t*)(Lara.right_arm.frame_base + Lara.right_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
(int32_t
|
||||||
|
*)(Lara.right_arm.frame_base + Lara.right_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
||||||
phd_TranslateRel(bone[29], bone[30], bone[31]);
|
phd_TranslateRel(bone[29], bone[30], bone[31]);
|
||||||
phd_RotYXZpack(packed_rotation[LM_UARM_R]);
|
phd_RotYXZpack(packed_rotation[LM_UARM_R]);
|
||||||
phd_PutPolygons(Lara.mesh_ptrs[LM_UARM_R], clip);
|
phd_PutPolygons(Lara.mesh_ptrs[LM_UARM_R], clip);
|
||||||
|
@ -762,7 +765,8 @@ void DrawLara(ITEM_INFO* item)
|
||||||
phd_PushMatrix();
|
phd_PushMatrix();
|
||||||
|
|
||||||
packed_rotation =
|
packed_rotation =
|
||||||
(int32_t*)(Lara.left_arm.frame_base + Lara.left_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
(int32_t
|
||||||
|
*)(Lara.left_arm.frame_base + Lara.left_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
||||||
phd_TranslateRel(bone[41], bone[42], bone[43]);
|
phd_TranslateRel(bone[41], bone[42], bone[43]);
|
||||||
phd_RotYXZpack(packed_rotation[LM_UARM_L]);
|
phd_RotYXZpack(packed_rotation[LM_UARM_L]);
|
||||||
phd_PutPolygons(Lara.mesh_ptrs[LM_UARM_L], clip);
|
phd_PutPolygons(Lara.mesh_ptrs[LM_UARM_L], clip);
|
||||||
|
@ -834,7 +838,7 @@ void DrawGunFlash(int32_t weapon_type, int32_t clip)
|
||||||
phd_PutPolygons(Meshes[Objects[O_GUN_FLASH].mesh_index], clip);
|
phd_PutPolygons(Meshes[Objects[O_GUN_FLASH].mesh_index], clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalculateObjectLighting(ITEM_INFO* item, int16_t* frame)
|
void CalculateObjectLighting(ITEM_INFO *item, int16_t *frame)
|
||||||
{
|
{
|
||||||
if (item->shade >= 0) {
|
if (item->shade >= 0) {
|
||||||
S_CalculateStaticLight(item->shade);
|
S_CalculateStaticLight(item->shade);
|
||||||
|
@ -862,13 +866,13 @@ void CalculateObjectLighting(ITEM_INFO* item, int16_t* frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawLaraInt(
|
void DrawLaraInt(
|
||||||
ITEM_INFO* item, int16_t* frame1, int16_t* frame2, int32_t frac,
|
ITEM_INFO *item, int16_t *frame1, int16_t *frame2, int32_t frac,
|
||||||
int32_t rate)
|
int32_t rate)
|
||||||
{
|
{
|
||||||
PHD_MATRIX saved_matrix;
|
PHD_MATRIX saved_matrix;
|
||||||
|
|
||||||
OBJECT_INFO* object = &Objects[item->object_number];
|
OBJECT_INFO *object = &Objects[item->object_number];
|
||||||
int16_t* bounds = GetBoundsAccurate(item);
|
int16_t *bounds = GetBoundsAccurate(item);
|
||||||
|
|
||||||
#ifdef T1M_FEAT_HAIR
|
#ifdef T1M_FEAT_HAIR
|
||||||
saved_matrix = *PhdMatrixPtr;
|
saved_matrix = *PhdMatrixPtr;
|
||||||
|
@ -889,9 +893,9 @@ void DrawLaraInt(
|
||||||
|
|
||||||
CalculateObjectLighting(item, frame1);
|
CalculateObjectLighting(item, frame1);
|
||||||
|
|
||||||
int32_t* bone = &AnimBones[object->bone_index];
|
int32_t *bone = &AnimBones[object->bone_index];
|
||||||
int32_t* packed_rotation1 = (int32_t*)(frame1 + FRAME_ROT);
|
int32_t *packed_rotation1 = (int32_t *)(frame1 + FRAME_ROT);
|
||||||
int32_t* packed_rotation2 = (int32_t*)(frame2 + FRAME_ROT);
|
int32_t *packed_rotation2 = (int32_t *)(frame2 + FRAME_ROT);
|
||||||
|
|
||||||
InitInterpolate(frac, rate);
|
InitInterpolate(frac, rate);
|
||||||
|
|
||||||
|
@ -1011,7 +1015,8 @@ void DrawLaraInt(
|
||||||
InterpolateArmMatrix();
|
InterpolateArmMatrix();
|
||||||
|
|
||||||
packed_rotation1 =
|
packed_rotation1 =
|
||||||
(int32_t*)(Lara.right_arm.frame_base + Lara.right_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
(int32_t
|
||||||
|
*)(Lara.right_arm.frame_base + Lara.right_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
||||||
phd_RotYXZ(
|
phd_RotYXZ(
|
||||||
Lara.right_arm.y_rot, Lara.right_arm.x_rot, Lara.right_arm.z_rot);
|
Lara.right_arm.y_rot, Lara.right_arm.x_rot, Lara.right_arm.z_rot);
|
||||||
phd_RotYXZpack(packed_rotation1[LM_UARM_R]);
|
phd_RotYXZpack(packed_rotation1[LM_UARM_R]);
|
||||||
|
@ -1037,7 +1042,8 @@ void DrawLaraInt(
|
||||||
InterpolateArmMatrix();
|
InterpolateArmMatrix();
|
||||||
|
|
||||||
packed_rotation1 =
|
packed_rotation1 =
|
||||||
(int32_t*)(Lara.left_arm.frame_base + Lara.left_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
(int32_t
|
||||||
|
*)(Lara.left_arm.frame_base + Lara.left_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
||||||
phd_RotYXZ(
|
phd_RotYXZ(
|
||||||
Lara.left_arm.y_rot, Lara.left_arm.x_rot, Lara.left_arm.z_rot);
|
Lara.left_arm.y_rot, Lara.left_arm.x_rot, Lara.left_arm.z_rot);
|
||||||
phd_RotYXZpack(packed_rotation1[LM_UARM_L]);
|
phd_RotYXZpack(packed_rotation1[LM_UARM_L]);
|
||||||
|
@ -1068,7 +1074,8 @@ void DrawLaraInt(
|
||||||
InterpolateMatrix();
|
InterpolateMatrix();
|
||||||
|
|
||||||
packed_rotation1 =
|
packed_rotation1 =
|
||||||
(int32_t*)(Lara.right_arm.frame_base + Lara.right_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
(int32_t
|
||||||
|
*)(Lara.right_arm.frame_base + Lara.right_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
||||||
phd_TranslateRel(bone[29], bone[30], bone[31]);
|
phd_TranslateRel(bone[29], bone[30], bone[31]);
|
||||||
phd_RotYXZpack(packed_rotation1[LM_UARM_R]);
|
phd_RotYXZpack(packed_rotation1[LM_UARM_R]);
|
||||||
phd_PutPolygons(Lara.mesh_ptrs[LM_UARM_R], clip);
|
phd_PutPolygons(Lara.mesh_ptrs[LM_UARM_R], clip);
|
||||||
|
@ -1092,7 +1099,8 @@ void DrawLaraInt(
|
||||||
phd_PushMatrix();
|
phd_PushMatrix();
|
||||||
|
|
||||||
packed_rotation1 =
|
packed_rotation1 =
|
||||||
(int32_t*)(Lara.left_arm.frame_base + Lara.left_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
(int32_t
|
||||||
|
*)(Lara.left_arm.frame_base + Lara.left_arm.frame_number * (object->nmeshes * 2 + FRAME_ROT) + 10);
|
||||||
phd_TranslateRel(bone[41], bone[42], bone[43]);
|
phd_TranslateRel(bone[41], bone[42], bone[43]);
|
||||||
phd_RotYXZpack(packed_rotation1[LM_UARM_L]);
|
phd_RotYXZpack(packed_rotation1[LM_UARM_L]);
|
||||||
phd_PutPolygons(Lara.mesh_ptrs[LM_UARM_L], clip);
|
phd_PutPolygons(Lara.mesh_ptrs[LM_UARM_L], clip);
|
||||||
|
@ -1166,7 +1174,7 @@ void phd_PopMatrix_I()
|
||||||
void phd_TranslateRel_I(int32_t x, int32_t y, int32_t z)
|
void phd_TranslateRel_I(int32_t x, int32_t y, int32_t z)
|
||||||
{
|
{
|
||||||
phd_TranslateRel(x, y, z);
|
phd_TranslateRel(x, y, z);
|
||||||
PHD_MATRIX* old_matrix = PhdMatrixPtr;
|
PHD_MATRIX *old_matrix = PhdMatrixPtr;
|
||||||
PhdMatrixPtr = IMMatrixPtr;
|
PhdMatrixPtr = IMMatrixPtr;
|
||||||
phd_TranslateRel(x, y, z);
|
phd_TranslateRel(x, y, z);
|
||||||
PhdMatrixPtr = old_matrix;
|
PhdMatrixPtr = old_matrix;
|
||||||
|
@ -1176,7 +1184,7 @@ void phd_TranslateRel_ID(
|
||||||
int32_t x, int32_t y, int32_t z, int32_t x2, int32_t y2, int32_t z2)
|
int32_t x, int32_t y, int32_t z, int32_t x2, int32_t y2, int32_t z2)
|
||||||
{
|
{
|
||||||
phd_TranslateRel(x, y, z);
|
phd_TranslateRel(x, y, z);
|
||||||
PHD_MATRIX* old_matrix = PhdMatrixPtr;
|
PHD_MATRIX *old_matrix = PhdMatrixPtr;
|
||||||
PhdMatrixPtr = IMMatrixPtr;
|
PhdMatrixPtr = IMMatrixPtr;
|
||||||
phd_TranslateRel(x2, y2, z2);
|
phd_TranslateRel(x2, y2, z2);
|
||||||
PhdMatrixPtr = old_matrix;
|
PhdMatrixPtr = old_matrix;
|
||||||
|
@ -1185,7 +1193,7 @@ void phd_TranslateRel_ID(
|
||||||
void phd_RotY_I(PHD_ANGLE ang)
|
void phd_RotY_I(PHD_ANGLE ang)
|
||||||
{
|
{
|
||||||
phd_RotY(ang);
|
phd_RotY(ang);
|
||||||
PHD_MATRIX* old_matrix = PhdMatrixPtr;
|
PHD_MATRIX *old_matrix = PhdMatrixPtr;
|
||||||
PhdMatrixPtr = IMMatrixPtr;
|
PhdMatrixPtr = IMMatrixPtr;
|
||||||
phd_RotY(ang);
|
phd_RotY(ang);
|
||||||
PhdMatrixPtr = old_matrix;
|
PhdMatrixPtr = old_matrix;
|
||||||
|
@ -1194,7 +1202,7 @@ void phd_RotY_I(PHD_ANGLE ang)
|
||||||
void phd_RotX_I(PHD_ANGLE ang)
|
void phd_RotX_I(PHD_ANGLE ang)
|
||||||
{
|
{
|
||||||
phd_RotX(ang);
|
phd_RotX(ang);
|
||||||
PHD_MATRIX* old_matrix = PhdMatrixPtr;
|
PHD_MATRIX *old_matrix = PhdMatrixPtr;
|
||||||
PhdMatrixPtr = IMMatrixPtr;
|
PhdMatrixPtr = IMMatrixPtr;
|
||||||
phd_RotX(ang);
|
phd_RotX(ang);
|
||||||
PhdMatrixPtr = old_matrix;
|
PhdMatrixPtr = old_matrix;
|
||||||
|
@ -1203,7 +1211,7 @@ void phd_RotX_I(PHD_ANGLE ang)
|
||||||
void phd_RotZ_I(PHD_ANGLE ang)
|
void phd_RotZ_I(PHD_ANGLE ang)
|
||||||
{
|
{
|
||||||
phd_RotZ(ang);
|
phd_RotZ(ang);
|
||||||
PHD_MATRIX* old_matrix = PhdMatrixPtr;
|
PHD_MATRIX *old_matrix = PhdMatrixPtr;
|
||||||
PhdMatrixPtr = IMMatrixPtr;
|
PhdMatrixPtr = IMMatrixPtr;
|
||||||
phd_RotZ(ang);
|
phd_RotZ(ang);
|
||||||
PhdMatrixPtr = old_matrix;
|
PhdMatrixPtr = old_matrix;
|
||||||
|
@ -1212,7 +1220,7 @@ void phd_RotZ_I(PHD_ANGLE ang)
|
||||||
void phd_RotYXZ_I(PHD_ANGLE y, PHD_ANGLE x, PHD_ANGLE z)
|
void phd_RotYXZ_I(PHD_ANGLE y, PHD_ANGLE x, PHD_ANGLE z)
|
||||||
{
|
{
|
||||||
phd_RotYXZ(y, x, z);
|
phd_RotYXZ(y, x, z);
|
||||||
PHD_MATRIX* old_matrix = PhdMatrixPtr;
|
PHD_MATRIX *old_matrix = PhdMatrixPtr;
|
||||||
PhdMatrixPtr = IMMatrixPtr;
|
PhdMatrixPtr = IMMatrixPtr;
|
||||||
phd_RotYXZ(y, x, z);
|
phd_RotYXZ(y, x, z);
|
||||||
PhdMatrixPtr = old_matrix;
|
PhdMatrixPtr = old_matrix;
|
||||||
|
@ -1221,13 +1229,13 @@ void phd_RotYXZ_I(PHD_ANGLE y, PHD_ANGLE x, PHD_ANGLE z)
|
||||||
void phd_RotYXZpack_I(int32_t r1, int32_t r2)
|
void phd_RotYXZpack_I(int32_t r1, int32_t r2)
|
||||||
{
|
{
|
||||||
phd_RotYXZpack(r1);
|
phd_RotYXZpack(r1);
|
||||||
PHD_MATRIX* old_matrix = PhdMatrixPtr;
|
PHD_MATRIX *old_matrix = PhdMatrixPtr;
|
||||||
PhdMatrixPtr = IMMatrixPtr;
|
PhdMatrixPtr = IMMatrixPtr;
|
||||||
phd_RotYXZpack(r2);
|
phd_RotYXZpack(r2);
|
||||||
PhdMatrixPtr = old_matrix;
|
PhdMatrixPtr = old_matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
void phd_PutPolygons_I(int16_t* ptr, int32_t clip)
|
void phd_PutPolygons_I(int16_t *ptr, int32_t clip)
|
||||||
{
|
{
|
||||||
phd_PushMatrix();
|
phd_PushMatrix();
|
||||||
InterpolateMatrix();
|
InterpolateMatrix();
|
||||||
|
@ -1237,8 +1245,8 @@ void phd_PutPolygons_I(int16_t* ptr, int32_t clip)
|
||||||
|
|
||||||
void InterpolateMatrix()
|
void InterpolateMatrix()
|
||||||
{
|
{
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
PHD_MATRIX* iptr = IMMatrixPtr;
|
PHD_MATRIX *iptr = IMMatrixPtr;
|
||||||
|
|
||||||
if (IMRate == 2) {
|
if (IMRate == 2) {
|
||||||
mptr->_00 = (mptr->_00 + iptr->_00) / 2;
|
mptr->_00 = (mptr->_00 + iptr->_00) / 2;
|
||||||
|
@ -1271,8 +1279,8 @@ void InterpolateMatrix()
|
||||||
|
|
||||||
void InterpolateArmMatrix()
|
void InterpolateArmMatrix()
|
||||||
{
|
{
|
||||||
PHD_MATRIX* mptr = PhdMatrixPtr;
|
PHD_MATRIX *mptr = PhdMatrixPtr;
|
||||||
PHD_MATRIX* iptr = IMMatrixPtr;
|
PHD_MATRIX *iptr = IMMatrixPtr;
|
||||||
|
|
||||||
if (IMRate == 2) {
|
if (IMRate == 2) {
|
||||||
mptr->_00 = mptr[-2]._00;
|
mptr->_00 = mptr[-2]._00;
|
||||||
|
@ -1303,9 +1311,9 @@ void InterpolateArmMatrix()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t GetFrames(ITEM_INFO* item, int16_t* frmptr[], int32_t* rate)
|
int32_t GetFrames(ITEM_INFO *item, int16_t *frmptr[], int32_t *rate)
|
||||||
{
|
{
|
||||||
ANIM_STRUCT* anim = &Anims[item->anim_number];
|
ANIM_STRUCT *anim = &Anims[item->anim_number];
|
||||||
frmptr[0] = anim->frame_ptr;
|
frmptr[0] = anim->frame_ptr;
|
||||||
frmptr[1] = anim->frame_ptr;
|
frmptr[1] = anim->frame_ptr;
|
||||||
|
|
||||||
|
@ -1331,10 +1339,10 @@ int32_t GetFrames(ITEM_INFO* item, int16_t* frmptr[], int32_t* rate)
|
||||||
return interp;
|
return interp;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t* GetBoundsAccurate(ITEM_INFO* item)
|
int16_t *GetBoundsAccurate(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
int32_t rate;
|
int32_t rate;
|
||||||
int16_t* frmptr[2];
|
int16_t *frmptr[2];
|
||||||
|
|
||||||
int32_t frac = GetFrames(item, frmptr, &rate);
|
int32_t frac = GetFrames(item, frmptr, &rate);
|
||||||
if (!frac) {
|
if (!frac) {
|
||||||
|
@ -1349,9 +1357,9 @@ int16_t* GetBoundsAccurate(ITEM_INFO* item)
|
||||||
return InterpolatedBounds;
|
return InterpolatedBounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t* GetBestFrame(ITEM_INFO* item)
|
int16_t *GetBestFrame(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
int16_t* frmptr[2];
|
int16_t *frmptr[2];
|
||||||
int32_t rate;
|
int32_t rate;
|
||||||
int32_t frac = GetFrames(item, frmptr, &rate);
|
int32_t frac = GetFrames(item, frmptr, &rate);
|
||||||
if (frac <= rate / 2) {
|
if (frac <= rate / 2) {
|
||||||
|
|
|
@ -8,18 +8,18 @@ int32_t DrawPhaseCinematic();
|
||||||
int32_t DrawPhaseGame();
|
int32_t DrawPhaseGame();
|
||||||
void DrawRooms(int16_t current_room);
|
void DrawRooms(int16_t current_room);
|
||||||
void GetRoomBounds(int16_t room_num);
|
void GetRoomBounds(int16_t room_num);
|
||||||
int32_t SetRoomBounds(int16_t* objptr, int16_t room_num, ROOM_INFO* parent);
|
int32_t SetRoomBounds(int16_t *objptr, int16_t room_num, ROOM_INFO *parent);
|
||||||
void PrintRooms(int16_t room_number);
|
void PrintRooms(int16_t room_number);
|
||||||
void DrawEffect(int16_t fxnum);
|
void DrawEffect(int16_t fxnum);
|
||||||
void DrawSpriteItem(ITEM_INFO* item);
|
void DrawSpriteItem(ITEM_INFO *item);
|
||||||
void DrawDummyItem(ITEM_INFO* item);
|
void DrawDummyItem(ITEM_INFO *item);
|
||||||
void DrawAnimatingItem(ITEM_INFO* item);
|
void DrawAnimatingItem(ITEM_INFO *item);
|
||||||
void DrawUnclippedItem(ITEM_INFO* item);
|
void DrawUnclippedItem(ITEM_INFO *item);
|
||||||
void DrawLara(ITEM_INFO* item);
|
void DrawLara(ITEM_INFO *item);
|
||||||
void DrawGunFlash(int32_t weapon_type, int32_t clip);
|
void DrawGunFlash(int32_t weapon_type, int32_t clip);
|
||||||
void CalculateObjectLighting(ITEM_INFO* item, int16_t* frame);
|
void CalculateObjectLighting(ITEM_INFO *item, int16_t *frame);
|
||||||
void DrawLaraInt(
|
void DrawLaraInt(
|
||||||
ITEM_INFO* item, int16_t* frame1, int16_t* frame2, int32_t frac,
|
ITEM_INFO *item, int16_t *frame1, int16_t *frame2, int32_t frac,
|
||||||
int32_t rate);
|
int32_t rate);
|
||||||
void InitInterpolate(int32_t frac, int32_t rate);
|
void InitInterpolate(int32_t frac, int32_t rate);
|
||||||
|
|
||||||
|
@ -33,13 +33,13 @@ void phd_RotX_I(int16_t ang);
|
||||||
void phd_RotZ_I(int16_t ang);
|
void phd_RotZ_I(int16_t ang);
|
||||||
void phd_RotYXZ_I(int16_t y, int16_t x, int16_t z);
|
void phd_RotYXZ_I(int16_t y, int16_t x, int16_t z);
|
||||||
void phd_RotYXZpack_I(int32_t r1, int32_t r2);
|
void phd_RotYXZpack_I(int32_t r1, int32_t r2);
|
||||||
void phd_PutPolygons_I(int16_t* ptr, int32_t clip);
|
void phd_PutPolygons_I(int16_t *ptr, int32_t clip);
|
||||||
|
|
||||||
void InterpolateMatrix();
|
void InterpolateMatrix();
|
||||||
void InterpolateArmMatrix();
|
void InterpolateArmMatrix();
|
||||||
int32_t GetFrames(ITEM_INFO* item, int16_t* frmptr[], int32_t* rate);
|
int32_t GetFrames(ITEM_INFO *item, int16_t *frmptr[], int32_t *rate);
|
||||||
int16_t* GetBoundsAccurate(ITEM_INFO* item);
|
int16_t *GetBoundsAccurate(ITEM_INFO *item);
|
||||||
int16_t* GetBestFrame(ITEM_INFO* item);
|
int16_t *GetBestFrame(ITEM_INFO *item);
|
||||||
|
|
||||||
void T1MInjectGameDraw();
|
void T1MInjectGameDraw();
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,14 @@
|
||||||
#define FLIPFLAG 0x40
|
#define FLIPFLAG 0x40
|
||||||
#define UNFLIPFLAG 0x80
|
#define UNFLIPFLAG 0x80
|
||||||
|
|
||||||
void (*EffectRoutines[])(ITEM_INFO* item) = {
|
void (*EffectRoutines[])(ITEM_INFO *item) = {
|
||||||
FxTurn180, FxDinoStomp, FxLaraNormal, FxLaraBubbles, FxFinishLevel,
|
FxTurn180, FxDinoStomp, FxLaraNormal, FxLaraBubbles, FxFinishLevel,
|
||||||
FxEarthQuake, FxFlood, FxRaisingBlock, FxStairs2Slope, FxSand,
|
FxEarthQuake, FxFlood, FxRaisingBlock, FxStairs2Slope, FxSand,
|
||||||
FxPowerUp, FxExplosion, FxLaraHandsFree, FxFlipMap, FxDrawRightGun,
|
FxPowerUp, FxExplosion, FxLaraHandsFree, FxFlipMap, FxDrawRightGun,
|
||||||
FxChainBlock, FxFlicker,
|
FxChainBlock, FxFlicker,
|
||||||
};
|
};
|
||||||
|
|
||||||
int32_t ItemNearLara(PHD_3DPOS* pos, int32_t distance)
|
int32_t ItemNearLara(PHD_3DPOS *pos, int32_t distance)
|
||||||
{
|
{
|
||||||
int32_t x = pos->x - LaraItem->pos.x;
|
int32_t x = pos->x - LaraItem->pos.x;
|
||||||
int32_t y = pos->y - LaraItem->pos.y;
|
int32_t y = pos->y - LaraItem->pos.y;
|
||||||
|
@ -32,7 +32,7 @@ int32_t ItemNearLara(PHD_3DPOS* pos, int32_t distance)
|
||||||
if (x >= -distance && x <= distance && z >= -distance && z <= distance
|
if (x >= -distance && x <= distance && z >= -distance && z <= distance
|
||||||
&& y >= -WALL_L * 3 && y <= WALL_L * 3
|
&& y >= -WALL_L * 3 && y <= WALL_L * 3
|
||||||
&& SQUARE(x) + SQUARE(z) <= SQUARE(distance)) {
|
&& SQUARE(x) + SQUARE(z) <= SQUARE(distance)) {
|
||||||
int16_t* bounds = GetBoundsAccurate(LaraItem);
|
int16_t *bounds = GetBoundsAccurate(LaraItem);
|
||||||
if (y >= bounds[FRAME_BOUND_MIN_Y]
|
if (y >= bounds[FRAME_BOUND_MIN_Y]
|
||||||
&& y <= bounds[FRAME_BOUND_MAX_Y] + 100) {
|
&& y <= bounds[FRAME_BOUND_MAX_Y] + 100) {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -47,11 +47,11 @@ void SoundEffects()
|
||||||
mn_reset_ambient_loudness();
|
mn_reset_ambient_loudness();
|
||||||
|
|
||||||
for (int i = 0; i < NumberSoundEffects; i++) {
|
for (int i = 0; i < NumberSoundEffects; i++) {
|
||||||
OBJECT_VECTOR* sound = &SoundEffectsTable[i];
|
OBJECT_VECTOR *sound = &SoundEffectsTable[i];
|
||||||
if (FlipStatus && (sound->flags & FLIPFLAG)) {
|
if (FlipStatus && (sound->flags & FLIPFLAG)) {
|
||||||
SoundEffect(sound->data, (PHD_3DPOS*)sound, 0);
|
SoundEffect(sound->data, (PHD_3DPOS *)sound, 0);
|
||||||
} else if (!FlipStatus && (sound->flags & UNFLIPFLAG)) {
|
} else if (!FlipStatus && (sound->flags & UNFLIPFLAG)) {
|
||||||
SoundEffect(sound->data, (PHD_3DPOS*)&sound->x, 0);
|
SoundEffect(sound->data, (PHD_3DPOS *)&sound->x, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ int16_t DoBloodSplat(
|
||||||
{
|
{
|
||||||
int16_t fx_num = CreateEffect(room_num);
|
int16_t fx_num = CreateEffect(room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &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;
|
||||||
|
@ -85,7 +85,7 @@ int16_t DoBloodSplat(
|
||||||
|
|
||||||
void ControlBlood1(int16_t fx_num)
|
void ControlBlood1(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.x += (phd_sin(fx->pos.y_rot) * fx->speed) >> W2V_SHIFT;
|
fx->pos.x += (phd_sin(fx->pos.y_rot) * fx->speed) >> W2V_SHIFT;
|
||||||
fx->pos.z += (phd_cos(fx->pos.y_rot) * fx->speed) >> W2V_SHIFT;
|
fx->pos.z += (phd_cos(fx->pos.y_rot) * fx->speed) >> W2V_SHIFT;
|
||||||
fx->counter++;
|
fx->counter++;
|
||||||
|
@ -100,7 +100,7 @@ void ControlBlood1(int16_t fx_num)
|
||||||
|
|
||||||
void ControlExplosion1(int16_t fx_num)
|
void ControlExplosion1(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->counter++;
|
fx->counter++;
|
||||||
if (fx->counter == 2) {
|
if (fx->counter == 2) {
|
||||||
fx->counter = 0;
|
fx->counter = 0;
|
||||||
|
@ -111,11 +111,11 @@ void ControlExplosion1(int16_t fx_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ricochet(GAME_VECTOR* pos)
|
void Ricochet(GAME_VECTOR *pos)
|
||||||
{
|
{
|
||||||
int16_t fx_num = CreateEffect(pos->room_number);
|
int16_t fx_num = CreateEffect(pos->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.x = pos->x;
|
fx->pos.x = pos->x;
|
||||||
fx->pos.y = pos->y;
|
fx->pos.y = pos->y;
|
||||||
fx->pos.z = pos->z;
|
fx->pos.z = pos->z;
|
||||||
|
@ -128,18 +128,18 @@ void Ricochet(GAME_VECTOR* pos)
|
||||||
|
|
||||||
void ControlRicochet1(int16_t fx_num)
|
void ControlRicochet1(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->counter--;
|
fx->counter--;
|
||||||
if (!fx->counter) {
|
if (!fx->counter) {
|
||||||
KillEffect(fx_num);
|
KillEffect(fx_num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Twinkle(GAME_VECTOR* pos)
|
void Twinkle(GAME_VECTOR *pos)
|
||||||
{
|
{
|
||||||
int16_t fx_num = CreateEffect(pos->room_number);
|
int16_t fx_num = CreateEffect(pos->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.x = pos->x;
|
fx->pos.x = pos->x;
|
||||||
fx->pos.y = pos->y;
|
fx->pos.y = pos->y;
|
||||||
fx->pos.z = pos->z;
|
fx->pos.z = pos->z;
|
||||||
|
@ -151,7 +151,7 @@ void Twinkle(GAME_VECTOR* pos)
|
||||||
|
|
||||||
void ControlTwinkle(int16_t fx_num)
|
void ControlTwinkle(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->counter++;
|
fx->counter++;
|
||||||
if (fx->counter == 1) {
|
if (fx->counter == 1) {
|
||||||
fx->counter = 0;
|
fx->counter = 0;
|
||||||
|
@ -162,7 +162,7 @@ void ControlTwinkle(int16_t fx_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ItemSparkle(ITEM_INFO* item, int meshmask)
|
void ItemSparkle(ITEM_INFO *item, int meshmask)
|
||||||
{
|
{
|
||||||
SPHERE slist[34];
|
SPHERE slist[34];
|
||||||
GAME_VECTOR effect_pos;
|
GAME_VECTOR effect_pos;
|
||||||
|
@ -171,7 +171,7 @@ void ItemSparkle(ITEM_INFO* item, int meshmask)
|
||||||
effect_pos.room_number = item->room_number;
|
effect_pos.room_number = item->room_number;
|
||||||
for (int i = 0; i < num; i++) {
|
for (int i = 0; i < num; i++) {
|
||||||
if (meshmask & (1 << i)) {
|
if (meshmask & (1 << i)) {
|
||||||
SPHERE* sptr = &slist[i];
|
SPHERE *sptr = &slist[i];
|
||||||
effect_pos.x =
|
effect_pos.x =
|
||||||
sptr->x + sptr->r * (GetRandomDraw() - 0x4000) / 0x4000;
|
sptr->x + sptr->r * (GetRandomDraw() - 0x4000) / 0x4000;
|
||||||
effect_pos.y =
|
effect_pos.y =
|
||||||
|
@ -184,7 +184,7 @@ void ItemSparkle(ITEM_INFO* item, int meshmask)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: LaraBubbles
|
// original name: LaraBubbles
|
||||||
void FxLaraBubbles(ITEM_INFO* item)
|
void FxLaraBubbles(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
#ifdef T1M_FEAT_CHEATS
|
#ifdef T1M_FEAT_CHEATS
|
||||||
// NOTE: until we get Robolara, it makes sense for her to breathe underwater
|
// NOTE: until we get Robolara, it makes sense for her to breathe underwater
|
||||||
|
@ -210,7 +210,7 @@ void FxLaraBubbles(ITEM_INFO* item)
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
int16_t fx_num = CreateEffect(item->room_number);
|
int16_t fx_num = CreateEffect(item->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &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;
|
||||||
|
@ -223,7 +223,7 @@ void FxLaraBubbles(ITEM_INFO* item)
|
||||||
|
|
||||||
void ControlBubble1(int16_t fx_num)
|
void ControlBubble1(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.y_rot += 9 * PHD_DEGREE;
|
fx->pos.y_rot += 9 * PHD_DEGREE;
|
||||||
fx->pos.x_rot += 13 * PHD_DEGREE;
|
fx->pos.x_rot += 13 * PHD_DEGREE;
|
||||||
|
|
||||||
|
@ -232,7 +232,7 @@ void ControlBubble1(int16_t fx_num)
|
||||||
int32_t z = fx->pos.z + ((phd_cos(fx->pos.x_rot) * 8) >> W2V_SHIFT);
|
int32_t z = fx->pos.z + ((phd_cos(fx->pos.x_rot) * 8) >> W2V_SHIFT);
|
||||||
|
|
||||||
int16_t room_num = fx->room_number;
|
int16_t room_num = fx->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &room_num);
|
||||||
if (!floor || !(RoomInfo[room_num].flags & RF_UNDERWATER)) {
|
if (!floor || !(RoomInfo[room_num].flags & RF_UNDERWATER)) {
|
||||||
KillEffect(fx_num);
|
KillEffect(fx_num);
|
||||||
return;
|
return;
|
||||||
|
@ -252,7 +252,7 @@ void ControlBubble1(int16_t fx_num)
|
||||||
fx->pos.z = z;
|
fx->pos.z = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Splash(ITEM_INFO* item)
|
void Splash(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
int16_t wh = GetWaterHeight(
|
int16_t wh = GetWaterHeight(
|
||||||
item->pos.x, item->pos.y, item->pos.z, item->room_number);
|
item->pos.x, item->pos.y, item->pos.z, item->room_number);
|
||||||
|
@ -264,7 +264,7 @@ void Splash(ITEM_INFO* item)
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
int16_t fx_num = CreateEffect(room_num);
|
int16_t fx_num = CreateEffect(room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.x = item->pos.x;
|
fx->pos.x = item->pos.x;
|
||||||
fx->pos.y = wh;
|
fx->pos.y = wh;
|
||||||
fx->pos.z = item->pos.z;
|
fx->pos.z = item->pos.z;
|
||||||
|
@ -278,7 +278,7 @@ void Splash(ITEM_INFO* item)
|
||||||
|
|
||||||
void ControlSplash1(int16_t fx_num)
|
void ControlSplash1(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->frame_number--;
|
fx->frame_number--;
|
||||||
if (fx->frame_number <= Objects[fx->object_number].nmeshes) {
|
if (fx->frame_number <= Objects[fx->object_number].nmeshes) {
|
||||||
KillEffect(fx_num);
|
KillEffect(fx_num);
|
||||||
|
@ -292,7 +292,7 @@ void ControlSplash1(int16_t fx_num)
|
||||||
// original name: WaterFall
|
// original name: WaterFall
|
||||||
void ControlWaterFall(int16_t item_num)
|
void ControlWaterFall(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if ((item->flags & IF_CODE_BITS) != IF_CODE_BITS) {
|
if ((item->flags & IF_CODE_BITS) != IF_CODE_BITS) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -305,7 +305,7 @@ void ControlWaterFall(int16_t item_num)
|
||||||
&& y >= -WF_RANGE && y <= WF_RANGE) {
|
&& y >= -WF_RANGE && y <= WF_RANGE) {
|
||||||
int16_t fx_num = CreateEffect(item->room_number);
|
int16_t fx_num = CreateEffect(item->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.x = item->pos.x
|
fx->pos.x = item->pos.x
|
||||||
+ ((GetRandomDraw() - 0x4000) << WALL_SHIFT) / 0x7FFF;
|
+ ((GetRandomDraw() - 0x4000) << WALL_SHIFT) / 0x7FFF;
|
||||||
fx->pos.z = item->pos.z
|
fx->pos.z = item->pos.z
|
||||||
|
@ -319,19 +319,19 @@ void ControlWaterFall(int16_t item_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: finish_level_effect
|
// original name: finish_level_effect
|
||||||
void FxFinishLevel(ITEM_INFO* item)
|
void FxFinishLevel(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
LevelComplete = 1;
|
LevelComplete = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: turn180_effect
|
// original name: turn180_effect
|
||||||
void FxTurn180(ITEM_INFO* item)
|
void FxTurn180(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
item->pos.y_rot += PHD_180;
|
item->pos.y_rot += PHD_180;
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: dino_stomp_effect
|
// original name: dino_stomp_effect
|
||||||
void FxDinoStomp(ITEM_INFO* item)
|
void FxDinoStomp(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
int32_t dx = item->pos.x - Camera.pos.x;
|
int32_t dx = item->pos.x - Camera.pos.x;
|
||||||
int32_t dy = item->pos.y - Camera.pos.y;
|
int32_t dy = item->pos.y - Camera.pos.y;
|
||||||
|
@ -344,7 +344,7 @@ void FxDinoStomp(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: lara_normal_effect
|
// original name: lara_normal_effect
|
||||||
void FxLaraNormal(ITEM_INFO* item)
|
void FxLaraNormal(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
item->current_anim_state = AS_STOP;
|
item->current_anim_state = AS_STOP;
|
||||||
item->goal_anim_state = AS_STOP;
|
item->goal_anim_state = AS_STOP;
|
||||||
|
@ -359,7 +359,7 @@ void FxLaraNormal(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: EarthQuakeFX
|
// original name: EarthQuakeFX
|
||||||
void FxEarthQuake(ITEM_INFO* item)
|
void FxEarthQuake(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
if (FlipTimer == 0) {
|
if (FlipTimer == 0) {
|
||||||
SoundEffect(99, NULL, 0);
|
SoundEffect(99, NULL, 0);
|
||||||
|
@ -379,7 +379,7 @@ void FxEarthQuake(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: FloodFX
|
// original name: FloodFX
|
||||||
void FxFlood(ITEM_INFO* item)
|
void FxFlood(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
PHD_3DPOS pos;
|
PHD_3DPOS pos;
|
||||||
|
|
||||||
|
@ -400,14 +400,14 @@ void FxFlood(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: RaisingBlockFX
|
// original name: RaisingBlockFX
|
||||||
void FxRaisingBlock(ITEM_INFO* item)
|
void FxRaisingBlock(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
SoundEffect(117, NULL, 0);
|
SoundEffect(117, NULL, 0);
|
||||||
FlipEffect = -1;
|
FlipEffect = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: ChainBlockFX
|
// original name: ChainBlockFX
|
||||||
void FxChainBlock(ITEM_INFO* item)
|
void FxChainBlock(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
#ifdef T1M_FEAT_OG_FIXES
|
#ifdef T1M_FEAT_OG_FIXES
|
||||||
if (T1MConfig.fix_tihocan_secret_sound) {
|
if (T1MConfig.fix_tihocan_secret_sound) {
|
||||||
|
@ -429,7 +429,7 @@ void FxChainBlock(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: Stairs2SlopeFX
|
// original name: Stairs2SlopeFX
|
||||||
void FxStairs2Slope(ITEM_INFO* item)
|
void FxStairs2Slope(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
if (FlipTimer == 5) {
|
if (FlipTimer == 5) {
|
||||||
SoundEffect(119, NULL, 0);
|
SoundEffect(119, NULL, 0);
|
||||||
|
@ -439,7 +439,7 @@ void FxStairs2Slope(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: SandFX
|
// original name: SandFX
|
||||||
void FxSand(ITEM_INFO* item)
|
void FxSand(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
PHD_3DPOS pos;
|
PHD_3DPOS pos;
|
||||||
if (FlipTimer > 120) {
|
if (FlipTimer > 120) {
|
||||||
|
@ -457,7 +457,7 @@ void FxSand(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: PowerUpFX
|
// original name: PowerUpFX
|
||||||
void FxPowerUp(ITEM_INFO* item)
|
void FxPowerUp(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
PHD_3DPOS pos;
|
PHD_3DPOS pos;
|
||||||
if (FlipTimer > 120) {
|
if (FlipTimer > 120) {
|
||||||
|
@ -472,7 +472,7 @@ void FxPowerUp(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: ExplosionFX
|
// original name: ExplosionFX
|
||||||
void FxExplosion(ITEM_INFO* item)
|
void FxExplosion(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
SoundEffect(170, NULL, 0);
|
SoundEffect(170, NULL, 0);
|
||||||
Camera.bounce = -75;
|
Camera.bounce = -75;
|
||||||
|
@ -480,7 +480,7 @@ void FxExplosion(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: FlickerFX
|
// original name: FlickerFX
|
||||||
void FxFlicker(ITEM_INFO* item)
|
void FxFlicker(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
if (FlipTimer > 125) {
|
if (FlipTimer > 125) {
|
||||||
FlipMap();
|
FlipMap();
|
||||||
|
@ -494,22 +494,22 @@ void FxFlicker(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: lara_hands_free
|
// original name: lara_hands_free
|
||||||
void FxLaraHandsFree(ITEM_INFO* item)
|
void FxLaraHandsFree(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
Lara.gun_status = LGS_ARMLESS;
|
Lara.gun_status = LGS_ARMLESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: flip_map_effect
|
// original name: flip_map_effect
|
||||||
void FxFlipMap(ITEM_INFO* item)
|
void FxFlipMap(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
FlipMap();
|
FlipMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: draw_right_gun
|
// original name: draw_right_gun
|
||||||
void FxDrawRightGun(ITEM_INFO* item)
|
void FxDrawRightGun(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
int16_t* tmp_mesh;
|
int16_t *tmp_mesh;
|
||||||
OBJECT_INFO* obj = &Objects[item->object_number];
|
OBJECT_INFO *obj = &Objects[item->object_number];
|
||||||
tmp_mesh = Meshes[obj->mesh_index + LM_THIGH_R];
|
tmp_mesh = Meshes[obj->mesh_index + LM_THIGH_R];
|
||||||
Meshes[obj->mesh_index + LM_THIGH_R] =
|
Meshes[obj->mesh_index + LM_THIGH_R] =
|
||||||
Meshes[Objects[O_PISTOLS].mesh_index + LM_THIGH_R];
|
Meshes[Objects[O_PISTOLS].mesh_index + LM_THIGH_R];
|
||||||
|
|
|
@ -9,41 +9,41 @@
|
||||||
#define StopSoundEffect ((void (*)(int32_t sfx_num, PHD_3DPOS *pos))0x0042B300)
|
#define StopSoundEffect ((void (*)(int32_t sfx_num, PHD_3DPOS *pos))0x0042B300)
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
int32_t ItemNearLara(PHD_3DPOS* pos, int32_t distance);
|
int32_t ItemNearLara(PHD_3DPOS *pos, int32_t distance);
|
||||||
void SoundEffects();
|
void SoundEffects();
|
||||||
int16_t DoBloodSplat(
|
int16_t DoBloodSplat(
|
||||||
int32_t x, int32_t y, int32_t z, int16_t speed, int16_t direction,
|
int32_t x, int32_t y, int32_t z, int16_t speed, int16_t direction,
|
||||||
int16_t room_num);
|
int16_t room_num);
|
||||||
void ControlBlood1(int16_t fx_num);
|
void ControlBlood1(int16_t fx_num);
|
||||||
void ControlExplosion1(int16_t fx_num);
|
void ControlExplosion1(int16_t fx_num);
|
||||||
void Ricochet(GAME_VECTOR* pos);
|
void Ricochet(GAME_VECTOR *pos);
|
||||||
void ControlRicochet1(int16_t fx_num);
|
void ControlRicochet1(int16_t fx_num);
|
||||||
void Twinkle(GAME_VECTOR* pos);
|
void Twinkle(GAME_VECTOR *pos);
|
||||||
void ControlTwinkle(int16_t fx_num);
|
void ControlTwinkle(int16_t fx_num);
|
||||||
void ItemSparkle(ITEM_INFO* item, int meshmask);
|
void ItemSparkle(ITEM_INFO *item, int meshmask);
|
||||||
void FxLaraBubbles(ITEM_INFO* item);
|
void FxLaraBubbles(ITEM_INFO *item);
|
||||||
void ControlBubble1(int16_t fx_num);
|
void ControlBubble1(int16_t fx_num);
|
||||||
void Splash(ITEM_INFO* item);
|
void Splash(ITEM_INFO *item);
|
||||||
void ControlSplash1(int16_t fx_num);
|
void ControlSplash1(int16_t fx_num);
|
||||||
void ControlWaterFall(int16_t item_num);
|
void ControlWaterFall(int16_t item_num);
|
||||||
void FxFinishLevel(ITEM_INFO* item);
|
void FxFinishLevel(ITEM_INFO *item);
|
||||||
void FxTurn180(ITEM_INFO* item);
|
void FxTurn180(ITEM_INFO *item);
|
||||||
void FxDinoStomp(ITEM_INFO* item);
|
void FxDinoStomp(ITEM_INFO *item);
|
||||||
void FxLaraNormal(ITEM_INFO* item);
|
void FxLaraNormal(ITEM_INFO *item);
|
||||||
void FxEarthQuake(ITEM_INFO* item);
|
void FxEarthQuake(ITEM_INFO *item);
|
||||||
void FxFlood(ITEM_INFO* item);
|
void FxFlood(ITEM_INFO *item);
|
||||||
void FxRaisingBlock(ITEM_INFO* item);
|
void FxRaisingBlock(ITEM_INFO *item);
|
||||||
void FxChainBlock(ITEM_INFO* item);
|
void FxChainBlock(ITEM_INFO *item);
|
||||||
void FxStairs2Slope(ITEM_INFO* item);
|
void FxStairs2Slope(ITEM_INFO *item);
|
||||||
void FxSand(ITEM_INFO* item);
|
void FxSand(ITEM_INFO *item);
|
||||||
void FxPowerUp(ITEM_INFO* item);
|
void FxPowerUp(ITEM_INFO *item);
|
||||||
void FxExplosion(ITEM_INFO* item);
|
void FxExplosion(ITEM_INFO *item);
|
||||||
void FxFlicker(ITEM_INFO* item);
|
void FxFlicker(ITEM_INFO *item);
|
||||||
void FxLaraHandsFree(ITEM_INFO* item);
|
void FxLaraHandsFree(ITEM_INFO *item);
|
||||||
void FxFlipMap(ITEM_INFO* item);
|
void FxFlipMap(ITEM_INFO *item);
|
||||||
void FxDrawRightGun(ITEM_INFO* item);
|
void FxDrawRightGun(ITEM_INFO *item);
|
||||||
|
|
||||||
extern void (*EffectRoutines[])(ITEM_INFO* item);
|
extern void (*EffectRoutines[])(ITEM_INFO *item);
|
||||||
|
|
||||||
void T1MInjectGameEffects();
|
void T1MInjectGameEffects();
|
||||||
|
|
||||||
|
|
|
@ -256,7 +256,7 @@ int32_t GetRandomDraw()
|
||||||
void LevelStats(int32_t level_num)
|
void LevelStats(int32_t level_num)
|
||||||
{
|
{
|
||||||
static char string[100];
|
static char string[100];
|
||||||
TEXTSTRING* txt;
|
TEXTSTRING *txt;
|
||||||
|
|
||||||
TempVideoAdjust(HiRes, 1.0);
|
TempVideoAdjust(HiRes, 1.0);
|
||||||
T_InitPrint();
|
T_InitPrint();
|
||||||
|
@ -379,12 +379,12 @@ void LevelStats(int32_t level_num)
|
||||||
TempVideoRemove();
|
TempVideoRemove();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t S_LoadGame(void* data, int32_t size, int32_t slot)
|
int32_t S_LoadGame(void *data, int32_t size, int32_t slot)
|
||||||
{
|
{
|
||||||
char filename[80];
|
char filename[80];
|
||||||
sprintf(filename, "saveati.%d", slot);
|
sprintf(filename, "saveati.%d", slot);
|
||||||
TRACE("%s", filename);
|
TRACE("%s", filename);
|
||||||
FILE* fp = fopen(filename, "rb");
|
FILE *fp = fopen(filename, "rb");
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -396,7 +396,7 @@ int32_t S_LoadGame(void* data, int32_t size, int32_t slot)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetSavedGamesList(REQUEST_INFO* req)
|
void GetSavedGamesList(REQUEST_INFO *req)
|
||||||
{
|
{
|
||||||
switch (HiRes) {
|
switch (HiRes) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -427,7 +427,7 @@ void GetSavedGamesList(REQUEST_INFO* req)
|
||||||
|
|
||||||
int32_t S_FrontEndCheck()
|
int32_t S_FrontEndCheck()
|
||||||
{
|
{
|
||||||
REQUEST_INFO* req = &LoadGameRequester;
|
REQUEST_INFO *req = &LoadGameRequester;
|
||||||
|
|
||||||
req->items = 0;
|
req->items = 0;
|
||||||
SavedGamesCount = 0;
|
SavedGamesCount = 0;
|
||||||
|
@ -435,7 +435,7 @@ int32_t S_FrontEndCheck()
|
||||||
char filename[75];
|
char filename[75];
|
||||||
sprintf(filename, "saveati.%d", i);
|
sprintf(filename, "saveati.%d", i);
|
||||||
|
|
||||||
FILE* fp = fopen(filename, "rb");
|
FILE *fp = fopen(filename, "rb");
|
||||||
if (fp) {
|
if (fp) {
|
||||||
fread(filename, 1, 75, fp);
|
fread(filename, 1, 75, fp);
|
||||||
int32_t counter;
|
int32_t counter;
|
||||||
|
@ -467,13 +467,13 @@ int32_t S_FrontEndCheck()
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t S_SaveGame(void* data, int32_t size, int32_t slot)
|
int32_t S_SaveGame(void *data, int32_t size, int32_t slot)
|
||||||
{
|
{
|
||||||
char filename[75];
|
char filename[75];
|
||||||
sprintf(filename, "saveati.%d", slot);
|
sprintf(filename, "saveati.%d", slot);
|
||||||
TRACE("%s", filename);
|
TRACE("%s", filename);
|
||||||
|
|
||||||
FILE* fp = fopen(filename, "wb");
|
FILE *fp = fopen(filename, "wb");
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -484,7 +484,7 @@ int32_t S_SaveGame(void* data, int32_t size, int32_t slot)
|
||||||
fwrite(data, size, 1, fp);
|
fwrite(data, size, 1, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
REQUEST_INFO* req = &LoadGameRequester;
|
REQUEST_INFO *req = &LoadGameRequester;
|
||||||
sprintf(
|
sprintf(
|
||||||
&req->item_texts[req->item_text_len * slot], "%s %d", filename,
|
&req->item_texts[req->item_text_len * slot], "%s %d", filename,
|
||||||
SaveCounter);
|
SaveCounter);
|
||||||
|
|
|
@ -11,9 +11,9 @@ void SeedRandomDraw(int32_t seed);
|
||||||
int32_t GetRandomControl();
|
int32_t GetRandomControl();
|
||||||
int32_t GetRandomDraw();
|
int32_t GetRandomDraw();
|
||||||
void LevelStats(int32_t level_num);
|
void LevelStats(int32_t level_num);
|
||||||
int32_t S_LoadGame(void* data, int32_t size, int32_t slot);
|
int32_t S_LoadGame(void *data, int32_t size, int32_t slot);
|
||||||
void GetSavedGamesList(REQUEST_INFO* req);
|
void GetSavedGamesList(REQUEST_INFO *req);
|
||||||
int32_t S_SaveGame(void* data, int32_t size, int32_t slot);
|
int32_t S_SaveGame(void *data, int32_t size, int32_t slot);
|
||||||
|
|
||||||
void T1MInjectGameGame();
|
void T1MInjectGameGame();
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ void InitialiseHair()
|
||||||
{
|
{
|
||||||
FirstHair = 1;
|
FirstHair = 1;
|
||||||
|
|
||||||
int32_t* bone = &AnimBones[Objects[O_HAIR].bone_index];
|
int32_t *bone = &AnimBones[Objects[O_HAIR].bone_index];
|
||||||
|
|
||||||
Hair[0].y_rot = 0;
|
Hair[0].y_rot = 0;
|
||||||
Hair[0].x_rot = -PHD_90;
|
Hair[0].x_rot = -PHD_90;
|
||||||
|
@ -46,11 +46,11 @@ void HairControl(int in_cutscene)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJECT_INFO* object;
|
OBJECT_INFO *object;
|
||||||
int32_t *bone, distance;
|
int32_t *bone, distance;
|
||||||
int16_t *frame, *objptr, room_number;
|
int16_t *frame, *objptr, room_number;
|
||||||
PHD_VECTOR pos;
|
PHD_VECTOR pos;
|
||||||
FLOOR_INFO* floor;
|
FLOOR_INFO *floor;
|
||||||
int32_t i, water_level, height, size;
|
int32_t i, water_level, height, size;
|
||||||
SPHERE sphere[5];
|
SPHERE sphere[5];
|
||||||
int32_t j, x, y, z;
|
int32_t j, x, y, z;
|
||||||
|
@ -95,7 +95,7 @@ void HairControl(int in_cutscene)
|
||||||
|
|
||||||
phd_TranslateRel(
|
phd_TranslateRel(
|
||||||
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
||||||
int32_t* packed_rotation = (int32_t*)(frame + FRAME_ROT);
|
int32_t *packed_rotation = (int32_t *)(frame + FRAME_ROT);
|
||||||
phd_RotYXZpack(packed_rotation[LM_HIPS]);
|
phd_RotYXZpack(packed_rotation[LM_HIPS]);
|
||||||
|
|
||||||
// hips
|
// hips
|
||||||
|
@ -300,8 +300,8 @@ void DrawHair()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
OBJECT_INFO* object = &Objects[O_HAIR];
|
OBJECT_INFO *object = &Objects[O_HAIR];
|
||||||
int16_t** mesh = &Meshes[object->mesh_index];
|
int16_t **mesh = &Meshes[object->mesh_index];
|
||||||
|
|
||||||
for (int i = 0; i < HAIR_SEGMENTS; i++) {
|
for (int i = 0; i < HAIR_SEGMENTS; i++) {
|
||||||
phd_PushMatrix();
|
phd_PushMatrix();
|
||||||
|
|
|
@ -186,9 +186,9 @@ void DrawAmmoInfo()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeAmmoString(char* string)
|
void MakeAmmoString(char *string)
|
||||||
{
|
{
|
||||||
char* c;
|
char *c;
|
||||||
|
|
||||||
for (c = string; *c != 0; c++) {
|
for (c = string; *c != 0; c++) {
|
||||||
if (*c == 32) {
|
if (*c == 32) {
|
||||||
|
@ -224,7 +224,7 @@ void DrawPickups()
|
||||||
int32_t y = PhdWinHeight - sprite_height;
|
int32_t y = PhdWinHeight - sprite_height;
|
||||||
int32_t x = PhdWinWidth - sprite_height;
|
int32_t x = PhdWinWidth - sprite_height;
|
||||||
for (int i = 0; i < MAX_PICKUPS; i++) {
|
for (int i = 0; i < MAX_PICKUPS; i++) {
|
||||||
DISPLAYPU* pu = &Pickups[i];
|
DISPLAYPU *pu = &Pickups[i];
|
||||||
pu->duration -= time;
|
pu->duration -= time;
|
||||||
if (pu->duration <= 0) {
|
if (pu->duration <= 0) {
|
||||||
pu->duration = 0;
|
pu->duration = 0;
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void MakeAmmoString(char* string);
|
void MakeAmmoString(char *string);
|
||||||
void DrawAmmoInfo();
|
void DrawAmmoInfo();
|
||||||
void DrawGameInfo();
|
void DrawGameInfo();
|
||||||
void DrawHealthBar();
|
void DrawHealthBar();
|
||||||
|
|
|
@ -6,43 +6,43 @@
|
||||||
|
|
||||||
int32_t Display_Inventory(int inv_mode);
|
int32_t Display_Inventory(int inv_mode);
|
||||||
void Construct_Inventory();
|
void Construct_Inventory();
|
||||||
void SelectMeshes(INVENTORY_ITEM* inv_item);
|
void SelectMeshes(INVENTORY_ITEM *inv_item);
|
||||||
int32_t AnimateInventoryItem(INVENTORY_ITEM* inv_item);
|
int32_t AnimateInventoryItem(INVENTORY_ITEM *inv_item);
|
||||||
void DrawInventoryItem(INVENTORY_ITEM* inv_item);
|
void DrawInventoryItem(INVENTORY_ITEM *inv_item);
|
||||||
int32_t GetDebouncedInput(int32_t input);
|
int32_t GetDebouncedInput(int32_t input);
|
||||||
|
|
||||||
void InitColours();
|
void InitColours();
|
||||||
void RingIsOpen(RING_INFO* ring);
|
void RingIsOpen(RING_INFO *ring);
|
||||||
void RingIsNotOpen(RING_INFO* ring);
|
void RingIsNotOpen(RING_INFO *ring);
|
||||||
void RingNotActive(INVENTORY_ITEM* inv_item);
|
void RingNotActive(INVENTORY_ITEM *inv_item);
|
||||||
void RingActive();
|
void RingActive();
|
||||||
|
|
||||||
int32_t Inv_AddItem(int32_t item_num);
|
int32_t Inv_AddItem(int32_t item_num);
|
||||||
void Inv_InsertItem(INVENTORY_ITEM* inv_item);
|
void Inv_InsertItem(INVENTORY_ITEM *inv_item);
|
||||||
int32_t Inv_RequestItem(int item_num);
|
int32_t Inv_RequestItem(int item_num);
|
||||||
void Inv_RemoveAllItems();
|
void Inv_RemoveAllItems();
|
||||||
int32_t Inv_RemoveItem(int32_t item_num);
|
int32_t Inv_RemoveItem(int32_t item_num);
|
||||||
int32_t Inv_GetItemOption(int32_t item_num);
|
int32_t Inv_GetItemOption(int32_t item_num);
|
||||||
void RemoveInventoryText();
|
void RemoveInventoryText();
|
||||||
void Inv_RingInit(
|
void Inv_RingInit(
|
||||||
RING_INFO* ring, int16_t type, INVENTORY_ITEM** list, int16_t qty,
|
RING_INFO *ring, int16_t type, INVENTORY_ITEM **list, int16_t qty,
|
||||||
int16_t current, IMOTION_INFO* imo);
|
int16_t current, IMOTION_INFO *imo);
|
||||||
void Inv_RingGetView(RING_INFO* a1, PHD_3DPOS* viewer);
|
void Inv_RingGetView(RING_INFO *a1, PHD_3DPOS *viewer);
|
||||||
void Inv_RingLight(RING_INFO* ring);
|
void Inv_RingLight(RING_INFO *ring);
|
||||||
void Inv_RingCalcAdders(RING_INFO* ring, int16_t rotation_duration);
|
void Inv_RingCalcAdders(RING_INFO *ring, int16_t rotation_duration);
|
||||||
void Inv_RingDoMotions(RING_INFO* ring);
|
void Inv_RingDoMotions(RING_INFO *ring);
|
||||||
void Inv_RingRotateLeft(RING_INFO* ring);
|
void Inv_RingRotateLeft(RING_INFO *ring);
|
||||||
void Inv_RingRotateRight(RING_INFO* ring);
|
void Inv_RingRotateRight(RING_INFO *ring);
|
||||||
void Inv_RingMotionInit(
|
void Inv_RingMotionInit(
|
||||||
RING_INFO* ring, int16_t frames, int16_t status, int16_t status_target);
|
RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target);
|
||||||
void Inv_RingMotionSetup(
|
void Inv_RingMotionSetup(
|
||||||
RING_INFO* ring, int16_t status, int16_t status_target, int16_t frames);
|
RING_INFO *ring, int16_t status, int16_t status_target, int16_t frames);
|
||||||
void Inv_RingMotionRadius(RING_INFO* ring, int16_t target);
|
void Inv_RingMotionRadius(RING_INFO *ring, int16_t target);
|
||||||
void Inv_RingMotionRotation(RING_INFO* ring, int16_t rotation, int16_t target);
|
void Inv_RingMotionRotation(RING_INFO *ring, int16_t rotation, int16_t target);
|
||||||
void Inv_RingMotionCameraPos(RING_INFO* ring, int16_t target);
|
void Inv_RingMotionCameraPos(RING_INFO *ring, int16_t target);
|
||||||
void Inv_RingMotionCameraPitch(RING_INFO* ring, int16_t target);
|
void Inv_RingMotionCameraPitch(RING_INFO *ring, int16_t target);
|
||||||
void Inv_RingMotionItemSelect(RING_INFO* ring, INVENTORY_ITEM* inv_item);
|
void Inv_RingMotionItemSelect(RING_INFO *ring, INVENTORY_ITEM *inv_item);
|
||||||
void Inv_RingMotionItemDeselect(RING_INFO* ring, INVENTORY_ITEM* inv_item);
|
void Inv_RingMotionItemDeselect(RING_INFO *ring, INVENTORY_ITEM *inv_item);
|
||||||
|
|
||||||
void T1MInjectGameInvEntry();
|
void T1MInjectGameInvEntry();
|
||||||
void T1MInjectGameInvFunc();
|
void T1MInjectGameInvFunc();
|
||||||
|
|
|
@ -145,7 +145,7 @@ int32_t Display_Inventory(int inv_mode)
|
||||||
|
|
||||||
PHD_ANGLE angle = 0;
|
PHD_ANGLE angle = 0;
|
||||||
for (int i = 0; i < ring.number_of_objects; i++) {
|
for (int i = 0; i < ring.number_of_objects; i++) {
|
||||||
INVENTORY_ITEM* inv_item = ring.list[i];
|
INVENTORY_ITEM *inv_item = ring.list[i];
|
||||||
|
|
||||||
if (i == ring.current_object) {
|
if (i == ring.current_object) {
|
||||||
for (int j = 0; j < InvNFrames; j++) {
|
for (int j = 0; j < InvNFrames; j++) {
|
||||||
|
@ -300,7 +300,7 @@ int32_t Display_Inventory(int inv_mode)
|
||||||
|
|
||||||
Item_Data = 0;
|
Item_Data = 0;
|
||||||
|
|
||||||
INVENTORY_ITEM* inv_item;
|
INVENTORY_ITEM *inv_item;
|
||||||
if (ring.type == RT_MAIN) {
|
if (ring.type == RT_MAIN) {
|
||||||
InvMainCurrent = ring.current_object;
|
InvMainCurrent = ring.current_object;
|
||||||
inv_item = InvMainList[ring.current_object];
|
inv_item = InvMainList[ring.current_object];
|
||||||
|
@ -492,7 +492,7 @@ int32_t Display_Inventory(int inv_mode)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RNG_SELECTED: {
|
case RNG_SELECTED: {
|
||||||
INVENTORY_ITEM* inv_item = ring.list[ring.current_object];
|
INVENTORY_ITEM *inv_item = ring.list[ring.current_object];
|
||||||
if (inv_item->object_number == O_PASSPORT_CLOSED) {
|
if (inv_item->object_number == O_PASSPORT_CLOSED) {
|
||||||
inv_item->object_number = O_PASSPORT_OPTION;
|
inv_item->object_number = O_PASSPORT_OPTION;
|
||||||
}
|
}
|
||||||
|
@ -562,7 +562,7 @@ int32_t Display_Inventory(int inv_mode)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RNG_CLOSING_ITEM: {
|
case RNG_CLOSING_ITEM: {
|
||||||
INVENTORY_ITEM* inv_item = ring.list[ring.current_object];
|
INVENTORY_ITEM *inv_item = ring.list[ring.current_object];
|
||||||
for (int j = 0; j < InvNFrames; j++) {
|
for (int j = 0; j < InvNFrames; j++) {
|
||||||
if (!AnimateInventoryItem(inv_item)) {
|
if (!AnimateInventoryItem(inv_item)) {
|
||||||
if (inv_item->object_number == O_PASSPORT_OPTION) {
|
if (inv_item->object_number == O_PASSPORT_OPTION) {
|
||||||
|
@ -672,7 +672,7 @@ void Construct_Inventory()
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < InvMainObjects; i++) {
|
for (int i = 0; i < InvMainObjects; i++) {
|
||||||
INVENTORY_ITEM* inv_item = InvMainList[i];
|
INVENTORY_ITEM *inv_item = InvMainList[i];
|
||||||
inv_item->drawn_meshes = inv_item->which_meshes;
|
inv_item->drawn_meshes = inv_item->which_meshes;
|
||||||
if ((inv_item->object_number == O_MAP_OPTION) && CompassStatus) {
|
if ((inv_item->object_number == O_MAP_OPTION) && CompassStatus) {
|
||||||
inv_item->current_frame = inv_item->open_frame;
|
inv_item->current_frame = inv_item->open_frame;
|
||||||
|
@ -686,7 +686,7 @@ void Construct_Inventory()
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < InvOptionObjects; i++) {
|
for (int i = 0; i < InvOptionObjects; i++) {
|
||||||
INVENTORY_ITEM* inv_item = InvOptionList[i];
|
INVENTORY_ITEM *inv_item = InvOptionList[i];
|
||||||
inv_item->current_frame = 0;
|
inv_item->current_frame = 0;
|
||||||
inv_item->goal_frame = 0;
|
inv_item->goal_frame = 0;
|
||||||
inv_item->anim_count = 0;
|
inv_item->anim_count = 0;
|
||||||
|
@ -698,7 +698,7 @@ void Construct_Inventory()
|
||||||
Item_Data = 0;
|
Item_Data = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t AnimateInventoryItem(INVENTORY_ITEM* inv_item)
|
int32_t AnimateInventoryItem(INVENTORY_ITEM *inv_item)
|
||||||
{
|
{
|
||||||
if (inv_item->current_frame == inv_item->goal_frame) {
|
if (inv_item->current_frame == inv_item->goal_frame) {
|
||||||
SelectMeshes(inv_item);
|
SelectMeshes(inv_item);
|
||||||
|
@ -719,7 +719,7 @@ int32_t AnimateInventoryItem(INVENTORY_ITEM* inv_item)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SelectMeshes(INVENTORY_ITEM* inv_item)
|
void SelectMeshes(INVENTORY_ITEM *inv_item)
|
||||||
{
|
{
|
||||||
if (inv_item->object_number == O_PASSPORT_OPTION) {
|
if (inv_item->object_number == O_PASSPORT_OPTION) {
|
||||||
if (inv_item->current_frame <= 14) {
|
if (inv_item->current_frame <= 14) {
|
||||||
|
@ -746,12 +746,12 @@ void SelectMeshes(INVENTORY_ITEM* inv_item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawInventoryItem(INVENTORY_ITEM* inv_item)
|
void DrawInventoryItem(INVENTORY_ITEM *inv_item)
|
||||||
{
|
{
|
||||||
phd_TranslateRel(0, inv_item->ytrans, inv_item->ztrans);
|
phd_TranslateRel(0, inv_item->ytrans, inv_item->ztrans);
|
||||||
phd_RotYXZ(inv_item->y_rot, inv_item->x_rot, 0);
|
phd_RotYXZ(inv_item->y_rot, inv_item->x_rot, 0);
|
||||||
|
|
||||||
OBJECT_INFO* obj = &Objects[inv_item->object_number];
|
OBJECT_INFO *obj = &Objects[inv_item->object_number];
|
||||||
if (obj->nmeshes < 0) {
|
if (obj->nmeshes < 0) {
|
||||||
S_DrawSpriteRel(0, 0, 0, obj->mesh_index, 4096);
|
S_DrawSpriteRel(0, 0, 0, obj->mesh_index, 4096);
|
||||||
return;
|
return;
|
||||||
|
@ -763,8 +763,8 @@ void DrawInventoryItem(INVENTORY_ITEM* inv_item)
|
||||||
int32_t sx = PhdCenterX + PhdMatrixPtr->_03 / zp;
|
int32_t sx = PhdCenterX + PhdMatrixPtr->_03 / zp;
|
||||||
int32_t sy = PhdCenterY + PhdMatrixPtr->_13 / zp;
|
int32_t sy = PhdCenterY + PhdMatrixPtr->_13 / zp;
|
||||||
|
|
||||||
INVENTORY_SPRITE** sprlist = inv_item->sprlist;
|
INVENTORY_SPRITE **sprlist = inv_item->sprlist;
|
||||||
INVENTORY_SPRITE* spr;
|
INVENTORY_SPRITE *spr;
|
||||||
while ((spr = *sprlist++)) {
|
while ((spr = *sprlist++)) {
|
||||||
if (zv < PhdNearZ || zv > PhdFarZ) {
|
if (zv < PhdNearZ || zv > PhdFarZ) {
|
||||||
break;
|
break;
|
||||||
|
@ -800,7 +800,7 @@ void DrawInventoryItem(INVENTORY_ITEM* inv_item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t* frame =
|
int16_t *frame =
|
||||||
&obj->frame_base[inv_item->current_frame * (obj->nmeshes * 2 + 10)];
|
&obj->frame_base[inv_item->current_frame * (obj->nmeshes * 2 + 10)];
|
||||||
|
|
||||||
phd_PushMatrix();
|
phd_PushMatrix();
|
||||||
|
@ -809,12 +809,12 @@ void DrawInventoryItem(INVENTORY_ITEM* inv_item)
|
||||||
if (clip) {
|
if (clip) {
|
||||||
phd_TranslateRel(
|
phd_TranslateRel(
|
||||||
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
||||||
int32_t* packed_rotation = (int32_t*)(frame + FRAME_ROT);
|
int32_t *packed_rotation = (int32_t *)(frame + FRAME_ROT);
|
||||||
phd_RotYXZpack(*packed_rotation++);
|
phd_RotYXZpack(*packed_rotation++);
|
||||||
|
|
||||||
int32_t mesh_num = 1;
|
int32_t mesh_num = 1;
|
||||||
|
|
||||||
int32_t* bone = &AnimBones[obj->bone_index];
|
int32_t *bone = &AnimBones[obj->bone_index];
|
||||||
if (inv_item->drawn_meshes & mesh_num) {
|
if (inv_item->drawn_meshes & mesh_num) {
|
||||||
phd_PutPolygons(Meshes[obj->mesh_index], clip);
|
phd_PutPolygons(Meshes[obj->mesh_index], clip);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ void InitColours()
|
||||||
InvColours[IC_MAGENTA] = S_Colour(255, 0, 255);
|
InvColours[IC_MAGENTA] = S_Colour(255, 0, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RingIsOpen(RING_INFO* ring)
|
void RingIsOpen(RING_INFO *ring)
|
||||||
{
|
{
|
||||||
if (InventoryMode == INV_TITLE_MODE) {
|
if (InventoryMode == INV_TITLE_MODE) {
|
||||||
return;
|
return;
|
||||||
|
@ -74,7 +74,7 @@ void RingIsOpen(RING_INFO* ring)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RingIsNotOpen(RING_INFO* ring)
|
void RingIsNotOpen(RING_INFO *ring)
|
||||||
{
|
{
|
||||||
if (!InvRingText) {
|
if (!InvRingText) {
|
||||||
return;
|
return;
|
||||||
|
@ -97,7 +97,7 @@ void RingIsNotOpen(RING_INFO* ring)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RingNotActive(INVENTORY_ITEM* inv_item)
|
void RingNotActive(INVENTORY_ITEM *inv_item)
|
||||||
{
|
{
|
||||||
if (!InvItemText[IT_NAME]) {
|
if (!InvItemText[IT_NAME]) {
|
||||||
switch (inv_item->object_number) {
|
switch (inv_item->object_number) {
|
||||||
|
@ -156,7 +156,8 @@ void RingNotActive(INVENTORY_ITEM* inv_item)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// XXX: terrible hack
|
// XXX: terrible hack
|
||||||
InvItemText[IT_NAME] = T_Print(0, -16, 0, (char*)inv_item->item_id);
|
InvItemText[IT_NAME] =
|
||||||
|
T_Print(0, -16, 0, (char *)inv_item->item_id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,7 +295,7 @@ int32_t Inv_AddItem(int32_t item_num)
|
||||||
int32_t item_num_option = Inv_GetItemOption(item_num);
|
int32_t item_num_option = Inv_GetItemOption(item_num);
|
||||||
|
|
||||||
for (int i = 0; i < InvMainObjects; i++) {
|
for (int i = 0; i < InvMainObjects; i++) {
|
||||||
INVENTORY_ITEM* inv_item = InvMainList[i];
|
INVENTORY_ITEM *inv_item = InvMainList[i];
|
||||||
if (inv_item->object_number == item_num_option) {
|
if (inv_item->object_number == item_num_option) {
|
||||||
InvMainQtys[i]++;
|
InvMainQtys[i]++;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -302,7 +303,7 @@ int32_t Inv_AddItem(int32_t item_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < InvKeysObjects; i++) {
|
for (int i = 0; i < InvKeysObjects; i++) {
|
||||||
INVENTORY_ITEM* inv_item = InvKeysList[i];
|
INVENTORY_ITEM *inv_item = InvKeysList[i];
|
||||||
if (inv_item->object_number == item_num_option) {
|
if (inv_item->object_number == item_num_option) {
|
||||||
InvKeysQtys[i]++;
|
InvKeysQtys[i]++;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -450,7 +451,7 @@ int32_t Inv_AddItem(int32_t item_num)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_InsertItem(INVENTORY_ITEM* inv_item)
|
void Inv_InsertItem(INVENTORY_ITEM *inv_item)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
@ -668,8 +669,8 @@ void RemoveInventoryText()
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingInit(
|
void Inv_RingInit(
|
||||||
RING_INFO* ring, int16_t type, INVENTORY_ITEM** list, int16_t qty,
|
RING_INFO *ring, int16_t type, INVENTORY_ITEM **list, int16_t qty,
|
||||||
int16_t current, IMOTION_INFO* imo)
|
int16_t current, IMOTION_INFO *imo)
|
||||||
{
|
{
|
||||||
ring->type = type;
|
ring->type = type;
|
||||||
ring->radius = 0;
|
ring->radius = 0;
|
||||||
|
@ -718,7 +719,7 @@ void Inv_RingInit(
|
||||||
ring->light.z = 1024;
|
ring->light.z = 1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingGetView(RING_INFO* ring, PHD_3DPOS* viewer)
|
void Inv_RingGetView(RING_INFO *ring, PHD_3DPOS *viewer)
|
||||||
{
|
{
|
||||||
PHD_ANGLE angles[2];
|
PHD_ANGLE angles[2];
|
||||||
|
|
||||||
|
@ -733,7 +734,7 @@ void Inv_RingGetView(RING_INFO* ring, PHD_3DPOS* viewer)
|
||||||
viewer->z_rot = 0;
|
viewer->z_rot = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingLight(RING_INFO* ring)
|
void Inv_RingLight(RING_INFO *ring)
|
||||||
{
|
{
|
||||||
PHD_ANGLE angles[2];
|
PHD_ANGLE angles[2];
|
||||||
LsDivider = 0x6000;
|
LsDivider = 0x6000;
|
||||||
|
@ -741,16 +742,16 @@ void Inv_RingLight(RING_INFO* ring)
|
||||||
phd_RotateLight(angles[1], angles[0]);
|
phd_RotateLight(angles[1], angles[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingCalcAdders(RING_INFO* ring, int16_t rotation_duration)
|
void Inv_RingCalcAdders(RING_INFO *ring, int16_t rotation_duration)
|
||||||
{
|
{
|
||||||
ring->angle_adder = 0x10000 / ring->number_of_objects;
|
ring->angle_adder = 0x10000 / ring->number_of_objects;
|
||||||
ring->rot_adder_l = ring->angle_adder / rotation_duration;
|
ring->rot_adder_l = ring->angle_adder / rotation_duration;
|
||||||
ring->rot_adder_r = -ring->rot_adder_l;
|
ring->rot_adder_r = -ring->rot_adder_l;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingDoMotions(RING_INFO* ring)
|
void Inv_RingDoMotions(RING_INFO *ring)
|
||||||
{
|
{
|
||||||
IMOTION_INFO* imo = ring->imo;
|
IMOTION_INFO *imo = ring->imo;
|
||||||
|
|
||||||
if (imo->count) {
|
if (imo->count) {
|
||||||
ring->radius += imo->radius_rate;
|
ring->radius += imo->radius_rate;
|
||||||
|
@ -758,7 +759,7 @@ void Inv_RingDoMotions(RING_INFO* ring)
|
||||||
ring->ringpos.y_rot += imo->rotate_rate;
|
ring->ringpos.y_rot += imo->rotate_rate;
|
||||||
ring->camera_pitch += imo->camera_pitch_rate;
|
ring->camera_pitch += imo->camera_pitch_rate;
|
||||||
|
|
||||||
INVENTORY_ITEM* inv_item = ring->list[ring->current_object];
|
INVENTORY_ITEM *inv_item = ring->list[ring->current_object];
|
||||||
inv_item->pt_xrot += imo->item_ptxrot_rate;
|
inv_item->pt_xrot += imo->item_ptxrot_rate;
|
||||||
inv_item->x_rot += imo->item_xrot_rate;
|
inv_item->x_rot += imo->item_xrot_rate;
|
||||||
inv_item->ytrans += imo->item_ytrans_rate;
|
inv_item->ytrans += imo->item_ytrans_rate;
|
||||||
|
@ -814,7 +815,7 @@ void Inv_RingDoMotions(RING_INFO* ring)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingRotateLeft(RING_INFO* ring)
|
void Inv_RingRotateLeft(RING_INFO *ring)
|
||||||
{
|
{
|
||||||
ring->rotating = 1;
|
ring->rotating = 1;
|
||||||
ring->target_object = ring->current_object - 1;
|
ring->target_object = ring->current_object - 1;
|
||||||
|
@ -825,7 +826,7 @@ void Inv_RingRotateLeft(RING_INFO* ring)
|
||||||
ring->rot_adder = ring->rot_adder_l;
|
ring->rot_adder = ring->rot_adder_l;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingRotateRight(RING_INFO* ring)
|
void Inv_RingRotateRight(RING_INFO *ring)
|
||||||
{
|
{
|
||||||
ring->rotating = 1;
|
ring->rotating = 1;
|
||||||
ring->target_object = ring->current_object + 1;
|
ring->target_object = ring->current_object + 1;
|
||||||
|
@ -837,7 +838,7 @@ void Inv_RingRotateRight(RING_INFO* ring)
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingMotionInit(
|
void Inv_RingMotionInit(
|
||||||
RING_INFO* ring, int16_t frames, int16_t status, int16_t status_target)
|
RING_INFO *ring, int16_t frames, int16_t status, int16_t status_target)
|
||||||
{
|
{
|
||||||
ring->imo->status_target = status_target;
|
ring->imo->status_target = status_target;
|
||||||
ring->imo->count = frames;
|
ring->imo->count = frames;
|
||||||
|
@ -862,9 +863,9 @@ void Inv_RingMotionInit(
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingMotionSetup(
|
void Inv_RingMotionSetup(
|
||||||
RING_INFO* ring, int16_t status, int16_t status_target, int16_t frames)
|
RING_INFO *ring, int16_t status, int16_t status_target, int16_t frames)
|
||||||
{
|
{
|
||||||
IMOTION_INFO* imo = ring->imo;
|
IMOTION_INFO *imo = ring->imo;
|
||||||
imo->count = frames;
|
imo->count = frames;
|
||||||
imo->status = status;
|
imo->status = status;
|
||||||
imo->status_target = status_target;
|
imo->status_target = status_target;
|
||||||
|
@ -872,37 +873,37 @@ void Inv_RingMotionSetup(
|
||||||
imo->camera_yrate = 0;
|
imo->camera_yrate = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingMotionRadius(RING_INFO* ring, int16_t target)
|
void Inv_RingMotionRadius(RING_INFO *ring, int16_t target)
|
||||||
{
|
{
|
||||||
IMOTION_INFO* imo = ring->imo;
|
IMOTION_INFO *imo = ring->imo;
|
||||||
imo->radius_target = target;
|
imo->radius_target = target;
|
||||||
imo->radius_rate = (target - ring->radius) / imo->count;
|
imo->radius_rate = (target - ring->radius) / imo->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingMotionRotation(RING_INFO* ring, int16_t rotation, int16_t target)
|
void Inv_RingMotionRotation(RING_INFO *ring, int16_t rotation, int16_t target)
|
||||||
{
|
{
|
||||||
IMOTION_INFO* imo = ring->imo;
|
IMOTION_INFO *imo = ring->imo;
|
||||||
imo->rotate_target = target;
|
imo->rotate_target = target;
|
||||||
imo->rotate_rate = rotation / imo->count;
|
imo->rotate_rate = rotation / imo->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingMotionCameraPos(RING_INFO* ring, int16_t target)
|
void Inv_RingMotionCameraPos(RING_INFO *ring, int16_t target)
|
||||||
{
|
{
|
||||||
IMOTION_INFO* imo = ring->imo;
|
IMOTION_INFO *imo = ring->imo;
|
||||||
imo->camera_ytarget = target;
|
imo->camera_ytarget = target;
|
||||||
imo->camera_yrate = (target - ring->camera.y) / imo->count;
|
imo->camera_yrate = (target - ring->camera.y) / imo->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingMotionCameraPitch(RING_INFO* ring, int16_t target)
|
void Inv_RingMotionCameraPitch(RING_INFO *ring, int16_t target)
|
||||||
{
|
{
|
||||||
IMOTION_INFO* imo = ring->imo;
|
IMOTION_INFO *imo = ring->imo;
|
||||||
imo->camera_pitch_target = target;
|
imo->camera_pitch_target = target;
|
||||||
imo->camera_pitch_rate = target / imo->count;
|
imo->camera_pitch_rate = target / imo->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingMotionItemSelect(RING_INFO* ring, INVENTORY_ITEM* inv_item)
|
void Inv_RingMotionItemSelect(RING_INFO *ring, INVENTORY_ITEM *inv_item)
|
||||||
{
|
{
|
||||||
IMOTION_INFO* imo = ring->imo;
|
IMOTION_INFO *imo = ring->imo;
|
||||||
imo->item_ptxrot_target = inv_item->pt_xrot_sel;
|
imo->item_ptxrot_target = inv_item->pt_xrot_sel;
|
||||||
imo->item_ptxrot_rate = inv_item->pt_xrot_sel / imo->count;
|
imo->item_ptxrot_rate = inv_item->pt_xrot_sel / imo->count;
|
||||||
imo->item_xrot_target = inv_item->x_rot_sel;
|
imo->item_xrot_target = inv_item->x_rot_sel;
|
||||||
|
@ -913,9 +914,9 @@ void Inv_RingMotionItemSelect(RING_INFO* ring, INVENTORY_ITEM* inv_item)
|
||||||
imo->item_ztrans_rate = inv_item->ztrans_sel / imo->count;
|
imo->item_ztrans_rate = inv_item->ztrans_sel / imo->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Inv_RingMotionItemDeselect(RING_INFO* ring, INVENTORY_ITEM* inv_item)
|
void Inv_RingMotionItemDeselect(RING_INFO *ring, INVENTORY_ITEM *inv_item)
|
||||||
{
|
{
|
||||||
IMOTION_INFO* imo = ring->imo;
|
IMOTION_INFO *imo = ring->imo;
|
||||||
imo->item_ptxrot_target = 0;
|
imo->item_ptxrot_target = 0;
|
||||||
imo->item_ptxrot_rate = -inv_item->pt_xrot_sel / imo->count;
|
imo->item_ptxrot_rate = -inv_item->pt_xrot_sel / imo->count;
|
||||||
imo->item_xrot_target = 0;
|
imo->item_xrot_target = 0;
|
||||||
|
|
|
@ -16,8 +16,8 @@ void InitialiseItemArray(int32_t num_items)
|
||||||
|
|
||||||
void KillItem(int16_t item_num)
|
void KillItem(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
ROOM_INFO* r = &RoomInfo[item->room_number];
|
ROOM_INFO *r = &RoomInfo[item->room_number];
|
||||||
|
|
||||||
int16_t linknum = NextItemActive;
|
int16_t linknum = NextItemActive;
|
||||||
if (linknum == item_num) {
|
if (linknum == item_num) {
|
||||||
|
@ -67,8 +67,8 @@ int16_t CreateItem()
|
||||||
|
|
||||||
void InitialiseItem(int16_t item_num)
|
void InitialiseItem(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
OBJECT_INFO* object = &Objects[item->object_number];
|
OBJECT_INFO *object = &Objects[item->object_number];
|
||||||
|
|
||||||
item->anim_number = object->anim_index;
|
item->anim_number = object->anim_index;
|
||||||
item->frame_number = Anims[item->anim_number].frame_base;
|
item->frame_number = Anims[item->anim_number].frame_base;
|
||||||
|
@ -103,12 +103,12 @@ void InitialiseItem(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOM_INFO* r = &RoomInfo[item->room_number];
|
ROOM_INFO *r = &RoomInfo[item->room_number];
|
||||||
item->next_item = r->item_number;
|
item->next_item = r->item_number;
|
||||||
r->item_number = item_num;
|
r->item_number = item_num;
|
||||||
int32_t x_floor = (item->pos.z - r->z) >> WALL_SHIFT;
|
int32_t x_floor = (item->pos.z - r->z) >> WALL_SHIFT;
|
||||||
int32_t y_floor = (item->pos.x - r->x) >> WALL_SHIFT;
|
int32_t y_floor = (item->pos.x - r->x) >> WALL_SHIFT;
|
||||||
FLOOR_INFO* floor = &r->floor[x_floor + y_floor * r->x_size];
|
FLOOR_INFO *floor = &r->floor[x_floor + y_floor * r->x_size];
|
||||||
item->floor = floor->floor << 8;
|
item->floor = floor->floor << 8;
|
||||||
|
|
||||||
if (SaveGame[0].bonus_flag) {
|
if (SaveGame[0].bonus_flag) {
|
||||||
|
@ -143,8 +143,8 @@ void RemoveActiveItem(int16_t item_num)
|
||||||
|
|
||||||
void RemoveDrawnItem(int16_t item_num)
|
void RemoveDrawnItem(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
ROOM_INFO* r = &RoomInfo[item->room_number];
|
ROOM_INFO *r = &RoomInfo[item->room_number];
|
||||||
|
|
||||||
int16_t linknum = r->item_number;
|
int16_t linknum = r->item_number;
|
||||||
if (linknum == item_num) {
|
if (linknum == item_num) {
|
||||||
|
@ -161,7 +161,7 @@ void RemoveDrawnItem(int16_t item_num)
|
||||||
|
|
||||||
void AddActiveItem(int16_t item_num)
|
void AddActiveItem(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (!Objects[item->object_number].control) {
|
if (!Objects[item->object_number].control) {
|
||||||
item->status = IS_NOT_ACTIVE;
|
item->status = IS_NOT_ACTIVE;
|
||||||
|
@ -182,8 +182,8 @@ void AddActiveItem(int16_t item_num)
|
||||||
|
|
||||||
void ItemNewRoom(int16_t item_num, int16_t room_num)
|
void ItemNewRoom(int16_t item_num, int16_t room_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
ROOM_INFO* r = &RoomInfo[item->room_number];
|
ROOM_INFO *r = &RoomInfo[item->room_number];
|
||||||
|
|
||||||
int16_t linknum = r->item_number;
|
int16_t linknum = r->item_number;
|
||||||
if (linknum == item_num) {
|
if (linknum == item_num) {
|
||||||
|
@ -203,11 +203,11 @@ void ItemNewRoom(int16_t item_num, int16_t room_num)
|
||||||
r->item_number = item_num;
|
r->item_number = item_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t SpawnItem(ITEM_INFO* item, int16_t object_num)
|
int16_t SpawnItem(ITEM_INFO *item, int16_t object_num)
|
||||||
{
|
{
|
||||||
int16_t spawn_num = CreateItem();
|
int16_t spawn_num = CreateItem();
|
||||||
if (spawn_num != NO_ITEM) {
|
if (spawn_num != NO_ITEM) {
|
||||||
ITEM_INFO* spawn = &Items[spawn_num];
|
ITEM_INFO *spawn = &Items[spawn_num];
|
||||||
spawn->object_number = object_num;
|
spawn->object_number = object_num;
|
||||||
spawn->room_number = item->room_number;
|
spawn->room_number = item->room_number;
|
||||||
spawn->pos = item->pos;
|
spawn->pos = item->pos;
|
||||||
|
@ -222,7 +222,7 @@ int32_t GlobalItemReplace(int32_t src_object_num, int32_t dst_object_num)
|
||||||
{
|
{
|
||||||
int32_t changed = 0;
|
int32_t changed = 0;
|
||||||
for (int i = 0; i < RoomCount; i++) {
|
for (int i = 0; i < RoomCount; i++) {
|
||||||
ROOM_INFO* r = &RoomInfo[i];
|
ROOM_INFO *r = &RoomInfo[i];
|
||||||
for (int16_t item_num = r->item_number; item_num != NO_ITEM;
|
for (int16_t item_num = r->item_number; item_num != NO_ITEM;
|
||||||
item_num = Items[item_num].next_item) {
|
item_num = Items[item_num].next_item) {
|
||||||
if (Items[item_num].object_number == src_object_num) {
|
if (Items[item_num].object_number == src_object_num) {
|
||||||
|
@ -251,10 +251,10 @@ int16_t CreateEffect(int16_t room_num)
|
||||||
return fx_num;
|
return fx_num;
|
||||||
}
|
}
|
||||||
|
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
NextFxFree = fx->next_fx;
|
NextFxFree = fx->next_fx;
|
||||||
|
|
||||||
ROOM_INFO* r = &RoomInfo[room_num];
|
ROOM_INFO *r = &RoomInfo[room_num];
|
||||||
fx->room_number = room_num;
|
fx->room_number = room_num;
|
||||||
fx->next_fx = r->fx_number;
|
fx->next_fx = r->fx_number;
|
||||||
r->fx_number = fx_num;
|
r->fx_number = fx_num;
|
||||||
|
@ -267,7 +267,7 @@ int16_t CreateEffect(int16_t room_num)
|
||||||
|
|
||||||
void KillEffect(int16_t fx_num)
|
void KillEffect(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
|
|
||||||
int16_t linknum = NextFxActive;
|
int16_t linknum = NextFxActive;
|
||||||
if (linknum == fx_num) {
|
if (linknum == fx_num) {
|
||||||
|
@ -281,7 +281,7 @@ void KillEffect(int16_t fx_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOM_INFO* r = &RoomInfo[fx->room_number];
|
ROOM_INFO *r = &RoomInfo[fx->room_number];
|
||||||
linknum = r->fx_number;
|
linknum = r->fx_number;
|
||||||
if (linknum == fx_num) {
|
if (linknum == fx_num) {
|
||||||
r->fx_number = fx->next_fx;
|
r->fx_number = fx->next_fx;
|
||||||
|
@ -300,8 +300,8 @@ void KillEffect(int16_t fx_num)
|
||||||
|
|
||||||
void EffectNewRoom(int16_t fx_num, int16_t room_num)
|
void EffectNewRoom(int16_t fx_num, int16_t room_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
ROOM_INFO* r = &RoomInfo[fx->room_number];
|
ROOM_INFO *r = &RoomInfo[fx->room_number];
|
||||||
|
|
||||||
int16_t linknum = r->fx_number;
|
int16_t linknum = r->fx_number;
|
||||||
if (linknum == fx_num) {
|
if (linknum == fx_num) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ void RemoveActiveItem(int16_t item_num);
|
||||||
void RemoveDrawnItem(int16_t item_num);
|
void RemoveDrawnItem(int16_t item_num);
|
||||||
void AddActiveItem(int16_t item_num);
|
void AddActiveItem(int16_t item_num);
|
||||||
void ItemNewRoom(int16_t item_num, int16_t room_num);
|
void ItemNewRoom(int16_t item_num, int16_t room_num);
|
||||||
int16_t SpawnItem(ITEM_INFO* item, int16_t object_num);
|
int16_t SpawnItem(ITEM_INFO *item, int16_t object_num);
|
||||||
int32_t GlobalItemReplace(int32_t src_object_num, int32_t dst_object_num);
|
int32_t GlobalItemReplace(int32_t src_object_num, int32_t dst_object_num);
|
||||||
void InitialiseFXArray();
|
void InitialiseFXArray();
|
||||||
int16_t CreateEffect(int16_t room_num);
|
int16_t CreateEffect(int16_t room_num);
|
||||||
|
|
230
src/game/lara.c
230
src/game/lara.c
|
@ -71,7 +71,7 @@ void ResetLook()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void LaraAboveWater(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAboveWater(ITEM_INFO *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;
|
||||||
|
@ -141,7 +141,7 @@ void LaraAboveWater(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
TestTriggers(coll->trigger, 0);
|
TestTriggers(coll->trigger, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsWalk(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsWalk(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_STOP;
|
item->goal_anim_state = AS_STOP;
|
||||||
|
@ -188,7 +188,7 @@ void LaraAsWalk(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsRun(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsRun(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_DEATH;
|
item->goal_anim_state = AS_DEATH;
|
||||||
|
@ -236,7 +236,7 @@ void LaraAsRun(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsStop(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsStop(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_DEATH;
|
item->goal_anim_state = AS_DEATH;
|
||||||
|
@ -318,7 +318,7 @@ void LaraAsStop(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsForwardJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsForwardJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->goal_anim_state == AS_SWANDIVE
|
if (item->goal_anim_state == AS_SWANDIVE
|
||||||
|| item->goal_anim_state == AS_REACH) {
|
|| item->goal_anim_state == AS_REACH) {
|
||||||
|
@ -349,11 +349,11 @@ void LaraAsForwardJump(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsPose(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsPose(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsFastBack(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsFastBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->goal_anim_state = AS_STOP;
|
item->goal_anim_state = AS_STOP;
|
||||||
if (Input & IN_LEFT) {
|
if (Input & IN_LEFT) {
|
||||||
|
@ -369,7 +369,7 @@ void LaraAsFastBack(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsTurnR(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsTurnR(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_STOP;
|
item->goal_anim_state = AS_STOP;
|
||||||
|
@ -412,7 +412,7 @@ void LaraAsTurnR(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsTurnL(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsTurnL(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_STOP;
|
item->goal_anim_state = AS_STOP;
|
||||||
|
@ -455,13 +455,13 @@ void LaraAsTurnL(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsDeath(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsDeath(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsFastFall(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsFastFall(ITEM_INFO *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) {
|
||||||
|
@ -469,7 +469,7 @@ void LaraAsFastFall(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsHang(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsHang(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -482,7 +482,7 @@ void LaraAsHang(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsReach(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsReach(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Camera.target_angle = 85 * PHD_DEGREE;
|
Camera.target_angle = 85 * PHD_DEGREE;
|
||||||
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
||||||
|
@ -490,15 +490,15 @@ void LaraAsReach(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSplat(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSplat(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsLand(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsLand(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsCompress(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsCompress(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if ((Input & IN_FORWARD)
|
if ((Input & IN_FORWARD)
|
||||||
&& LaraFloorFront(item, item->pos.y_rot, 256) >= -STEPUP_HEIGHT) {
|
&& LaraFloorFront(item, item->pos.y_rot, 256) >= -STEPUP_HEIGHT) {
|
||||||
|
@ -529,7 +529,7 @@ void LaraAsCompress(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsBack(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_STOP;
|
item->goal_anim_state = AS_STOP;
|
||||||
|
@ -572,7 +572,7 @@ void LaraAsBack(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsFastTurn(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsFastTurn(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_STOP;
|
item->goal_anim_state = AS_STOP;
|
||||||
|
@ -606,7 +606,7 @@ void LaraAsFastTurn(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsStepRight(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsStepRight(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_STOP;
|
item->goal_anim_state = AS_STOP;
|
||||||
|
@ -636,7 +636,7 @@ void LaraAsStepRight(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsStepLeft(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsStepLeft(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_STOP;
|
item->goal_anim_state = AS_STOP;
|
||||||
|
@ -666,7 +666,7 @@ void LaraAsStepLeft(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSlide(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSlide(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Camera.flags = NO_CHUNKY;
|
Camera.flags = NO_CHUNKY;
|
||||||
Camera.target_elevation = -45 * PHD_DEGREE;
|
Camera.target_elevation = -45 * PHD_DEGREE;
|
||||||
|
@ -675,7 +675,7 @@ void LaraAsSlide(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsBackJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsBackJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Camera.target_angle = PHD_DEGREE * 135;
|
Camera.target_angle = PHD_DEGREE * 135;
|
||||||
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
||||||
|
@ -683,28 +683,28 @@ void LaraAsBackJump(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsRightJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsRightJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
||||||
item->goal_anim_state = AS_FASTFALL;
|
item->goal_anim_state = AS_FASTFALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsLeftJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsLeftJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
||||||
item->goal_anim_state = AS_FASTFALL;
|
item->goal_anim_state = AS_FASTFALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsUpJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsUpJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
||||||
item->goal_anim_state = AS_FASTFALL;
|
item->goal_anim_state = AS_FASTFALL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsFallBack(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsFallBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
if (item->fall_speed > LARA_FASTFALL_SPEED) {
|
||||||
item->goal_anim_state = AS_FASTFALL;
|
item->goal_anim_state = AS_FASTFALL;
|
||||||
|
@ -714,7 +714,7 @@ void LaraAsFallBack(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsHangLeft(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsHangLeft(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -725,7 +725,7 @@ void LaraAsHangLeft(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsHangRight(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsHangRight(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -736,14 +736,14 @@ void LaraAsHangRight(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSlideBack(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSlideBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (Input & IN_JUMP) {
|
if (Input & IN_JUMP) {
|
||||||
item->goal_anim_state = AS_BACKJUMP;
|
item->goal_anim_state = AS_BACKJUMP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsPushBlock(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsPushBlock(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -752,7 +752,7 @@ void LaraAsPushBlock(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
Camera.target_elevation = -25 * PHD_DEGREE;
|
Camera.target_elevation = -25 * PHD_DEGREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsPullBlock(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsPullBlock(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -761,7 +761,7 @@ void LaraAsPullBlock(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
Camera.target_elevation = -25 * PHD_DEGREE;
|
Camera.target_elevation = -25 * PHD_DEGREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsPPReady(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsPPReady(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -771,7 +771,7 @@ void LaraAsPPReady(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsPickup(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsPickup(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -780,7 +780,7 @@ void LaraAsPickup(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
Camera.target_distance = WALL_L;
|
Camera.target_distance = WALL_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSwitchOn(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSwitchOn(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -789,7 +789,7 @@ void LaraAsSwitchOn(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
Camera.target_distance = WALL_L;
|
Camera.target_distance = WALL_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSwitchOff(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSwitchOff(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -798,7 +798,7 @@ void LaraAsSwitchOff(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
Camera.target_distance = WALL_L;
|
Camera.target_distance = WALL_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsUseKey(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsUseKey(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -807,7 +807,7 @@ void LaraAsUseKey(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
Camera.target_distance = WALL_L;
|
Camera.target_distance = WALL_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsUsePuzzle(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsUsePuzzle(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
|
@ -816,29 +816,29 @@ void LaraAsUsePuzzle(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
Camera.target_distance = WALL_L;
|
Camera.target_distance = WALL_L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsRoll(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsRoll(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsRoll2(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsRoll2(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSpecial(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSpecial(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Camera.flags = FOLLOW_CENTRE;
|
Camera.flags = FOLLOW_CENTRE;
|
||||||
Camera.target_angle = 170 * PHD_DEGREE;
|
Camera.target_angle = 170 * PHD_DEGREE;
|
||||||
Camera.target_elevation = -25 * PHD_DEGREE;
|
Camera.target_elevation = -25 * PHD_DEGREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsUseMidas(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsUseMidas(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
ItemSparkle(item, (1 << LM_HAND_L) | (1 << LM_HAND_R));
|
ItemSparkle(item, (1 << LM_HAND_L) | (1 << LM_HAND_R));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsDieMidas(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsDieMidas(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->gravity_status = 0;
|
item->gravity_status = 0;
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
|
@ -934,7 +934,7 @@ void LaraAsDieMidas(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
ItemSparkle(item, Lara.mesh_effects);
|
ItemSparkle(item, Lara.mesh_effects);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSwanDive(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSwanDive(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 1;
|
coll->enable_baddie_push = 1;
|
||||||
|
@ -943,33 +943,33 @@ void LaraAsSwanDive(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsFastDive(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsFastDive(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 1;
|
coll->enable_baddie_push = 1;
|
||||||
item->speed = (item->speed * 95) / 100;
|
item->speed = (item->speed * 95) / 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsNull(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsNull(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsGymnast(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsGymnast(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsWaterOut(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsWaterOut(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->enable_spaz = 0;
|
coll->enable_spaz = 0;
|
||||||
coll->enable_baddie_push = 0;
|
coll->enable_baddie_push = 0;
|
||||||
Camera.flags = FOLLOW_CENTRE;
|
Camera.flags = FOLLOW_CENTRE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColWalk(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColWalk(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
item->gravity_status = 0;
|
item->gravity_status = 0;
|
||||||
|
@ -1041,7 +1041,7 @@ void LaraColWalk(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColRun(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColRun(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -1109,7 +1109,7 @@ void LaraColRun(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColStop(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColStop(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
item->gravity_status = 0;
|
item->gravity_status = 0;
|
||||||
|
@ -1143,7 +1143,7 @@ void LaraColStop(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColForwardJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColForwardJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -1169,12 +1169,12 @@ void LaraColForwardJump(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColPose(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColPose(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColStop(item, coll);
|
LaraColStop(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColFastBack(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColFastBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_180;
|
Lara.move_angle = item->pos.y_rot - PHD_180;
|
||||||
item->gravity_status = 0;
|
item->gravity_status = 0;
|
||||||
|
@ -1208,7 +1208,7 @@ void LaraColFastBack(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColTurnR(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColTurnR(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
item->gravity_status = 0;
|
item->gravity_status = 0;
|
||||||
|
@ -1237,12 +1237,12 @@ void LaraColTurnR(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColTurnL(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColTurnL(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColTurnR(item, coll);
|
LaraColTurnR(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColDeath(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColDeath(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
coll->bad_pos = STEPUP_HEIGHT;
|
coll->bad_pos = STEPUP_HEIGHT;
|
||||||
|
@ -1257,7 +1257,7 @@ void LaraColDeath(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
Lara.air = -1;
|
Lara.air = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColFastFall(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColFastFall(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->gravity_status = 1;
|
item->gravity_status = 1;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -1282,7 +1282,7 @@ void LaraColFastFall(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColHang(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColHang(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraHangTest(item, coll);
|
LaraHangTest(item, coll);
|
||||||
if (item->goal_anim_state == AS_HANG && (Input & IN_FORWARD)) {
|
if (item->goal_anim_state == AS_HANG && (Input & IN_FORWARD)) {
|
||||||
|
@ -1300,7 +1300,7 @@ void LaraColHang(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColReach(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColReach(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->gravity_status = 1;
|
item->gravity_status = 1;
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
|
@ -1326,7 +1326,7 @@ void LaraColReach(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSplat(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSplat(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
coll->bad_pos = STEPUP_HEIGHT;
|
coll->bad_pos = STEPUP_HEIGHT;
|
||||||
|
@ -1338,12 +1338,12 @@ void LaraColSplat(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
ShiftItem(item, coll);
|
ShiftItem(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColLand(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColLand(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColStop(item, coll);
|
LaraColStop(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColCompress(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColCompress(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->gravity_status = 0;
|
item->gravity_status = 0;
|
||||||
item->fall_speed = 0;
|
item->fall_speed = 0;
|
||||||
|
@ -1366,7 +1366,7 @@ void LaraColCompress(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColBack(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_180;
|
Lara.move_angle = item->pos.y_rot - PHD_180;
|
||||||
item->gravity_status = 0;
|
item->gravity_status = 0;
|
||||||
|
@ -1404,17 +1404,17 @@ void LaraColBack(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColNull(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColNull(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColFastTurn(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColFastTurn(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColStop(item, coll);
|
LaraColStop(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColStepRight(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColStepRight(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot + PHD_90;
|
Lara.move_angle = item->pos.y_rot + PHD_90;
|
||||||
item->gravity_status = 0;
|
item->gravity_status = 0;
|
||||||
|
@ -1442,7 +1442,7 @@ void LaraColStepRight(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColStepLeft(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColStepLeft(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_90;
|
Lara.move_angle = item->pos.y_rot - PHD_90;
|
||||||
item->gravity_status = 0;
|
item->gravity_status = 0;
|
||||||
|
@ -1470,31 +1470,31 @@ void LaraColStepLeft(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSlide(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSlide(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
LaraSlideSlope(item, coll);
|
LaraSlideSlope(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColBackJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColBackJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_180;
|
Lara.move_angle = item->pos.y_rot - PHD_180;
|
||||||
LaraColJumper(item, coll);
|
LaraColJumper(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColRightJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColRightJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot + PHD_90;
|
Lara.move_angle = item->pos.y_rot + PHD_90;
|
||||||
LaraColJumper(item, coll);
|
LaraColJumper(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColLeftJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColLeftJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_90;
|
Lara.move_angle = item->pos.y_rot - PHD_90;
|
||||||
LaraColJumper(item, coll);
|
LaraColJumper(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColUpJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColUpJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -1522,7 +1522,7 @@ void LaraColUpJump(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColFallBack(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColFallBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_180;
|
Lara.move_angle = item->pos.y_rot - PHD_180;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -1544,27 +1544,27 @@ void LaraColFallBack(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColHangLeft(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColHangLeft(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_90;
|
Lara.move_angle = item->pos.y_rot - PHD_90;
|
||||||
LaraHangTest(item, coll);
|
LaraHangTest(item, coll);
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_90;
|
Lara.move_angle = item->pos.y_rot - PHD_90;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColHangRight(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColHangRight(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot + PHD_90;
|
Lara.move_angle = item->pos.y_rot + PHD_90;
|
||||||
LaraHangTest(item, coll);
|
LaraHangTest(item, coll);
|
||||||
Lara.move_angle = item->pos.y_rot + PHD_90;
|
Lara.move_angle = item->pos.y_rot + PHD_90;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSlideBack(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSlideBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_180;
|
Lara.move_angle = item->pos.y_rot - PHD_180;
|
||||||
LaraSlideSlope(item, coll);
|
LaraSlideSlope(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColDefault(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColDefault(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
coll->bad_pos = STEPUP_HEIGHT;
|
coll->bad_pos = STEPUP_HEIGHT;
|
||||||
|
@ -1575,47 +1575,47 @@ void LaraColDefault(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
GetLaraCollisionInfo(item, coll);
|
GetLaraCollisionInfo(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColPushBlock(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColPushBlock(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColPullBlock(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColPullBlock(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColPPReady(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColPPReady(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColPickup(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColPickup(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSwitchOn(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSwitchOn(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSwitchOff(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSwitchOff(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColUseKey(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColUseKey(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColUsePuzzle(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColUsePuzzle(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColRoll(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColRoll(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
item->gravity_status = 0;
|
item->gravity_status = 0;
|
||||||
|
@ -1648,7 +1648,7 @@ void LaraColRoll(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColRoll2(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColRoll2(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_180;
|
Lara.move_angle = item->pos.y_rot - PHD_180;
|
||||||
item->gravity_status = 0;
|
item->gravity_status = 0;
|
||||||
|
@ -1681,21 +1681,21 @@ void LaraColRoll2(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
item->pos.y += coll->mid_floor;
|
item->pos.y += coll->mid_floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSpecial(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSpecial(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColUseMidas(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColUseMidas(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColDieMidas(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColDieMidas(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSwanDive(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSwanDive(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -1713,7 +1713,7 @@ void LaraColSwanDive(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColFastDive(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColFastDive(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
|
@ -1735,17 +1735,17 @@ void LaraColFastDive(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColGymnast(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColGymnast(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColWaterOut(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColWaterOut(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraColDefault(item, coll);
|
LaraColDefault(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColJumper(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColJumper(ITEM_INFO *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;
|
||||||
|
@ -1766,7 +1766,7 @@ void LaraColJumper(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetLaraCollisionInfo(ITEM_INFO* item, COLL_INFO* coll)
|
void GetLaraCollisionInfo(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->facing = Lara.move_angle;
|
coll->facing = Lara.move_angle;
|
||||||
GetCollisionInfo(
|
GetCollisionInfo(
|
||||||
|
@ -1774,7 +1774,7 @@ void GetLaraCollisionInfo(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
LARA_HITE);
|
LARA_HITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraSlideSlope(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraSlideSlope(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
coll->bad_neg = -512;
|
coll->bad_neg = -512;
|
||||||
|
@ -1812,7 +1812,7 @@ void LaraSlideSlope(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LaraHitCeiling(ITEM_INFO* item, COLL_INFO* coll)
|
int32_t LaraHitCeiling(ITEM_INFO *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) {
|
||||||
item->pos.x = coll->old.x;
|
item->pos.x = coll->old.x;
|
||||||
|
@ -1830,10 +1830,10 @@ int32_t LaraHitCeiling(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraHangTest(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraHangTest(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
int flag = 0;
|
int flag = 0;
|
||||||
int16_t* bounds;
|
int16_t *bounds;
|
||||||
|
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
coll->bad_neg = NO_BAD_NEG;
|
coll->bad_neg = NO_BAD_NEG;
|
||||||
|
@ -1921,7 +1921,7 @@ void LaraHangTest(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LaraDeflectEdge(ITEM_INFO* item, COLL_INFO* coll)
|
int32_t LaraDeflectEdge(ITEM_INFO *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) {
|
||||||
ShiftItem(item, coll);
|
ShiftItem(item, coll);
|
||||||
|
@ -1942,7 +1942,7 @@ int32_t LaraDeflectEdge(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraDeflectEdgeJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraDeflectEdgeJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ShiftItem(item, coll);
|
ShiftItem(item, coll);
|
||||||
switch (coll->coll_type) {
|
switch (coll->coll_type) {
|
||||||
|
@ -1985,7 +1985,7 @@ void LaraDeflectEdgeJump(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraSlideEdgeJump(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraSlideEdgeJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ShiftItem(item, coll);
|
ShiftItem(item, coll);
|
||||||
switch (coll->coll_type) {
|
switch (coll->coll_type) {
|
||||||
|
@ -2016,7 +2016,7 @@ void LaraSlideEdgeJump(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t TestLaraVault(ITEM_INFO* item, COLL_INFO* coll)
|
int32_t TestLaraVault(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (coll->coll_type != COLL_FRONT || !(Input & IN_ACTION)
|
if (coll->coll_type != COLL_FRONT || !(Input & IN_ACTION)
|
||||||
|| Lara.gun_status != LGS_ARMLESS
|
|| Lara.gun_status != LGS_ARMLESS
|
||||||
|
@ -2091,10 +2091,10 @@ int32_t TestLaraVault(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LaraTestHangJump(ITEM_INFO* item, COLL_INFO* coll)
|
int32_t LaraTestHangJump(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
int hdif;
|
int hdif;
|
||||||
int16_t* bounds;
|
int16_t *bounds;
|
||||||
|
|
||||||
if (coll->coll_type != COLL_FRONT || !(Input & IN_ACTION)
|
if (coll->coll_type != COLL_FRONT || !(Input & IN_ACTION)
|
||||||
|| Lara.gun_status != LGS_ARMLESS
|
|| Lara.gun_status != LGS_ARMLESS
|
||||||
|
@ -2155,7 +2155,7 @@ int32_t LaraTestHangJump(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t TestHangSwingIn(ITEM_INFO* item, PHD_ANGLE angle)
|
int32_t TestHangSwingIn(ITEM_INFO *item, PHD_ANGLE angle)
|
||||||
{
|
{
|
||||||
int x = item->pos.x;
|
int x = item->pos.x;
|
||||||
int y = item->pos.y;
|
int y = item->pos.y;
|
||||||
|
@ -2176,7 +2176,7 @@ int32_t TestHangSwingIn(ITEM_INFO* item, PHD_ANGLE angle)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &room_num);
|
||||||
int h = GetHeight(floor, x, y, z);
|
int h = GetHeight(floor, x, y, z);
|
||||||
int c = GetCeiling(floor, x, y, z);
|
int c = GetCeiling(floor, x, y, z);
|
||||||
|
|
||||||
|
@ -2188,10 +2188,10 @@ int32_t TestHangSwingIn(ITEM_INFO* item, PHD_ANGLE angle)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LaraTestHangJumpUp(ITEM_INFO* item, COLL_INFO* coll)
|
int32_t LaraTestHangJumpUp(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
int hdif;
|
int hdif;
|
||||||
int16_t* bounds;
|
int16_t *bounds;
|
||||||
|
|
||||||
if (coll->coll_type != COLL_FRONT || !(Input & IN_ACTION)
|
if (coll->coll_type != COLL_FRONT || !(Input & IN_ACTION)
|
||||||
|| Lara.gun_status != LGS_ARMLESS
|
|| Lara.gun_status != LGS_ARMLESS
|
||||||
|
@ -2245,7 +2245,7 @@ int32_t LaraTestHangJumpUp(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t TestLaraSlide(ITEM_INFO* item, COLL_INFO* coll)
|
int32_t TestLaraSlide(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
static PHD_ANGLE old_angle = 1;
|
static PHD_ANGLE old_angle = 1;
|
||||||
|
|
||||||
|
@ -2291,24 +2291,24 @@ int32_t TestLaraSlide(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t LaraFloorFront(ITEM_INFO* item, PHD_ANGLE ang, int32_t dist)
|
int16_t LaraFloorFront(ITEM_INFO *item, PHD_ANGLE ang, int32_t dist)
|
||||||
{
|
{
|
||||||
int32_t x = item->pos.x + ((phd_sin(ang) * dist) >> W2V_SHIFT);
|
int32_t x = item->pos.x + ((phd_sin(ang) * dist) >> W2V_SHIFT);
|
||||||
int32_t y = item->pos.y - LARA_HITE;
|
int32_t y = item->pos.y - LARA_HITE;
|
||||||
int32_t z = item->pos.z + ((phd_cos(ang) * dist) >> W2V_SHIFT);
|
int32_t z = item->pos.z + ((phd_cos(ang) * dist) >> W2V_SHIFT);
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &room_num);
|
||||||
int32_t height = GetHeight(floor, x, y, z);
|
int32_t height = GetHeight(floor, x, y, z);
|
||||||
if (height != NO_HEIGHT)
|
if (height != NO_HEIGHT)
|
||||||
height -= item->pos.y;
|
height -= item->pos.y;
|
||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LaraLandedBad(ITEM_INFO* item, COLL_INFO* coll)
|
int32_t LaraLandedBad(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
|
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
|
|
||||||
int oy = item->pos.y;
|
int oy = item->pos.y;
|
||||||
|
|
290
src/game/lara.h
290
src/game/lara.h
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
void LaraControl(int16_t item_num);
|
void LaraControl(int16_t item_num);
|
||||||
void LaraSwapMeshExtra();
|
void LaraSwapMeshExtra();
|
||||||
void AnimateLara(ITEM_INFO* item);
|
void AnimateLara(ITEM_INFO *item);
|
||||||
void UseItem(int16_t object_num);
|
void UseItem(int16_t object_num);
|
||||||
void ControlLaraExtra(int16_t item_num);
|
void ControlLaraExtra(int16_t item_num);
|
||||||
void InitialiseLaraLoad(int16_t item_num);
|
void InitialiseLaraLoad(int16_t item_num);
|
||||||
|
@ -14,158 +14,158 @@ void InitialiseLara();
|
||||||
void InitialiseLaraInventory(int32_t level_num);
|
void InitialiseLaraInventory(int32_t level_num);
|
||||||
void LaraInitialiseMeshes(int32_t level_num);
|
void LaraInitialiseMeshes(int32_t level_num);
|
||||||
|
|
||||||
void LaraAboveWater(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAboveWater(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraUnderWater(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraUnderWater(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraSurface(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraSurface(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
|
|
||||||
void LaraAsWalk(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsWalk(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsRun(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsRun(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsStop(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsStop(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsForwardJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsForwardJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsPose(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsPose(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsFastBack(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsFastBack(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsTurnR(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsTurnR(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsTurnL(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsTurnL(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsDeath(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsDeath(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsFastFall(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsFastFall(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsHang(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsHang(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsReach(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsReach(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSplat(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSplat(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsTread(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsTread(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsLand(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsLand(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsCompress(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsCompress(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsBack(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsBack(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSwim(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSwim(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsGlide(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsGlide(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsNull(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsNull(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsFastTurn(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsFastTurn(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsStepRight(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsStepRight(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsStepLeft(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsStepLeft(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsRoll2(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsRoll2(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSlide(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSlide(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsBackJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsBackJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsRightJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsRightJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsLeftJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsLeftJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsUpJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsUpJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsFallBack(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsFallBack(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsHangLeft(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsHangLeft(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsHangRight(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsHangRight(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSlideBack(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSlideBack(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSurfTread(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSurfTread(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSurfSwim(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSurfSwim(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsDive(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsDive(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsPushBlock(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsPushBlock(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsPullBlock(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsPullBlock(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsPPReady(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsPPReady(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsPickup(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsPickup(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSwitchOn(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSwitchOn(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSwitchOff(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSwitchOff(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsUseKey(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsUseKey(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsUsePuzzle(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsUsePuzzle(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsUWDeath(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsUWDeath(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsRoll(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsRoll(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSpecial(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSpecial(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSurfBack(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSurfBack(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSurfLeft(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSurfLeft(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSurfRight(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSurfRight(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsUseMidas(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsUseMidas(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsDieMidas(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsDieMidas(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsSwanDive(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsSwanDive(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsFastDive(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsFastDive(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsGymnast(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsGymnast(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraAsWaterOut(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraAsWaterOut(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
|
|
||||||
void LaraColWalk(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColWalk(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColRun(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColRun(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColStop(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColStop(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColForwardJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColForwardJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColPose(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColPose(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColFastBack(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColFastBack(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColTurnR(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColTurnR(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColTurnL(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColTurnL(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColDeath(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColDeath(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColFastFall(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColFastFall(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColHang(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColHang(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColReach(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColReach(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSplat(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSplat(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColTread(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColTread(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColLand(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColLand(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColCompress(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColCompress(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColBack(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColBack(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSwim(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSwim(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColGlide(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColGlide(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColNull(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColNull(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColFastTurn(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColFastTurn(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColStepRight(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColStepRight(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColStepLeft(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColStepLeft(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColRoll2(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColRoll2(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSlide(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSlide(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColBackJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColBackJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColRightJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColRightJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColLeftJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColLeftJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColUpJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColUpJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColFallBack(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColFallBack(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColHangLeft(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColHangLeft(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColHangRight(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColHangRight(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSlideBack(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSlideBack(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSurfTread(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSurfTread(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSurfSwim(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSurfSwim(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColDive(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColDive(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColPushBlock(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColPushBlock(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColPullBlock(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColPullBlock(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColPPReady(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColPPReady(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColPickup(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColPickup(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSwitchOn(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSwitchOn(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSwitchOff(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSwitchOff(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColUseKey(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColUseKey(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColUsePuzzle(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColUsePuzzle(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColUWDeath(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColUWDeath(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColRoll(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColRoll(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSpecial(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSpecial(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSurfBack(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSurfBack(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSurfLeft(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSurfLeft(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSurfRight(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSurfRight(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColUseMidas(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColUseMidas(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColDieMidas(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColDieMidas(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColSwanDive(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColSwanDive(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColFastDive(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColFastDive(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColGymnast(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColGymnast(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColWaterOut(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColWaterOut(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
|
|
||||||
void LaraColDefault(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColDefault(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraColJumper(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraColJumper(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
|
|
||||||
void GetLaraCollisionInfo(ITEM_INFO* item, COLL_INFO* coll);
|
void GetLaraCollisionInfo(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraSlideSlope(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraSlideSlope(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
int32_t LaraHitCeiling(ITEM_INFO* item, COLL_INFO* coll);
|
int32_t LaraHitCeiling(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraHangTest(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraHangTest(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
int32_t LaraDeflectEdge(ITEM_INFO* item, COLL_INFO* coll);
|
int32_t LaraDeflectEdge(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraDeflectEdgeJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraDeflectEdgeJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraSlideEdgeJump(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraSlideEdgeJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
int32_t TestLaraVault(ITEM_INFO* item, COLL_INFO* coll);
|
int32_t TestLaraVault(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
int32_t LaraTestHangJump(ITEM_INFO* item, COLL_INFO* coll);
|
int32_t LaraTestHangJump(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
int32_t LaraTestHangJumpUp(ITEM_INFO* item, COLL_INFO* coll);
|
int32_t LaraTestHangJumpUp(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
int32_t TestHangSwingIn(ITEM_INFO* item, PHD_ANGLE angle);
|
int32_t TestHangSwingIn(ITEM_INFO *item, PHD_ANGLE angle);
|
||||||
int32_t TestLaraSlide(ITEM_INFO* item, COLL_INFO* coll);
|
int32_t TestLaraSlide(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
int16_t LaraFloorFront(ITEM_INFO* item, PHD_ANGLE ang, int32_t dist);
|
int16_t LaraFloorFront(ITEM_INFO *item, PHD_ANGLE ang, int32_t dist);
|
||||||
int32_t LaraLandedBad(ITEM_INFO* item, COLL_INFO* coll);
|
int32_t LaraLandedBad(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraSwimCollision(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraSwimCollision(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
void LaraWaterCurrent(COLL_INFO* coll);
|
void LaraWaterCurrent(COLL_INFO *coll);
|
||||||
void LaraSurfaceCollision(ITEM_INFO* item, COLL_INFO* coll);
|
void LaraSurfaceCollision(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
int32_t LaraTestWaterClimbOut(ITEM_INFO* item, COLL_INFO* coll);
|
int32_t LaraTestWaterClimbOut(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
|
|
||||||
extern void (*LaraControlRoutines[])(ITEM_INFO* item, COLL_INFO* coll);
|
extern void (*LaraControlRoutines[])(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
extern void (*LaraCollisionRoutines[])(ITEM_INFO* item, COLL_INFO* coll);
|
extern void (*LaraCollisionRoutines[])(ITEM_INFO *item, COLL_INFO *coll);
|
||||||
|
|
||||||
void LaraGun();
|
void LaraGun();
|
||||||
void InitialiseNewWeapon();
|
void InitialiseNewWeapon();
|
||||||
void LaraTargetInfo(WEAPON_INFO* winfo);
|
void LaraTargetInfo(WEAPON_INFO *winfo);
|
||||||
void LaraGetNewTarget(WEAPON_INFO* winfo);
|
void LaraGetNewTarget(WEAPON_INFO *winfo);
|
||||||
void find_target_point(ITEM_INFO* item, GAME_VECTOR* target);
|
void find_target_point(ITEM_INFO *item, GAME_VECTOR *target);
|
||||||
void AimWeapon(WEAPON_INFO* winfo, LARA_ARM* arm);
|
void AimWeapon(WEAPON_INFO *winfo, LARA_ARM *arm);
|
||||||
int32_t FireWeapon(
|
int32_t FireWeapon(
|
||||||
int32_t weapon_type, ITEM_INFO* target, ITEM_INFO* src, PHD_ANGLE* angles);
|
int32_t weapon_type, ITEM_INFO *target, ITEM_INFO *src, PHD_ANGLE *angles);
|
||||||
void HitTarget(ITEM_INFO* item, GAME_VECTOR* hitpos, int32_t damage);
|
void HitTarget(ITEM_INFO *item, GAME_VECTOR *hitpos, int32_t damage);
|
||||||
|
|
||||||
void DrawShotgun();
|
void DrawShotgun();
|
||||||
void UndrawShotgun();
|
void UndrawShotgun();
|
||||||
|
@ -187,7 +187,7 @@ void AnimatePistols(int32_t weapon_type);
|
||||||
|
|
||||||
void InitialiseEvilLara(int16_t item_num);
|
void InitialiseEvilLara(int16_t item_num);
|
||||||
void ControlEvilLara(int16_t item_num);
|
void ControlEvilLara(int16_t item_num);
|
||||||
void DrawEvilLara(ITEM_INFO* item);
|
void DrawEvilLara(ITEM_INFO *item);
|
||||||
|
|
||||||
#ifdef T1M_FEAT_GAMEPLAY
|
#ifdef T1M_FEAT_GAMEPLAY
|
||||||
void LookLeftRight();
|
void LookLeftRight();
|
||||||
|
|
|
@ -113,7 +113,7 @@ void ReadyShotgun()
|
||||||
|
|
||||||
void RifleHandler(int32_t weapon_type)
|
void RifleHandler(int32_t weapon_type)
|
||||||
{
|
{
|
||||||
WEAPON_INFO* winfo = &Weapons[LGT_SHOTGUN];
|
WEAPON_INFO *winfo = &Weapons[LGT_SHOTGUN];
|
||||||
|
|
||||||
if (Input & IN_ACTION) {
|
if (Input & IN_ACTION) {
|
||||||
LaraTargetInfo(winfo);
|
LaraTargetInfo(winfo);
|
||||||
|
|
|
@ -154,7 +154,7 @@ void UndrawPistolMeshRight(int32_t weapon_type)
|
||||||
|
|
||||||
void PistolHandler(int32_t weapon_type)
|
void PistolHandler(int32_t weapon_type)
|
||||||
{
|
{
|
||||||
WEAPON_INFO* winfo = &Weapons[weapon_type];
|
WEAPON_INFO *winfo = &Weapons[weapon_type];
|
||||||
|
|
||||||
if (Input & IN_ACTION) {
|
if (Input & IN_ACTION) {
|
||||||
LaraTargetInfo(winfo);
|
LaraTargetInfo(winfo);
|
||||||
|
@ -191,7 +191,7 @@ void PistolHandler(int32_t weapon_type)
|
||||||
void AnimatePistols(int32_t weapon_type)
|
void AnimatePistols(int32_t weapon_type)
|
||||||
{
|
{
|
||||||
PHD_ANGLE angles[2];
|
PHD_ANGLE angles[2];
|
||||||
WEAPON_INFO* winfo = &Weapons[weapon_type];
|
WEAPON_INFO *winfo = &Weapons[weapon_type];
|
||||||
|
|
||||||
int16_t anir = Lara.right_arm.frame_number;
|
int16_t anir = Lara.right_arm.frame_number;
|
||||||
if (Lara.right_arm.lock || ((Input & IN_ACTION) && !Lara.target)) {
|
if (Lara.right_arm.lock || ((Input & IN_ACTION) && !Lara.target)) {
|
||||||
|
|
|
@ -212,7 +212,7 @@ void InitialiseNewWeapon()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraTargetInfo(WEAPON_INFO* winfo)
|
void LaraTargetInfo(WEAPON_INFO *winfo)
|
||||||
{
|
{
|
||||||
if (!Lara.target) {
|
if (!Lara.target) {
|
||||||
Lara.right_arm.lock = 0;
|
Lara.right_arm.lock = 0;
|
||||||
|
@ -267,9 +267,9 @@ void LaraTargetInfo(WEAPON_INFO* winfo)
|
||||||
Lara.target_angles[1] = ang[1];
|
Lara.target_angles[1] = ang[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraGetNewTarget(WEAPON_INFO* winfo)
|
void LaraGetNewTarget(WEAPON_INFO *winfo)
|
||||||
{
|
{
|
||||||
ITEM_INFO* bestitem = NULL;
|
ITEM_INFO *bestitem = NULL;
|
||||||
int16_t bestyrot = 0x7FFF;
|
int16_t bestyrot = 0x7FFF;
|
||||||
|
|
||||||
int32_t maxdist = winfo->target_dist;
|
int32_t maxdist = winfo->target_dist;
|
||||||
|
@ -280,7 +280,7 @@ void LaraGetNewTarget(WEAPON_INFO* winfo)
|
||||||
src.z = LaraItem->pos.z;
|
src.z = LaraItem->pos.z;
|
||||||
src.room_number = LaraItem->room_number;
|
src.room_number = LaraItem->room_number;
|
||||||
|
|
||||||
ITEM_INFO* item = NULL;
|
ITEM_INFO *item = NULL;
|
||||||
for (int16_t item_num = NextItemActive; item_num != NO_ITEM;
|
for (int16_t item_num = NextItemActive; item_num != NO_ITEM;
|
||||||
item_num = item->next_active) {
|
item_num = item->next_active) {
|
||||||
item = &Items[item_num];
|
item = &Items[item_num];
|
||||||
|
@ -326,9 +326,9 @@ void LaraGetNewTarget(WEAPON_INFO* winfo)
|
||||||
LaraTargetInfo(winfo);
|
LaraTargetInfo(winfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void find_target_point(ITEM_INFO* item, GAME_VECTOR* target)
|
void find_target_point(ITEM_INFO *item, GAME_VECTOR *target)
|
||||||
{
|
{
|
||||||
int16_t* bounds = GetBestFrame(item);
|
int16_t *bounds = GetBestFrame(item);
|
||||||
int32_t x = (bounds[0] + bounds[1]) / 2;
|
int32_t x = (bounds[0] + bounds[1]) / 2;
|
||||||
int32_t y = (bounds[3] - bounds[2]) / 3 + bounds[2];
|
int32_t y = (bounds[3] - bounds[2]) / 3 + bounds[2];
|
||||||
int32_t z = (bounds[5] + bounds[4]) / 2;
|
int32_t z = (bounds[5] + bounds[4]) / 2;
|
||||||
|
@ -340,7 +340,7 @@ void find_target_point(ITEM_INFO* item, GAME_VECTOR* target)
|
||||||
target->room_number = item->room_number;
|
target->room_number = item->room_number;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AimWeapon(WEAPON_INFO* winfo, LARA_ARM* arm)
|
void AimWeapon(WEAPON_INFO *winfo, LARA_ARM *arm)
|
||||||
{
|
{
|
||||||
PHD_ANGLE destx;
|
PHD_ANGLE destx;
|
||||||
PHD_ANGLE desty;
|
PHD_ANGLE desty;
|
||||||
|
@ -379,11 +379,11 @@ void AimWeapon(WEAPON_INFO* winfo, LARA_ARM* arm)
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t FireWeapon(
|
int32_t FireWeapon(
|
||||||
int32_t weapon_type, ITEM_INFO* target, ITEM_INFO* src, PHD_ANGLE* angles)
|
int32_t weapon_type, ITEM_INFO *target, ITEM_INFO *src, PHD_ANGLE *angles)
|
||||||
{
|
{
|
||||||
WEAPON_INFO* winfo = &Weapons[weapon_type];
|
WEAPON_INFO *winfo = &Weapons[weapon_type];
|
||||||
|
|
||||||
AMMO_INFO* ammo;
|
AMMO_INFO *ammo;
|
||||||
switch (weapon_type) {
|
switch (weapon_type) {
|
||||||
case LGT_MAGNUMS:
|
case LGT_MAGNUMS:
|
||||||
ammo = &Lara.magnums;
|
ammo = &Lara.magnums;
|
||||||
|
@ -444,7 +444,7 @@ int32_t FireWeapon(
|
||||||
int32_t best = -1;
|
int32_t best = -1;
|
||||||
int32_t bestdist = 0x7FFFFFFF;
|
int32_t bestdist = 0x7FFFFFFF;
|
||||||
for (int i = 0; i < nums; i++) {
|
for (int i = 0; i < nums; i++) {
|
||||||
SPHERE* sptr = &slist[i];
|
SPHERE *sptr = &slist[i];
|
||||||
int32_t r = sptr->r;
|
int32_t r = sptr->r;
|
||||||
if (ABS(sptr->x) < r && ABS(sptr->y) < r && sptr->z > r
|
if (ABS(sptr->x) < r && ABS(sptr->y) < r && sptr->z > r
|
||||||
&& (sptr->x * sptr->x) + (sptr->y * sptr->y) <= (r * r)
|
&& (sptr->x * sptr->x) + (sptr->y * sptr->y) <= (r * r)
|
||||||
|
@ -479,7 +479,7 @@ int32_t FireWeapon(
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HitTarget(ITEM_INFO* item, GAME_VECTOR* hitpos, int32_t damage)
|
void HitTarget(ITEM_INFO *item, GAME_VECTOR *hitpos, int32_t damage)
|
||||||
{
|
{
|
||||||
if (item->hit_points > 0 && item->hit_points <= damage) {
|
if (item->hit_points > 0 && item->hit_points <= damage) {
|
||||||
SaveGame[0].kills++;
|
SaveGame[0].kills++;
|
||||||
|
|
|
@ -16,8 +16,8 @@ void LaraControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
COLL_INFO coll = { 0 };
|
COLL_INFO coll = { 0 };
|
||||||
|
|
||||||
ITEM_INFO* item = LaraItem;
|
ITEM_INFO *item = LaraItem;
|
||||||
ROOM_INFO* r = &RoomInfo[item->room_number];
|
ROOM_INFO *r = &RoomInfo[item->room_number];
|
||||||
int32_t room_submerged = r->flags & RF_UNDERWATER;
|
int32_t room_submerged = r->flags & RF_UNDERWATER;
|
||||||
|
|
||||||
#ifdef T1M_FEAT_CHEATS
|
#ifdef T1M_FEAT_CHEATS
|
||||||
|
@ -215,10 +215,10 @@ void LaraSwapMeshExtra()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimateLara(ITEM_INFO* item)
|
void AnimateLara(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
int16_t* command;
|
int16_t *command;
|
||||||
ANIM_STRUCT* anim;
|
ANIM_STRUCT *anim;
|
||||||
|
|
||||||
item->frame_number++;
|
item->frame_number++;
|
||||||
anim = &Anims[item->anim_number];
|
anim = &Anims[item->anim_number];
|
||||||
|
@ -458,7 +458,7 @@ void InitialiseLaraInventory(int32_t level_num)
|
||||||
{
|
{
|
||||||
Inv_RemoveAllItems();
|
Inv_RemoveAllItems();
|
||||||
|
|
||||||
START_INFO* start = &SaveGame[0].start[level_num];
|
START_INFO *start = &SaveGame[0].start[level_num];
|
||||||
|
|
||||||
Lara.pistols.ammo = 1000;
|
Lara.pistols.ammo = 1000;
|
||||||
if (start->got_pistols) {
|
if (start->got_pistols) {
|
||||||
|
@ -523,7 +523,7 @@ void InitialiseLaraInventory(int32_t level_num)
|
||||||
|
|
||||||
void LaraInitialiseMeshes(int32_t level_num)
|
void LaraInitialiseMeshes(int32_t level_num)
|
||||||
{
|
{
|
||||||
START_INFO* start = &SaveGame[0].start[level_num];
|
START_INFO *start = &SaveGame[0].start[level_num];
|
||||||
|
|
||||||
if (start->costume) {
|
if (start->costume) {
|
||||||
for (int i = 0; i < LM_NUMBER_OF; i++) {
|
for (int i = 0; i < LM_NUMBER_OF; i++) {
|
||||||
|
@ -664,7 +664,7 @@ void InitialiseEvilLara(int16_t item_num)
|
||||||
|
|
||||||
void ControlEvilLara(int16_t item_num)
|
void ControlEvilLara(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->hit_points < LARA_HITPOINTS) {
|
if (item->hit_points < LARA_HITPOINTS) {
|
||||||
LaraItem->hit_points -= (LARA_HITPOINTS - item->hit_points) * 10;
|
LaraItem->hit_points -= (LARA_HITPOINTS - item->hit_points) * 10;
|
||||||
|
@ -677,7 +677,7 @@ void ControlEvilLara(int16_t item_num)
|
||||||
int32_t z = 2 * 60 * WALL_L - LaraItem->pos.z;
|
int32_t z = 2 * 60 * WALL_L - LaraItem->pos.z;
|
||||||
|
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &room_num);
|
||||||
int32_t h = GetHeight(floor, x, y, z);
|
int32_t h = GetHeight(floor, x, y, z);
|
||||||
item->floor = h;
|
item->floor = h;
|
||||||
|
|
||||||
|
@ -705,7 +705,7 @@ void ControlEvilLara(int16_t item_num)
|
||||||
item->speed = 0;
|
item->speed = 0;
|
||||||
item->fall_speed = 0;
|
item->fall_speed = 0;
|
||||||
item->gravity_status = 1;
|
item->gravity_status = 1;
|
||||||
item->data = (void*)-1;
|
item->data = (void *)-1;
|
||||||
item->pos.y += 50;
|
item->pos.y += 50;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -718,7 +718,7 @@ void ControlEvilLara(int16_t item_num)
|
||||||
int32_t z = item->pos.z;
|
int32_t z = item->pos.z;
|
||||||
|
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &room_num);
|
||||||
int32_t h = GetHeight(floor, x, y, z);
|
int32_t h = GetHeight(floor, x, y, z);
|
||||||
item->floor = h;
|
item->floor = h;
|
||||||
|
|
||||||
|
@ -737,9 +737,9 @@ void ControlEvilLara(int16_t item_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawEvilLara(ITEM_INFO* item)
|
void DrawEvilLara(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
int16_t* old_mesh_ptrs[LM_NUMBER_OF];
|
int16_t *old_mesh_ptrs[LM_NUMBER_OF];
|
||||||
|
|
||||||
for (int i = 0; i < LM_NUMBER_OF; i++) {
|
for (int i = 0; i < LM_NUMBER_OF; i++) {
|
||||||
old_mesh_ptrs[i] = Lara.mesh_ptrs[i];
|
old_mesh_ptrs[i] = Lara.mesh_ptrs[i];
|
||||||
|
@ -753,7 +753,7 @@ void DrawEvilLara(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void (*LaraControlRoutines[])(ITEM_INFO* item, COLL_INFO* coll) = {
|
void (*LaraControlRoutines[])(ITEM_INFO *item, COLL_INFO *coll) = {
|
||||||
LaraAsWalk, LaraAsRun, LaraAsStop, LaraAsForwardJump,
|
LaraAsWalk, LaraAsRun, LaraAsStop, LaraAsForwardJump,
|
||||||
LaraAsPose, LaraAsFastBack, LaraAsTurnR, LaraAsTurnL,
|
LaraAsPose, LaraAsFastBack, LaraAsTurnR, LaraAsTurnL,
|
||||||
LaraAsDeath, LaraAsFastFall, LaraAsHang, LaraAsReach,
|
LaraAsDeath, LaraAsFastFall, LaraAsHang, LaraAsReach,
|
||||||
|
@ -770,7 +770,7 @@ void (*LaraControlRoutines[])(ITEM_INFO* item, COLL_INFO* coll) = {
|
||||||
LaraAsSwanDive, LaraAsFastDive, LaraAsGymnast, LaraAsWaterOut,
|
LaraAsSwanDive, LaraAsFastDive, LaraAsGymnast, LaraAsWaterOut,
|
||||||
};
|
};
|
||||||
|
|
||||||
void (*LaraCollisionRoutines[])(ITEM_INFO* item, COLL_INFO* coll) = {
|
void (*LaraCollisionRoutines[])(ITEM_INFO *item, COLL_INFO *coll) = {
|
||||||
LaraColWalk, LaraColRun, LaraColStop, LaraColForwardJump,
|
LaraColWalk, LaraColRun, LaraColStop, LaraColForwardJump,
|
||||||
LaraColPose, LaraColFastBack, LaraColTurnR, LaraColTurnL,
|
LaraColPose, LaraColFastBack, LaraColTurnR, LaraColTurnL,
|
||||||
LaraColDeath, LaraColFastFall, LaraColHang, LaraColReach,
|
LaraColDeath, LaraColFastFall, LaraColHang, LaraColReach,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
void LaraSurface(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraSurface(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Camera.target_elevation = -22 * PHD_DEGREE;
|
Camera.target_elevation = -22 * PHD_DEGREE;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ void LaraSurface(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
TestTriggers(coll->trigger, 0);
|
TestTriggers(coll->trigger, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSurfSwim(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSurfSwim(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_UWDEATH;
|
item->goal_anim_state = AS_UWDEATH;
|
||||||
|
@ -109,7 +109,7 @@ void LaraAsSurfSwim(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSurfBack(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSurfBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_UWDEATH;
|
item->goal_anim_state = AS_UWDEATH;
|
||||||
|
@ -144,7 +144,7 @@ void LaraAsSurfBack(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSurfLeft(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSurfLeft(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_UWDEATH;
|
item->goal_anim_state = AS_UWDEATH;
|
||||||
|
@ -179,7 +179,7 @@ void LaraAsSurfLeft(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSurfRight(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSurfRight(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_UWDEATH;
|
item->goal_anim_state = AS_UWDEATH;
|
||||||
|
@ -214,7 +214,7 @@ void LaraAsSurfRight(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSurfTread(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSurfTread(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->fall_speed -= 4;
|
item->fall_speed -= 4;
|
||||||
if (item->fall_speed < 0) {
|
if (item->fall_speed < 0) {
|
||||||
|
@ -295,37 +295,37 @@ void LaraAsSurfTread(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSurfSwim(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSurfSwim(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
LaraSurfaceCollision(item, coll);
|
LaraSurfaceCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSurfTread(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSurfTread(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot;
|
Lara.move_angle = item->pos.y_rot;
|
||||||
LaraSurfaceCollision(item, coll);
|
LaraSurfaceCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSurfBack(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSurfBack(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_180;
|
Lara.move_angle = item->pos.y_rot - PHD_180;
|
||||||
LaraSurfaceCollision(item, coll);
|
LaraSurfaceCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSurfLeft(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSurfLeft(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot - PHD_90;
|
Lara.move_angle = item->pos.y_rot - PHD_90;
|
||||||
LaraSurfaceCollision(item, coll);
|
LaraSurfaceCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSurfRight(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSurfRight(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
Lara.move_angle = item->pos.y_rot + PHD_90;
|
Lara.move_angle = item->pos.y_rot + PHD_90;
|
||||||
LaraSurfaceCollision(item, coll);
|
LaraSurfaceCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraSurfaceCollision(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraSurfaceCollision(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->facing = Lara.move_angle;
|
coll->facing = Lara.move_angle;
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ void LaraSurfaceCollision(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
LaraTestWaterClimbOut(item, coll);
|
LaraTestWaterClimbOut(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LaraTestWaterClimbOut(ITEM_INFO* item, COLL_INFO* coll)
|
int32_t LaraTestWaterClimbOut(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->pos.y_rot != Lara.move_angle) {
|
if (item->pos.y_rot != Lara.move_angle) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
void LaraUnderWater(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraUnderWater(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
coll->bad_pos = NO_BAD_POS;
|
coll->bad_pos = NO_BAD_POS;
|
||||||
coll->bad_neg = -UW_HITE;
|
coll->bad_neg = -UW_HITE;
|
||||||
|
@ -91,7 +91,7 @@ void LaraUnderWater(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
TestTriggers(coll->trigger, 0);
|
TestTriggers(coll->trigger, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsSwim(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsSwim(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_UWDEATH;
|
item->goal_anim_state = AS_UWDEATH;
|
||||||
|
@ -132,7 +132,7 @@ void LaraAsSwim(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsGlide(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsGlide(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->hit_points <= 0) {
|
if (item->hit_points <= 0) {
|
||||||
item->goal_anim_state = AS_UWDEATH;
|
item->goal_anim_state = AS_UWDEATH;
|
||||||
|
@ -165,7 +165,7 @@ void LaraAsGlide(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsTread(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsTread(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
#ifdef T1M_FEAT_GAMEPLAY
|
#ifdef T1M_FEAT_GAMEPLAY
|
||||||
if (T1MConfig.enable_enhanced_look) {
|
if (T1MConfig.enable_enhanced_look) {
|
||||||
|
@ -202,14 +202,14 @@ void LaraAsTread(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsDive(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsDive(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (Input & AS_RUN) {
|
if (Input & AS_RUN) {
|
||||||
item->pos.x_rot -= PHD_DEGREE;
|
item->pos.x_rot -= PHD_DEGREE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraAsUWDeath(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraAsUWDeath(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->fall_speed -= 8;
|
item->fall_speed -= 8;
|
||||||
if (item->fall_speed <= 0) {
|
if (item->fall_speed <= 0) {
|
||||||
|
@ -226,27 +226,27 @@ void LaraAsUWDeath(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColSwim(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColSwim(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraSwimCollision(item, coll);
|
LaraSwimCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColGlide(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColGlide(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraSwimCollision(item, coll);
|
LaraSwimCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColTread(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColTread(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraSwimCollision(item, coll);
|
LaraSwimCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColDive(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColDive(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LaraSwimCollision(item, coll);
|
LaraSwimCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraColUWDeath(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraColUWDeath(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
item->hit_points = -1;
|
item->hit_points = -1;
|
||||||
Lara.air = -1;
|
Lara.air = -1;
|
||||||
|
@ -259,7 +259,7 @@ void LaraColUWDeath(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
LaraSwimCollision(item, coll);
|
LaraSwimCollision(item, coll);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraSwimCollision(ITEM_INFO* item, COLL_INFO* coll)
|
void LaraSwimCollision(ITEM_INFO *item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
if (item->pos.x_rot >= -PHD_90 && item->pos.x_rot <= PHD_90) {
|
if (item->pos.x_rot >= -PHD_90 && item->pos.x_rot <= PHD_90) {
|
||||||
Lara.move_angle = coll->facing = item->pos.y_rot;
|
Lara.move_angle = coll->facing = item->pos.y_rot;
|
||||||
|
@ -315,13 +315,13 @@ void LaraSwimCollision(ITEM_INFO* item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaraWaterCurrent(COLL_INFO* coll)
|
void LaraWaterCurrent(COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
PHD_VECTOR target; // [esp+Ch] [ebp-Ch]
|
PHD_VECTOR target; // [esp+Ch] [ebp-Ch]
|
||||||
|
|
||||||
ITEM_INFO* item = LaraItem;
|
ITEM_INFO *item = LaraItem;
|
||||||
ROOM_INFO* r = &RoomInfo[item->room_number];
|
ROOM_INFO *r = &RoomInfo[item->room_number];
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
&r->floor
|
&r->floor
|
||||||
[((item->pos.z - r->z) >> WALL_SHIFT)
|
[((item->pos.z - r->z) >> WALL_SHIFT)
|
||||||
+ ((item->pos.x - r->x) >> WALL_SHIFT) * r->x_size];
|
+ ((item->pos.x - r->x) >> WALL_SHIFT) * r->x_size];
|
||||||
|
|
|
@ -38,9 +38,9 @@ typedef enum {
|
||||||
THS_DONE = 3,
|
THS_DONE = 3,
|
||||||
} THOR_HAMMER_STATE;
|
} THOR_HAMMER_STATE;
|
||||||
|
|
||||||
void DrawLightning(ITEM_INFO* item)
|
void DrawLightning(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
int16_t* frmptr[2];
|
int16_t *frmptr[2];
|
||||||
int32_t rate;
|
int32_t rate;
|
||||||
GetFrames(item, frmptr, &rate);
|
GetFrames(item, frmptr, &rate);
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ void DrawLightning(ITEM_INFO* item)
|
||||||
|
|
||||||
phd_PopMatrix();
|
phd_PopMatrix();
|
||||||
|
|
||||||
LIGHTNING* l = item->data;
|
LIGHTNING *l = item->data;
|
||||||
if (!l->onstate) {
|
if (!l->onstate) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ void DrawLightning(ITEM_INFO* item)
|
||||||
int32_t dz = (z2 - z1) / LIGHTNING_STEPS;
|
int32_t dz = (z2 - z1) / LIGHTNING_STEPS;
|
||||||
|
|
||||||
for (int i = 0; i < LIGHTNING_STEPS; i++) {
|
for (int i = 0; i < LIGHTNING_STEPS; i++) {
|
||||||
PHD_VECTOR* pos = &l->wibble[i];
|
PHD_VECTOR *pos = &l->wibble[i];
|
||||||
pos->x += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
pos->x += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
||||||
pos->y += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
pos->y += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
||||||
pos->z += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
pos->z += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
||||||
|
@ -136,7 +136,7 @@ void DrawLightning(ITEM_INFO* item)
|
||||||
dz = (z2 - z1) / steps;
|
dz = (z2 - z1) / steps;
|
||||||
|
|
||||||
for (j = 0; j < steps; j++) {
|
for (j = 0; j < steps; j++) {
|
||||||
PHD_VECTOR* pos = l->shoot[i];
|
PHD_VECTOR *pos = l->shoot[i];
|
||||||
pos->x += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
pos->x += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
||||||
pos->y += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
pos->y += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
||||||
pos->z += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
pos->z += (GetRandomDraw() - PHD_90) * LIGHTNING_RND;
|
||||||
|
@ -168,7 +168,7 @@ void DrawLightning(ITEM_INFO* item)
|
||||||
|
|
||||||
void InitialiseLightning(int16_t item_num)
|
void InitialiseLightning(int16_t item_num)
|
||||||
{
|
{
|
||||||
LIGHTNING* l = game_malloc(sizeof(LIGHTNING), 0);
|
LIGHTNING *l = game_malloc(sizeof(LIGHTNING), 0);
|
||||||
Items[item_num].data = l;
|
Items[item_num].data = l;
|
||||||
|
|
||||||
if (Objects[Items[item_num].object_number].nmeshes > 1) {
|
if (Objects[Items[item_num].object_number].nmeshes > 1) {
|
||||||
|
@ -185,8 +185,8 @@ void InitialiseLightning(int16_t item_num)
|
||||||
|
|
||||||
void LightningControl(int16_t item_num)
|
void LightningControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
LIGHTNING* l = item->data;
|
LIGHTNING *l = item->data;
|
||||||
|
|
||||||
if (!TriggerActive(item)) {
|
if (!TriggerActive(item)) {
|
||||||
l->count = 1;
|
l->count = 1;
|
||||||
|
@ -235,7 +235,7 @@ void LightningControl(int16_t item_num)
|
||||||
|
|
||||||
l->zapped = 1;
|
l->zapped = 1;
|
||||||
} else if (l->notarget) {
|
} else if (l->notarget) {
|
||||||
FLOOR_INFO* floor = GetFloor(
|
FLOOR_INFO *floor = GetFloor(
|
||||||
item->pos.x, item->pos.y, item->pos.z, &item->room_number);
|
item->pos.x, item->pos.y, item->pos.z, &item->room_number);
|
||||||
int32_t h = GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
int32_t h = GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
||||||
l->target.x = item->pos.x;
|
l->target.x = item->pos.x;
|
||||||
|
@ -272,9 +272,9 @@ void LightningControl(int16_t item_num)
|
||||||
SoundEffect(98, &item->pos, 0);
|
SoundEffect(98, &item->pos, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LightningCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void LightningCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
LIGHTNING* l = Items[item_num].data;
|
LIGHTNING *l = Items[item_num].data;
|
||||||
if (!l->zapped) {
|
if (!l->zapped) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -288,9 +288,9 @@ void LightningCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
|
|
||||||
void InitialiseThorsHandle(int16_t item_num)
|
void InitialiseThorsHandle(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* hand_item = &Items[item_num];
|
ITEM_INFO *hand_item = &Items[item_num];
|
||||||
int16_t head_item_num = CreateItem();
|
int16_t head_item_num = CreateItem();
|
||||||
ITEM_INFO* head_item = &Items[head_item_num];
|
ITEM_INFO *head_item = &Items[head_item_num];
|
||||||
head_item->object_number = O_THORS_HEAD;
|
head_item->object_number = O_THORS_HEAD;
|
||||||
head_item->room_number = hand_item->room_number;
|
head_item->room_number = hand_item->room_number;
|
||||||
head_item->pos = hand_item->pos;
|
head_item->pos = hand_item->pos;
|
||||||
|
@ -302,7 +302,7 @@ void InitialiseThorsHandle(int16_t item_num)
|
||||||
|
|
||||||
void ThorsHandleControl(int16_t item_num)
|
void ThorsHandleControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
switch (item->current_anim_state) {
|
switch (item->current_anim_state) {
|
||||||
case THS_SET:
|
case THS_SET:
|
||||||
|
@ -365,7 +365,7 @@ void ThorsHandleControl(int16_t item_num)
|
||||||
int32_t old_z = z;
|
int32_t old_z = z;
|
||||||
|
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(x, item->pos.y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, item->pos.y, z, &room_num);
|
||||||
GetHeight(floor, x, item->pos.y, z);
|
GetHeight(floor, x, item->pos.y, z);
|
||||||
TestTriggers(TriggerIndex, 1);
|
TestTriggers(TriggerIndex, 1);
|
||||||
|
|
||||||
|
@ -399,7 +399,7 @@ void ThorsHandleControl(int16_t item_num)
|
||||||
}
|
}
|
||||||
AnimateItem(item);
|
AnimateItem(item);
|
||||||
|
|
||||||
ITEM_INFO* head_item = item->data;
|
ITEM_INFO *head_item = item->data;
|
||||||
int32_t anim = item->anim_number - Objects[O_THORS_HANDLE].anim_index;
|
int32_t anim = item->anim_number - Objects[O_THORS_HANDLE].anim_index;
|
||||||
int32_t frm = item->frame_number - Anims[item->anim_number].frame_base;
|
int32_t frm = item->frame_number - Anims[item->anim_number].frame_base;
|
||||||
head_item->anim_number = Objects[O_THORS_HEAD].anim_index + anim;
|
head_item->anim_number = Objects[O_THORS_HEAD].anim_index + anim;
|
||||||
|
@ -408,9 +408,9 @@ void ThorsHandleControl(int16_t item_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThorsHandleCollision(
|
void ThorsHandleCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -419,9 +419,9 @@ void ThorsHandleCollision(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThorsHeadCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void ThorsHeadCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,18 +4,18 @@
|
||||||
#include "game/types.h"
|
#include "game/types.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void DrawLightning(ITEM_INFO* item);
|
void DrawLightning(ITEM_INFO *item);
|
||||||
void InitialiseLightning(int16_t item_num);
|
void InitialiseLightning(int16_t item_num);
|
||||||
void LightningControl(int16_t item_num);
|
void LightningControl(int16_t item_num);
|
||||||
void LightningCollision(
|
void LightningCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
|
|
||||||
void InitialiseThorsHandle(int16_t item_num);
|
void InitialiseThorsHandle(int16_t item_num);
|
||||||
void ThorsHandleControl(int16_t item_num);
|
void ThorsHandleControl(int16_t item_num);
|
||||||
void ThorsHandleCollision(
|
void ThorsHandleCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void ThorsHeadCollision(
|
void ThorsHeadCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
|
|
||||||
void T1MInjectGameLightning();
|
void T1MInjectGameLightning();
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ void InitialiseLOTArray()
|
||||||
BaddieSlots =
|
BaddieSlots =
|
||||||
game_malloc(NUM_SLOTS * sizeof(CREATURE_INFO), GBUF_CREATURE_DATA);
|
game_malloc(NUM_SLOTS * sizeof(CREATURE_INFO), GBUF_CREATURE_DATA);
|
||||||
for (int i = 0; i < NUM_SLOTS; i++) {
|
for (int i = 0; i < NUM_SLOTS; i++) {
|
||||||
CREATURE_INFO* creature = &BaddieSlots[i];
|
CREATURE_INFO *creature = &BaddieSlots[i];
|
||||||
creature->item_num = NO_ITEM;
|
creature->item_num = NO_ITEM;
|
||||||
creature->LOT.node =
|
creature->LOT.node =
|
||||||
game_malloc(sizeof(BOX_NODE) * NumberBoxes, GBUF_CREATURE_LOT);
|
game_malloc(sizeof(BOX_NODE) * NumberBoxes, GBUF_CREATURE_LOT);
|
||||||
|
@ -20,8 +20,8 @@ void InitialiseLOTArray()
|
||||||
|
|
||||||
void DisableBaddieAI(int16_t item_num)
|
void DisableBaddieAI(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
CREATURE_INFO* creature = item->data;
|
CREATURE_INFO *creature = item->data;
|
||||||
item->data = NULL;
|
item->data = NULL;
|
||||||
if (creature) {
|
if (creature) {
|
||||||
creature->item_num = NO_ITEM;
|
creature->item_num = NO_ITEM;
|
||||||
|
@ -37,7 +37,7 @@ int32_t EnableBaddieAI(int16_t item_num, int32_t always)
|
||||||
|
|
||||||
if (SlotsUsed < NUM_SLOTS) {
|
if (SlotsUsed < NUM_SLOTS) {
|
||||||
for (int32_t slot = 0; slot < NUM_SLOTS; slot++) {
|
for (int32_t slot = 0; slot < NUM_SLOTS; slot++) {
|
||||||
CREATURE_INFO* creature = &BaddieSlots[slot];
|
CREATURE_INFO *creature = &BaddieSlots[slot];
|
||||||
if (creature->item_num == NO_ITEM) {
|
if (creature->item_num == NO_ITEM) {
|
||||||
InitialiseSlot(item_num, slot);
|
InitialiseSlot(item_num, slot);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -48,7 +48,7 @@ int32_t 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 = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
int32_t x = (item->pos.x - Camera.pos.x) >> 8;
|
int32_t x = (item->pos.x - Camera.pos.x) >> 8;
|
||||||
int32_t y = (item->pos.y - Camera.pos.y) >> 8;
|
int32_t y = (item->pos.y - Camera.pos.y) >> 8;
|
||||||
int32_t z = (item->pos.z - Camera.pos.z) >> 8;
|
int32_t z = (item->pos.z - Camera.pos.z) >> 8;
|
||||||
|
@ -57,8 +57,8 @@ int32_t 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 = &BaddieSlots[slot];
|
CREATURE_INFO *creature = &BaddieSlots[slot];
|
||||||
ITEM_INFO* item = &Items[creature->item_num];
|
ITEM_INFO *item = &Items[creature->item_num];
|
||||||
int32_t x = (item->pos.x - Camera.pos.x) >> 8;
|
int32_t x = (item->pos.x - Camera.pos.x) >> 8;
|
||||||
int32_t y = (item->pos.y - Camera.pos.y) >> 8;
|
int32_t y = (item->pos.y - Camera.pos.y) >> 8;
|
||||||
int32_t z = (item->pos.z - Camera.pos.z) >> 8;
|
int32_t z = (item->pos.z - Camera.pos.z) >> 8;
|
||||||
|
@ -81,8 +81,8 @@ int32_t EnableBaddieAI(int16_t item_num, int32_t always)
|
||||||
|
|
||||||
void InitialiseSlot(int16_t item_num, int32_t slot)
|
void InitialiseSlot(int16_t item_num, int32_t slot)
|
||||||
{
|
{
|
||||||
CREATURE_INFO* creature = &BaddieSlots[slot];
|
CREATURE_INFO *creature = &BaddieSlots[slot];
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &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;
|
||||||
|
@ -130,12 +130,12 @@ void InitialiseSlot(int16_t item_num, int32_t slot)
|
||||||
SlotsUsed++;
|
SlotsUsed++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateZone(ITEM_INFO* item)
|
void CreateZone(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
CREATURE_INFO* creature = item->data;
|
CREATURE_INFO *creature = item->data;
|
||||||
|
|
||||||
int16_t* zone;
|
int16_t *zone;
|
||||||
int16_t* flip;
|
int16_t *flip;
|
||||||
if (creature->LOT.fly) {
|
if (creature->LOT.fly) {
|
||||||
zone = FlyZone[0];
|
zone = FlyZone[0];
|
||||||
flip = FlyZone[1];
|
flip = FlyZone[1];
|
||||||
|
@ -147,7 +147,7 @@ void CreateZone(ITEM_INFO* item)
|
||||||
flip = GroundZone2[1];
|
flip = GroundZone2[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOM_INFO* r = &RoomInfo[item->room_number];
|
ROOM_INFO *r = &RoomInfo[item->room_number];
|
||||||
int32_t x_floor = (item->pos.z - r->z) >> WALL_SHIFT;
|
int32_t x_floor = (item->pos.z - r->z) >> WALL_SHIFT;
|
||||||
int32_t y_floor = (item->pos.x - r->x) >> WALL_SHIFT;
|
int32_t y_floor = (item->pos.x - r->x) >> WALL_SHIFT;
|
||||||
item->box_number = r->floor[x_floor + y_floor * r->x_size].box;
|
item->box_number = r->floor[x_floor + y_floor * r->x_size].box;
|
||||||
|
@ -156,7 +156,7 @@ void CreateZone(ITEM_INFO* item)
|
||||||
int16_t flip_number = flip[item->box_number];
|
int16_t flip_number = flip[item->box_number];
|
||||||
|
|
||||||
creature->LOT.zone_count = 0;
|
creature->LOT.zone_count = 0;
|
||||||
BOX_NODE* node = creature->LOT.node;
|
BOX_NODE *node = creature->LOT.node;
|
||||||
for (int i = 0; i < NumberBoxes; i++) {
|
for (int i = 0; i < NumberBoxes; i++) {
|
||||||
if (zone[i] == zone_number || flip[i] == flip_number) {
|
if (zone[i] == zone_number || flip[i] == flip_number) {
|
||||||
node->box_number = i;
|
node->box_number = i;
|
||||||
|
@ -166,14 +166,14 @@ void CreateZone(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t InitialiseLOT(LOT_INFO* LOT)
|
int32_t InitialiseLOT(LOT_INFO *LOT)
|
||||||
{
|
{
|
||||||
LOT->node = game_malloc(sizeof(BOX_NODE) * NumberBoxes, GBUF_CREATURE_LOT);
|
LOT->node = game_malloc(sizeof(BOX_NODE) * NumberBoxes, GBUF_CREATURE_LOT);
|
||||||
ClearLOT(LOT);
|
ClearLOT(LOT);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearLOT(LOT_INFO* LOT)
|
void ClearLOT(LOT_INFO *LOT)
|
||||||
{
|
{
|
||||||
LOT->search_number = 0;
|
LOT->search_number = 0;
|
||||||
LOT->head = NO_BOX;
|
LOT->head = NO_BOX;
|
||||||
|
@ -182,7 +182,7 @@ void ClearLOT(LOT_INFO* LOT)
|
||||||
LOT->required_box = NO_BOX;
|
LOT->required_box = NO_BOX;
|
||||||
|
|
||||||
for (int i = 0; i < NumberBoxes; i++) {
|
for (int i = 0; i < NumberBoxes; i++) {
|
||||||
BOX_NODE* node = &LOT->node[i];
|
BOX_NODE *node = &LOT->node[i];
|
||||||
node->search_number = 0;
|
node->search_number = 0;
|
||||||
node->exit_box = NO_BOX;
|
node->exit_box = NO_BOX;
|
||||||
node->next_expansion = NO_BOX;
|
node->next_expansion = NO_BOX;
|
||||||
|
|
|
@ -8,9 +8,9 @@ void InitialiseLOTArray();
|
||||||
void DisableBaddieAI(int16_t item_num);
|
void DisableBaddieAI(int16_t item_num);
|
||||||
int32_t EnableBaddieAI(int16_t item_num, int32_t always);
|
int32_t EnableBaddieAI(int16_t item_num, int32_t always);
|
||||||
void InitialiseSlot(int16_t item_num, int32_t slot);
|
void InitialiseSlot(int16_t item_num, int32_t slot);
|
||||||
void CreateZone(ITEM_INFO* item);
|
void CreateZone(ITEM_INFO *item);
|
||||||
int32_t InitialiseLOT(LOT_INFO* LOT);
|
int32_t InitialiseLOT(LOT_INFO *LOT);
|
||||||
void ClearLOT(LOT_INFO* LOT);
|
void ClearLOT(LOT_INFO *LOT);
|
||||||
|
|
||||||
void T1MInjectGameLOT();
|
void T1MInjectGameLOT();
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ static int16_t MovingBlockBounds[12] = {
|
||||||
// original name: InitialiseMovingBlock
|
// original name: InitialiseMovingBlock
|
||||||
void InitialiseMovableBlock(int16_t item_num)
|
void InitialiseMovableBlock(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (item->status != IS_INVISIBLE) {
|
if (item->status != IS_INVISIBLE) {
|
||||||
AlterFloorHeight(item, -1024);
|
AlterFloorHeight(item, -1024);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ void InitialiseMovableBlock(int16_t item_num)
|
||||||
// original name: MovableBlock
|
// original name: MovableBlock
|
||||||
void MovableBlockControl(int16_t item_num)
|
void MovableBlockControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->flags & IF_ONESHOT) {
|
if (item->flags & IF_ONESHOT) {
|
||||||
AlterFloorHeight(item, 1024);
|
AlterFloorHeight(item, 1024);
|
||||||
|
@ -58,7 +58,7 @@ void MovableBlockControl(int16_t item_num)
|
||||||
AnimateItem(item);
|
AnimateItem(item);
|
||||||
|
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
int32_t height = GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
int32_t height = GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
||||||
|
|
||||||
|
@ -89,9 +89,9 @@ void MovableBlockControl(int16_t item_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
void MovableBlockCollision(
|
void MovableBlockCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (!CHK_ANY(Input, IN_ACTION) || item->status == IS_ACTIVE
|
if (!CHK_ANY(Input, IN_ACTION) || item->status == IS_ACTIVE
|
||||||
|| lara_item->gravity_status || lara_item->pos.y != item->pos.y) {
|
|| lara_item->gravity_status || lara_item->pos.y != item->pos.y) {
|
||||||
|
@ -184,10 +184,10 @@ void MovableBlockCollision(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t TestBlockMovable(ITEM_INFO* item, int32_t blockhite)
|
int32_t TestBlockMovable(ITEM_INFO *item, int32_t blockhite)
|
||||||
{
|
{
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
if (floor->floor == NO_HEIGHT / 256) {
|
if (floor->floor == NO_HEIGHT / 256) {
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -200,7 +200,7 @@ int32_t TestBlockMovable(ITEM_INFO* item, int32_t blockhite)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t TestBlockPush(ITEM_INFO* item, int32_t blockhite, uint16_t quadrant)
|
int32_t TestBlockPush(ITEM_INFO *item, int32_t blockhite, uint16_t quadrant)
|
||||||
{
|
{
|
||||||
if (!TestBlockMovable(item, blockhite)) {
|
if (!TestBlockMovable(item, blockhite)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -226,7 +226,7 @@ int32_t TestBlockPush(ITEM_INFO* item, int32_t blockhite, uint16_t quadrant)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &room_num);
|
||||||
COLL_INFO coll;
|
COLL_INFO coll;
|
||||||
coll.quadrant = quadrant;
|
coll.quadrant = quadrant;
|
||||||
coll.radius = 500;
|
coll.radius = 500;
|
||||||
|
@ -246,7 +246,7 @@ int32_t TestBlockPush(ITEM_INFO* item, int32_t blockhite, uint16_t quadrant)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t TestBlockPull(ITEM_INFO* item, int32_t blockhite, uint16_t quadrant)
|
int32_t TestBlockPull(ITEM_INFO *item, int32_t blockhite, uint16_t quadrant)
|
||||||
{
|
{
|
||||||
if (!TestBlockMovable(item, blockhite)) {
|
if (!TestBlockMovable(item, blockhite)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -274,7 +274,7 @@ int32_t TestBlockPull(ITEM_INFO* item, int32_t blockhite, uint16_t quadrant)
|
||||||
int32_t z = item->pos.z + z_add;
|
int32_t z = item->pos.z + z_add;
|
||||||
|
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &room_num);
|
||||||
COLL_INFO coll;
|
COLL_INFO coll;
|
||||||
coll.quadrant = quadrant;
|
coll.quadrant = quadrant;
|
||||||
coll.radius = 500;
|
coll.radius = 500;
|
||||||
|
@ -321,14 +321,14 @@ int32_t TestBlockPull(ITEM_INFO* item, int32_t blockhite, uint16_t quadrant)
|
||||||
|
|
||||||
void InitialiseRollingBlock(int16_t item_num)
|
void InitialiseRollingBlock(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
AlterFloorHeight(item, -2048);
|
AlterFloorHeight(item, -2048);
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: RollingBlock
|
// original name: RollingBlock
|
||||||
void RollingBlockControl(int16_t item_num)
|
void RollingBlockControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (TriggerActive(item)) {
|
if (TriggerActive(item)) {
|
||||||
if (item->current_anim_state == RBS_START) {
|
if (item->current_anim_state == RBS_START) {
|
||||||
item->goal_anim_state = RBS_END;
|
item->goal_anim_state = RBS_END;
|
||||||
|
@ -357,12 +357,12 @@ void RollingBlockControl(int16_t item_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlterFloorHeight(ITEM_INFO* item, int32_t height)
|
void AlterFloorHeight(ITEM_INFO *item, int32_t height)
|
||||||
{
|
{
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
FLOOR_INFO* ceiling = GetFloor(
|
FLOOR_INFO *ceiling = GetFloor(
|
||||||
item->pos.x, item->pos.y + height - WALL_L, item->pos.z, &room_num);
|
item->pos.x, item->pos.y + height - WALL_L, item->pos.z, &room_num);
|
||||||
|
|
||||||
if (floor->floor == NO_HEIGHT / 256) {
|
if (floor->floor == NO_HEIGHT / 256) {
|
||||||
|
@ -383,7 +383,7 @@ void AlterFloorHeight(ITEM_INFO* item, int32_t height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawMovableBlock(ITEM_INFO* item)
|
void DrawMovableBlock(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
if (item->status == IS_ACTIVE) {
|
if (item->status == IS_ACTIVE) {
|
||||||
DrawUnclippedItem(item);
|
DrawUnclippedItem(item);
|
||||||
|
|
|
@ -10,17 +10,17 @@
|
||||||
void InitialiseMovableBlock(int16_t item_num);
|
void InitialiseMovableBlock(int16_t item_num);
|
||||||
void MovableBlockControl(int16_t item_num);
|
void MovableBlockControl(int16_t item_num);
|
||||||
void MovableBlockCollision(
|
void MovableBlockCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
int32_t TestBlockMovable(ITEM_INFO* item, int32_t blockhite);
|
int32_t TestBlockMovable(ITEM_INFO *item, int32_t blockhite);
|
||||||
int32_t TestBlockPush(ITEM_INFO* item, int32_t blokhite, uint16_t quadrant);
|
int32_t TestBlockPush(ITEM_INFO *item, int32_t blokhite, uint16_t quadrant);
|
||||||
int32_t TestBlockPull(ITEM_INFO* item, int32_t blokhite, uint16_t quadrant);
|
int32_t TestBlockPull(ITEM_INFO *item, int32_t blokhite, uint16_t quadrant);
|
||||||
|
|
||||||
void InitialiseRollingBlock(int16_t item_num);
|
void InitialiseRollingBlock(int16_t item_num);
|
||||||
void RollingBlockControl(int16_t item_num);
|
void RollingBlockControl(int16_t item_num);
|
||||||
|
|
||||||
void AlterFloorHeight(ITEM_INFO* item, int32_t height);
|
void AlterFloorHeight(ITEM_INFO *item, int32_t height);
|
||||||
|
|
||||||
void DrawMovableBlock(ITEM_INFO* item);
|
void DrawMovableBlock(ITEM_INFO *item);
|
||||||
|
|
||||||
void T1MInjectGameMoveBlock();
|
void T1MInjectGameMoveBlock();
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ static BITE_INFO NatlaGun = { 5, 220, 7, 4 };
|
||||||
|
|
||||||
void AbortionControl(int16_t item_num)
|
void AbortionControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -76,7 +76,7 @@ void AbortionControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* abortion = item->data;
|
CREATURE_INFO *abortion = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
|
|
||||||
|
@ -251,7 +251,7 @@ void AbortionControl(int16_t item_num)
|
||||||
if (item->status == IS_DEACTIVATED) {
|
if (item->status == IS_DEACTIVATED) {
|
||||||
SoundEffect(171, &item->pos, 0);
|
SoundEffect(171, &item->pos, 0);
|
||||||
ExplodingDeath(item_num, -1, ABORTION_PART_DAMAGE);
|
ExplodingDeath(item_num, -1, ABORTION_PART_DAMAGE);
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &item->room_number);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &item->room_number);
|
||||||
GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
||||||
TestTriggers(TriggerIndex, 1);
|
TestTriggers(TriggerIndex, 1);
|
||||||
|
@ -264,7 +264,7 @@ void AbortionControl(int16_t item_num)
|
||||||
void NatlaControl(int16_t item_num)
|
void NatlaControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
static int16_t facing = 0;
|
static int16_t facing = 0;
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -273,7 +273,7 @@ void NatlaControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* natla = item->data;
|
CREATURE_INFO *natla = 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;
|
||||||
|
@ -326,7 +326,7 @@ void NatlaControl(int16_t item_num)
|
||||||
if (timer >= 20) {
|
if (timer >= 20) {
|
||||||
int16_t fx_num = CreatureEffect(item, &NatlaGun, ShardGun);
|
int16_t fx_num = CreatureEffect(item, &NatlaGun, ShardGun);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
gun = fx->pos.x_rot;
|
gun = fx->pos.x_rot;
|
||||||
SoundEffect(123, &fx->pos, 0);
|
SoundEffect(123, &fx->pos, 0);
|
||||||
}
|
}
|
||||||
|
@ -339,7 +339,7 @@ void NatlaControl(int16_t item_num)
|
||||||
if (timer >= 20) {
|
if (timer >= 20) {
|
||||||
int16_t fx_num = CreatureEffect(item, &NatlaGun, ShardGun);
|
int16_t fx_num = CreatureEffect(item, &NatlaGun, ShardGun);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
gun = fx->pos.x_rot;
|
gun = fx->pos.x_rot;
|
||||||
SoundEffect(123, &fx->pos, 0);
|
SoundEffect(123, &fx->pos, 0);
|
||||||
}
|
}
|
||||||
|
@ -445,7 +445,7 @@ void NatlaControl(int16_t item_num)
|
||||||
if (timer >= 30) {
|
if (timer >= 30) {
|
||||||
int16_t fx_num = CreatureEffect(item, &NatlaGun, RocketGun);
|
int16_t fx_num = CreatureEffect(item, &NatlaGun, RocketGun);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
gun = fx->pos.x_rot;
|
gun = fx->pos.x_rot;
|
||||||
SoundEffect(123, &fx->pos, 0);
|
SoundEffect(123, &fx->pos, 0);
|
||||||
}
|
}
|
||||||
|
@ -467,17 +467,17 @@ void NatlaControl(int16_t item_num)
|
||||||
if (!item->required_anim_state) {
|
if (!item->required_anim_state) {
|
||||||
int16_t fx_num = CreatureEffect(item, &NatlaGun, RocketGun);
|
int16_t fx_num = CreatureEffect(item, &NatlaGun, RocketGun);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
gun = fx->pos.x_rot;
|
gun = fx->pos.x_rot;
|
||||||
}
|
}
|
||||||
fx_num = CreatureEffect(item, &NatlaGun, RocketGun);
|
fx_num = CreatureEffect(item, &NatlaGun, RocketGun);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.y_rot += (GetRandomControl() - 0x4000) / 4;
|
fx->pos.y_rot += (GetRandomControl() - 0x4000) / 4;
|
||||||
}
|
}
|
||||||
fx_num = CreatureEffect(item, &NatlaGun, RocketGun);
|
fx_num = CreatureEffect(item, &NatlaGun, RocketGun);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.y_rot += (GetRandomControl() - 0x4000) / 4;
|
fx->pos.y_rot += (GetRandomControl() - 0x4000) / 4;
|
||||||
}
|
}
|
||||||
item->required_anim_state = NATLA_STOP;
|
item->required_anim_state = NATLA_STOP;
|
||||||
|
@ -504,8 +504,8 @@ void NatlaControl(int16_t item_num)
|
||||||
|
|
||||||
void ControlNatlaGun(int16_t fx_num)
|
void ControlNatlaGun(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
OBJECT_INFO* object = &Objects[fx->object_number];
|
OBJECT_INFO *object = &Objects[fx->object_number];
|
||||||
|
|
||||||
fx->frame_number--;
|
fx->frame_number--;
|
||||||
if (fx->frame_number <= object->nmeshes) {
|
if (fx->frame_number <= object->nmeshes) {
|
||||||
|
@ -520,7 +520,7 @@ void ControlNatlaGun(int16_t fx_num)
|
||||||
int32_t x = fx->pos.x + ((fx->speed * phd_sin(fx->pos.y_rot)) >> W2V_SHIFT);
|
int32_t x = fx->pos.x + ((fx->speed * phd_sin(fx->pos.y_rot)) >> W2V_SHIFT);
|
||||||
int32_t y = fx->pos.y;
|
int32_t y = fx->pos.y;
|
||||||
int16_t room_num = fx->room_number;
|
int16_t room_num = fx->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(x, y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, y, z, &room_num);
|
||||||
|
|
||||||
if (y >= GetHeight(floor, x, y, z) || y <= GetCeiling(floor, x, y, z)) {
|
if (y >= GetHeight(floor, x, y, z) || y <= GetCeiling(floor, x, y, z)) {
|
||||||
return;
|
return;
|
||||||
|
@ -528,7 +528,7 @@ void ControlNatlaGun(int16_t fx_num)
|
||||||
|
|
||||||
fx_num = CreateEffect(room_num);
|
fx_num = CreateEffect(room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* newfx = &Effects[fx_num];
|
FX_INFO *newfx = &Effects[fx_num];
|
||||||
newfx->pos.x = x;
|
newfx->pos.x = x;
|
||||||
newfx->pos.y = y;
|
newfx->pos.y = y;
|
||||||
newfx->pos.z = z;
|
newfx->pos.z = z;
|
||||||
|
|
|
@ -23,9 +23,9 @@ typedef enum {
|
||||||
BOAT_STOP = 3,
|
BOAT_STOP = 3,
|
||||||
} BOAT_ANIM;
|
} BOAT_ANIM;
|
||||||
|
|
||||||
void ShutThatDoor(DOORPOS_DATA* d)
|
void ShutThatDoor(DOORPOS_DATA *d)
|
||||||
{
|
{
|
||||||
FLOOR_INFO* floor = d->floor;
|
FLOOR_INFO *floor = d->floor;
|
||||||
if (!floor) {
|
if (!floor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -43,9 +43,9 @@ void ShutThatDoor(DOORPOS_DATA* d)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenThatDoor(DOORPOS_DATA* d)
|
void OpenThatDoor(DOORPOS_DATA *d)
|
||||||
{
|
{
|
||||||
FLOOR_INFO* floor = d->floor;
|
FLOOR_INFO *floor = d->floor;
|
||||||
if (!floor) {
|
if (!floor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ void OpenThatDoor(DOORPOS_DATA* d)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef T1M_FEAT_CHEATS
|
#ifdef T1M_FEAT_CHEATS
|
||||||
void OpenClosestDoors(ITEM_INFO* lara_item)
|
void OpenClosestDoors(ITEM_INFO *lara_item)
|
||||||
{
|
{
|
||||||
int16_t best_door = NO_ITEM;
|
int16_t best_door = NO_ITEM;
|
||||||
int32_t best_dist = 0x7FFFFFFF;
|
int32_t best_dist = 0x7FFFFFFF;
|
||||||
|
@ -67,7 +67,7 @@ void OpenClosestDoors(ITEM_INFO* lara_item)
|
||||||
|
|
||||||
int16_t item_num = RoomInfo[lara_item->room_number].item_number;
|
int16_t item_num = RoomInfo[lara_item->room_number].item_number;
|
||||||
while (item_num != NO_ITEM) {
|
while (item_num != NO_ITEM) {
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
int32_t x = (item->pos.x - lara_item->pos.x) >> 8;
|
int32_t x = (item->pos.x - lara_item->pos.x) >> 8;
|
||||||
int32_t y = (item->pos.y - lara_item->pos.y) >> 8;
|
int32_t y = (item->pos.y - lara_item->pos.y) >> 8;
|
||||||
int32_t z = (item->pos.z - lara_item->pos.z) >> 8;
|
int32_t z = (item->pos.z - lara_item->pos.z) >> 8;
|
||||||
|
@ -88,7 +88,7 @@ void OpenClosestDoors(ITEM_INFO* lara_item)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_INFO* item = &Items[best_door];
|
ITEM_INFO *item = &Items[best_door];
|
||||||
if (!item->active) {
|
if (!item->active) {
|
||||||
AddActiveItem(best_door);
|
AddActiveItem(best_door);
|
||||||
item->touch_bits = 0;
|
item->touch_bits = 0;
|
||||||
|
@ -100,8 +100,8 @@ void OpenClosestDoors(ITEM_INFO* lara_item)
|
||||||
|
|
||||||
void InitialiseDoor(int16_t item_num)
|
void InitialiseDoor(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
DOOR_DATA* door = game_malloc(sizeof(DOOR_DATA), GBUF_EXTRA_DOOR_STUFF);
|
DOOR_DATA *door = game_malloc(sizeof(DOOR_DATA), GBUF_EXTRA_DOOR_STUFF);
|
||||||
item->data = door;
|
item->data = door;
|
||||||
|
|
||||||
int32_t dx = 0;
|
int32_t dx = 0;
|
||||||
|
@ -116,8 +116,8 @@ void InitialiseDoor(int16_t item_num)
|
||||||
dy++;
|
dy++;
|
||||||
}
|
}
|
||||||
|
|
||||||
ROOM_INFO* r;
|
ROOM_INFO *r;
|
||||||
ROOM_INFO* b;
|
ROOM_INFO *b;
|
||||||
int32_t x_floor;
|
int32_t x_floor;
|
||||||
int32_t y_floor;
|
int32_t y_floor;
|
||||||
int16_t room_num;
|
int16_t room_num;
|
||||||
|
@ -223,8 +223,8 @@ void InitialiseDoor(int16_t item_num)
|
||||||
|
|
||||||
void DoorControl(int16_t item_num)
|
void DoorControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
DOOR_DATA* door = item->data;
|
DOOR_DATA *door = item->data;
|
||||||
|
|
||||||
if (TriggerActive(item)) {
|
if (TriggerActive(item)) {
|
||||||
if (item->current_anim_state == DOOR_CLOSED) {
|
if (item->current_anim_state == DOOR_CLOSED) {
|
||||||
|
@ -249,7 +249,7 @@ void DoorControl(int16_t item_num)
|
||||||
AnimateItem(item);
|
AnimateItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t OnDrawBridge(ITEM_INFO* item, int32_t x, int32_t y)
|
int32_t OnDrawBridge(ITEM_INFO *item, int32_t x, int32_t y)
|
||||||
{
|
{
|
||||||
int32_t ix = item->pos.z >> WALL_SHIFT;
|
int32_t ix = item->pos.z >> WALL_SHIFT;
|
||||||
int32_t iy = item->pos.x >> WALL_SHIFT;
|
int32_t iy = item->pos.x >> WALL_SHIFT;
|
||||||
|
@ -275,7 +275,7 @@ int32_t OnDrawBridge(ITEM_INFO* item, int32_t x, int32_t y)
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawBridgeFloor(
|
void DrawBridgeFloor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
if (item->current_anim_state != DOOR_OPEN) {
|
if (item->current_anim_state != DOOR_OPEN) {
|
||||||
return;
|
return;
|
||||||
|
@ -290,7 +290,7 @@ void DrawBridgeFloor(
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawBridgeCeiling(
|
void DrawBridgeCeiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
if (item->current_anim_state != DOOR_OPEN) {
|
if (item->current_anim_state != DOOR_OPEN) {
|
||||||
return;
|
return;
|
||||||
|
@ -305,16 +305,16 @@ void DrawBridgeCeiling(
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawBridgeCollision(
|
void DrawBridgeCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (item->current_anim_state == DOOR_CLOSED) {
|
if (item->current_anim_state == DOOR_CLOSED) {
|
||||||
DoorCollision(item_num, lara_item, coll);
|
DoorCollision(item_num, lara_item, coll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BridgeFlatFloor(
|
void BridgeFlatFloor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
if (y <= item->pos.y) {
|
if (y <= item->pos.y) {
|
||||||
*height = item->pos.y;
|
*height = item->pos.y;
|
||||||
|
@ -322,14 +322,14 @@ void BridgeFlatFloor(
|
||||||
}
|
}
|
||||||
|
|
||||||
void BridgeFlatCeiling(
|
void BridgeFlatCeiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
if (y > item->pos.y) {
|
if (y > item->pos.y) {
|
||||||
*height = item->pos.y + STEP_L;
|
*height = item->pos.y + STEP_L;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t GetOffset(ITEM_INFO* item, int32_t x, int32_t z)
|
int32_t GetOffset(ITEM_INFO *item, int32_t x, int32_t z)
|
||||||
{
|
{
|
||||||
if (item->pos.y_rot == 0) {
|
if (item->pos.y_rot == 0) {
|
||||||
return (WALL_L - x) & (WALL_L - 1);
|
return (WALL_L - x) & (WALL_L - 1);
|
||||||
|
@ -343,7 +343,7 @@ int32_t GetOffset(ITEM_INFO* item, int32_t x, int32_t z)
|
||||||
}
|
}
|
||||||
|
|
||||||
void BridgeTilt1Floor(
|
void BridgeTilt1Floor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
int32_t level = item->pos.y + (GetOffset(item, x, z) >> 2);
|
int32_t level = item->pos.y + (GetOffset(item, x, z) >> 2);
|
||||||
if (y <= level) {
|
if (y <= level) {
|
||||||
|
@ -352,7 +352,7 @@ void BridgeTilt1Floor(
|
||||||
}
|
}
|
||||||
|
|
||||||
void BridgeTilt1Ceiling(
|
void BridgeTilt1Ceiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
int32_t level = item->pos.y + (GetOffset(item, x, z) >> 2);
|
int32_t level = item->pos.y + (GetOffset(item, x, z) >> 2);
|
||||||
if (y > level) {
|
if (y > level) {
|
||||||
|
@ -361,7 +361,7 @@ void BridgeTilt1Ceiling(
|
||||||
}
|
}
|
||||||
|
|
||||||
void BridgeTilt2Floor(
|
void BridgeTilt2Floor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
int32_t level = item->pos.y + (GetOffset(item, x, z) >> 1);
|
int32_t level = item->pos.y + (GetOffset(item, x, z) >> 1);
|
||||||
if (y <= level) {
|
if (y <= level) {
|
||||||
|
@ -370,7 +370,7 @@ void BridgeTilt2Floor(
|
||||||
}
|
}
|
||||||
|
|
||||||
void BridgeTilt2Ceiling(
|
void BridgeTilt2Ceiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
int32_t level = item->pos.y + (GetOffset(item, x, z) >> 1);
|
int32_t level = item->pos.y + (GetOffset(item, x, z) >> 1);
|
||||||
if (y > level) {
|
if (y > level) {
|
||||||
|
@ -380,7 +380,7 @@ void BridgeTilt2Ceiling(
|
||||||
|
|
||||||
void CogControl(int16_t item_num)
|
void CogControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (TriggerActive(item)) {
|
if (TriggerActive(item)) {
|
||||||
item->goal_anim_state = DOOR_OPEN;
|
item->goal_anim_state = DOOR_OPEN;
|
||||||
} else {
|
} else {
|
||||||
|
@ -398,7 +398,7 @@ void CogControl(int16_t item_num)
|
||||||
|
|
||||||
void CabinControl(int16_t item_num)
|
void CabinControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if ((item->flags & IF_CODE_BITS) == IF_CODE_BITS) {
|
if ((item->flags & IF_CODE_BITS) == IF_CODE_BITS) {
|
||||||
switch (item->current_anim_state) {
|
switch (item->current_anim_state) {
|
||||||
|
@ -426,7 +426,7 @@ void CabinControl(int16_t item_num)
|
||||||
|
|
||||||
void BoatControl(int16_t item_num)
|
void BoatControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
switch (item->current_anim_state) {
|
switch (item->current_anim_state) {
|
||||||
case BOAT_SET:
|
case BOAT_SET:
|
||||||
|
@ -451,7 +451,7 @@ void ScionControl(int16_t item_num)
|
||||||
void Scion3Control(int16_t item_num)
|
void Scion3Control(int16_t item_num)
|
||||||
{
|
{
|
||||||
static int32_t counter = 0;
|
static int32_t counter = 0;
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->hit_points > 0) {
|
if (item->hit_points > 0) {
|
||||||
counter = 0;
|
counter = 0;
|
||||||
|
@ -463,7 +463,7 @@ void Scion3Control(int16_t item_num)
|
||||||
item->status = IS_INVISIBLE;
|
item->status = IS_INVISIBLE;
|
||||||
item->hit_points = DONT_TARGET;
|
item->hit_points = DONT_TARGET;
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
||||||
TestTriggers(TriggerIndex, 1);
|
TestTriggers(TriggerIndex, 1);
|
||||||
|
@ -473,7 +473,7 @@ void Scion3Control(int16_t item_num)
|
||||||
if (counter % 10 == 0) {
|
if (counter % 10 == 0) {
|
||||||
int16_t fx_num = CreateEffect(item->room_number);
|
int16_t fx_num = CreateEffect(item->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.x = item->pos.x + (GetRandomControl() - 0x4000) / 32;
|
fx->pos.x = item->pos.x + (GetRandomControl() - 0x4000) / 32;
|
||||||
fx->pos.y = item->pos.y + (GetRandomControl() - 0x4000) / 256 - 500;
|
fx->pos.y = item->pos.y + (GetRandomControl() - 0x4000) / 256 - 500;
|
||||||
fx->pos.z = item->pos.z + (GetRandomControl() - 0x4000) / 32;
|
fx->pos.z = item->pos.z + (GetRandomControl() - 0x4000) / 32;
|
||||||
|
@ -495,7 +495,7 @@ void Scion3Control(int16_t item_num)
|
||||||
// original name: EarthQuake
|
// original name: EarthQuake
|
||||||
void EarthQuakeControl(int16_t item_num)
|
void EarthQuakeControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (TriggerActive(item)) {
|
if (TriggerActive(item)) {
|
||||||
if (GetRandomDraw() < 0x100) {
|
if (GetRandomDraw() < 0x100) {
|
||||||
Camera.bounce = -150;
|
Camera.bounce = -150;
|
||||||
|
|
|
@ -4,35 +4,35 @@
|
||||||
#include "game/types.h"
|
#include "game/types.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void ShutThatDoor(DOORPOS_DATA* d);
|
void ShutThatDoor(DOORPOS_DATA *d);
|
||||||
void OpenThatDoor(DOORPOS_DATA* d);
|
void OpenThatDoor(DOORPOS_DATA *d);
|
||||||
void InitialiseDoor(int16_t item_num);
|
void InitialiseDoor(int16_t item_num);
|
||||||
void DoorControl(int16_t item_num);
|
void DoorControl(int16_t item_num);
|
||||||
|
|
||||||
#ifdef T1M_FEAT_CHEATS
|
#ifdef T1M_FEAT_CHEATS
|
||||||
void OpenClosestDoors(ITEM_INFO* lara_item);
|
void OpenClosestDoors(ITEM_INFO *lara_item);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int32_t OnDrawBridge(ITEM_INFO* item, int32_t x, int32_t y);
|
int32_t OnDrawBridge(ITEM_INFO *item, int32_t x, int32_t y);
|
||||||
void DrawBridgeFloor(
|
void DrawBridgeFloor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
void DrawBridgeCeiling(
|
void DrawBridgeCeiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
void DrawBridgeCollision(
|
void DrawBridgeCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void BridgeFlatFloor(
|
void BridgeFlatFloor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
void BridgeFlatCeiling(
|
void BridgeFlatCeiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
int32_t GetOffset(ITEM_INFO* item, int32_t x, int32_t z);
|
int32_t GetOffset(ITEM_INFO *item, int32_t x, int32_t z);
|
||||||
void BridgeTilt1Floor(
|
void BridgeTilt1Floor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
void BridgeTilt1Ceiling(
|
void BridgeTilt1Ceiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
void BridgeTilt2Floor(
|
void BridgeTilt2Floor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
void BridgeTilt2Ceiling(
|
void BridgeTilt2Ceiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
|
|
||||||
void CogControl(int16_t item_num);
|
void CogControl(int16_t item_num);
|
||||||
void CabinControl(int16_t item_num);
|
void CabinControl(int16_t item_num);
|
||||||
|
|
|
@ -13,11 +13,11 @@
|
||||||
#define PASSPORT_2FRONT IN_LEFT
|
#define PASSPORT_2FRONT IN_LEFT
|
||||||
#define PASSPORT_2BACK IN_RIGHT
|
#define PASSPORT_2BACK IN_RIGHT
|
||||||
|
|
||||||
static TEXTSTRING* PassportText1;
|
static TEXTSTRING *PassportText1;
|
||||||
static int32_t PassportMode;
|
static int32_t PassportMode;
|
||||||
|
|
||||||
// original name: do_inventory_options
|
// original name: do_inventory_options
|
||||||
void DoInventoryOptions(INVENTORY_ITEM* inv_item)
|
void DoInventoryOptions(INVENTORY_ITEM *inv_item)
|
||||||
{
|
{
|
||||||
switch (inv_item->object_number) {
|
switch (inv_item->object_number) {
|
||||||
case O_PASSPORT_OPTION:
|
case O_PASSPORT_OPTION:
|
||||||
|
@ -80,7 +80,7 @@ void DoInventoryOptions(INVENTORY_ITEM* inv_item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoPassportOption(INVENTORY_ITEM* inv_item)
|
void DoPassportOption(INVENTORY_ITEM *inv_item)
|
||||||
{
|
{
|
||||||
T_RemovePrint(InvItemText[0]);
|
T_RemovePrint(InvItemText[0]);
|
||||||
InvItemText[IT_NAME] = NULL;
|
InvItemText[IT_NAME] = NULL;
|
||||||
|
@ -283,7 +283,7 @@ void DoPassportOption(INVENTORY_ITEM* inv_item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: do_gamma_option
|
// original name: do_gamma_option
|
||||||
void DoGammaOption(INVENTORY_ITEM* inv_item)
|
void DoGammaOption(INVENTORY_ITEM *inv_item)
|
||||||
{
|
{
|
||||||
if (CHK_ANY(Input, IN_LEFT)) {
|
if (CHK_ANY(Input, IN_LEFT)) {
|
||||||
IDelay = 1;
|
IDelay = 1;
|
||||||
|
@ -322,7 +322,7 @@ void DoGammaOption(INVENTORY_ITEM* inv_item)
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: do_compass_option
|
// original name: do_compass_option
|
||||||
void DoCompassOption(INVENTORY_ITEM* inv_item)
|
void DoCompassOption(INVENTORY_ITEM *inv_item)
|
||||||
{
|
{
|
||||||
if (CHK_ANY(InputDB, IN_DESELECT | IN_SELECT)) {
|
if (CHK_ANY(InputDB, IN_DESELECT | IN_SELECT)) {
|
||||||
inv_item->goal_frame = inv_item->frames_total - 1;
|
inv_item->goal_frame = inv_item->frames_total - 1;
|
||||||
|
@ -389,7 +389,7 @@ void S_ShowControls()
|
||||||
T_AddBackground(ControlText[1], hpos, vpos, 0, 0, 48, 0, 0, 0);
|
T_AddBackground(ControlText[1], hpos, vpos, 0, 0, 48, 0, 0, 0);
|
||||||
|
|
||||||
if (!CtrlTextB[0]) {
|
if (!CtrlTextB[0]) {
|
||||||
int16_t* layout = Layout[IConfig];
|
int16_t *layout = Layout[IConfig];
|
||||||
|
|
||||||
switch (HiRes) {
|
switch (HiRes) {
|
||||||
#ifndef T1M_FEAT_UI
|
#ifndef T1M_FEAT_UI
|
||||||
|
@ -473,7 +473,7 @@ void S_ShowControls()
|
||||||
}
|
}
|
||||||
|
|
||||||
// original name: Init_Requester
|
// original name: Init_Requester
|
||||||
void InitRequester(REQUEST_INFO* req)
|
void InitRequester(REQUEST_INFO *req)
|
||||||
{
|
{
|
||||||
req->heading = NULL;
|
req->heading = NULL;
|
||||||
req->background = NULL;
|
req->background = NULL;
|
||||||
|
|
|
@ -10,12 +10,12 @@
|
||||||
#define DisplayRequester ((int32_t (*)(REQUEST_INFO* req))0x0042F6F0)
|
#define DisplayRequester ((int32_t (*)(REQUEST_INFO* req))0x0042F6F0)
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
void DoInventoryOptions(INVENTORY_ITEM* inv_item);
|
void DoInventoryOptions(INVENTORY_ITEM *inv_item);
|
||||||
void DoPassportOption(INVENTORY_ITEM* inv_item);
|
void DoPassportOption(INVENTORY_ITEM *inv_item);
|
||||||
void DoGammaOption(INVENTORY_ITEM* inv_item);
|
void DoGammaOption(INVENTORY_ITEM *inv_item);
|
||||||
void DoCompassOption(INVENTORY_ITEM* inv_item);
|
void DoCompassOption(INVENTORY_ITEM *inv_item);
|
||||||
void S_ShowControls();
|
void S_ShowControls();
|
||||||
void InitRequester(REQUEST_INFO* req);
|
void InitRequester(REQUEST_INFO *req);
|
||||||
|
|
||||||
void T1MInjectGameOption();
|
void T1MInjectGameOption();
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ static BITE_INFO CowboyGun1 = { 1, 200, 41, 5 };
|
||||||
static BITE_INFO CowboyGun2 = { -2, 200, 40, 8 };
|
static BITE_INFO CowboyGun2 = { -2, 200, 40, 8 };
|
||||||
static BITE_INFO BaldyGun = { -20, 440, 20, 9 };
|
static BITE_INFO BaldyGun = { -20, 440, 20, 9 };
|
||||||
|
|
||||||
int32_t Targetable(ITEM_INFO* item, AI_INFO* info)
|
int32_t Targetable(ITEM_INFO *item, AI_INFO *info)
|
||||||
{
|
{
|
||||||
if (!info->ahead || info->distance >= PEOPLE_SHOOT_RANGE) {
|
if (!info->ahead || info->distance >= PEOPLE_SHOOT_RANGE) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -152,7 +152,7 @@ int32_t Targetable(ITEM_INFO* item, AI_INFO* info)
|
||||||
|
|
||||||
void ControlGunShot(int16_t fx_num)
|
void ControlGunShot(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->counter--;
|
fx->counter--;
|
||||||
if (!fx->counter) {
|
if (!fx->counter) {
|
||||||
KillEffect(fx_num);
|
KillEffect(fx_num);
|
||||||
|
@ -167,7 +167,7 @@ int16_t GunShot(
|
||||||
{
|
{
|
||||||
int16_t fx_num = CreateEffect(room_num);
|
int16_t fx_num = CreateEffect(room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &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;
|
||||||
|
@ -215,7 +215,7 @@ int16_t GunMiss(
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ShotLara(
|
int32_t ShotLara(
|
||||||
ITEM_INFO* item, int32_t distance, BITE_INFO* gun, int16_t extra_rotation)
|
ITEM_INFO *item, int32_t distance, BITE_INFO *gun, int16_t extra_rotation)
|
||||||
{
|
{
|
||||||
int32_t hit;
|
int32_t hit;
|
||||||
if (distance > PEOPLE_SHOOT_RANGE) {
|
if (distance > PEOPLE_SHOOT_RANGE) {
|
||||||
|
@ -242,7 +242,7 @@ int32_t ShotLara(
|
||||||
|
|
||||||
void PeopleControl(int16_t item_num)
|
void PeopleControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -251,7 +251,7 @@ void PeopleControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* person = item->data;
|
CREATURE_INFO *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;
|
||||||
|
@ -365,7 +365,7 @@ void PeopleControl(int16_t item_num)
|
||||||
|
|
||||||
void PierreControl(int16_t item_num)
|
void PierreControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (PierreItem == NO_ITEM) {
|
if (PierreItem == NO_ITEM) {
|
||||||
PierreItem = item_num;
|
PierreItem = item_num;
|
||||||
|
@ -384,7 +384,7 @@ void PierreControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* pierre = item->data;
|
CREATURE_INFO *pierre = 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;
|
||||||
|
@ -546,8 +546,8 @@ void PierreControl(int16_t item_num)
|
||||||
|
|
||||||
void ApeVault(int16_t item_num, int16_t angle)
|
void ApeVault(int16_t item_num, int16_t angle)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
CREATURE_INFO* ape = item->data;
|
CREATURE_INFO *ape = item->data;
|
||||||
|
|
||||||
if (ape->flags & APE_TURN_L_FLAG) {
|
if (ape->flags & APE_TURN_L_FLAG) {
|
||||||
item->pos.y_rot -= PHD_90;
|
item->pos.y_rot -= PHD_90;
|
||||||
|
@ -599,7 +599,7 @@ void ApeVault(int16_t item_num, int16_t angle)
|
||||||
|
|
||||||
void ApeControl(int16_t item_num)
|
void ApeControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -608,7 +608,7 @@ void ApeControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* ape = item->data;
|
CREATURE_INFO *ape = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
|
|
||||||
|
@ -738,8 +738,8 @@ void InitialiseSkateKid(int16_t item_num)
|
||||||
|
|
||||||
void SkateKidControl(int16_t item_num)
|
void SkateKidControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
CREATURE_INFO* kid = item->data;
|
CREATURE_INFO *kid = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
|
|
||||||
|
@ -831,7 +831,7 @@ void SkateKidControl(int16_t item_num)
|
||||||
CreatureAnimation(item_num, angle, 0);
|
CreatureAnimation(item_num, angle, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawSkateKid(ITEM_INFO* item)
|
void DrawSkateKid(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
DrawAnimatingItem(item);
|
DrawAnimatingItem(item);
|
||||||
int16_t anim = item->anim_number;
|
int16_t anim = item->anim_number;
|
||||||
|
@ -847,7 +847,7 @@ void DrawSkateKid(ITEM_INFO* item)
|
||||||
|
|
||||||
void CowboyControl(int16_t item_num)
|
void CowboyControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -856,7 +856,7 @@ void CowboyControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* cowboy = item->data;
|
CREATURE_INFO *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;
|
||||||
|
@ -974,7 +974,7 @@ void InitialiseBaldy(int16_t item_num)
|
||||||
|
|
||||||
void BaldyControl(int16_t item_num)
|
void BaldyControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -983,7 +983,7 @@ void BaldyControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* baldy = item->data;
|
CREATURE_INFO *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;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "game/types.h"
|
#include "game/types.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
int32_t Targetable(ITEM_INFO* item, AI_INFO* info);
|
int32_t Targetable(ITEM_INFO *item, AI_INFO *info);
|
||||||
void ControlGunShot(int16_t fx_num);
|
void ControlGunShot(int16_t fx_num);
|
||||||
int16_t GunShot(
|
int16_t GunShot(
|
||||||
int32_t x, int32_t y, int32_t z, int16_t speed, PHD_ANGLE y_rot,
|
int32_t x, int32_t y, int32_t z, int16_t speed, PHD_ANGLE y_rot,
|
||||||
|
@ -17,7 +17,7 @@ int16_t GunMiss(
|
||||||
int16_t room_num);
|
int16_t room_num);
|
||||||
|
|
||||||
int32_t ShotLara(
|
int32_t ShotLara(
|
||||||
ITEM_INFO* item, int32_t distance, BITE_INFO* gun, int16_t extra_rotation);
|
ITEM_INFO *item, int32_t distance, BITE_INFO *gun, int16_t extra_rotation);
|
||||||
void PeopleControl(int16_t item_num);
|
void PeopleControl(int16_t item_num);
|
||||||
void PierreControl(int16_t item_num);
|
void PierreControl(int16_t item_num);
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ void ApeControl(int16_t item_num);
|
||||||
|
|
||||||
void InitialiseSkateKid(int16_t item_num);
|
void InitialiseSkateKid(int16_t item_num);
|
||||||
void SkateKidControl(int16_t item_num);
|
void SkateKidControl(int16_t item_num);
|
||||||
void DrawSkateKid(ITEM_INFO* item);
|
void DrawSkateKid(ITEM_INFO *item);
|
||||||
|
|
||||||
void CowboyControl(int16_t item_num);
|
void CowboyControl(int16_t item_num);
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ static int32_t PickUpX;
|
||||||
static int32_t PickUpY;
|
static int32_t PickUpY;
|
||||||
static int32_t PickUpZ;
|
static int32_t PickUpZ;
|
||||||
|
|
||||||
void AnimateLaraUntil(ITEM_INFO* lara_item, int32_t goal)
|
void AnimateLaraUntil(ITEM_INFO *lara_item, int32_t goal)
|
||||||
{
|
{
|
||||||
lara_item->goal_anim_state = goal;
|
lara_item->goal_anim_state = goal;
|
||||||
do {
|
do {
|
||||||
|
@ -153,9 +153,9 @@ void AnimateLaraUntil(ITEM_INFO* lara_item, int32_t goal)
|
||||||
} while (lara_item->current_anim_state != goal);
|
} while (lara_item->current_anim_state != goal);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PickUpCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void PickUpCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
item->pos.y_rot = lara_item->pos.y_rot;
|
item->pos.y_rot = lara_item->pos.y_rot;
|
||||||
item->pos.z_rot = 0;
|
item->pos.z_rot = 0;
|
||||||
|
|
||||||
|
@ -220,9 +220,9 @@ void PickUpCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
|
|
||||||
void PickUpScionCollision(
|
void PickUpScionCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
item->pos.y_rot = lara_item->pos.y_rot;
|
item->pos.y_rot = lara_item->pos.y_rot;
|
||||||
item->pos.x_rot = 0;
|
item->pos.x_rot = 0;
|
||||||
item->pos.z_rot = 0;
|
item->pos.z_rot = 0;
|
||||||
|
@ -257,9 +257,9 @@ void PickUpScionCollision(
|
||||||
}
|
}
|
||||||
|
|
||||||
void PickUpScion4Collision(
|
void PickUpScion4Collision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
item->pos.y_rot = lara_item->pos.y_rot;
|
item->pos.y_rot = lara_item->pos.y_rot;
|
||||||
item->pos.x_rot = 0;
|
item->pos.x_rot = 0;
|
||||||
item->pos.z_rot = 0;
|
item->pos.z_rot = 0;
|
||||||
|
@ -284,9 +284,9 @@ void PickUpScion4Collision(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MidasCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void MidasCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (!lara_item->gravity_status && lara_item->current_anim_state == AS_STOP
|
if (!lara_item->gravity_status && lara_item->current_anim_state == AS_STOP
|
||||||
&& lara_item->pos.x > item->pos.x - 512
|
&& lara_item->pos.x > item->pos.x - 512
|
||||||
|
@ -349,9 +349,9 @@ void MidasCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwitchCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void SwitchCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (!CHK_ANY(Input, IN_ACTION) || item->status != IS_NOT_ACTIVE
|
if (!CHK_ANY(Input, IN_ACTION) || item->status != IS_NOT_ACTIVE
|
||||||
|| Lara.gun_status != LGS_ARMLESS || lara_item->gravity_status) {
|
|| Lara.gun_status != LGS_ARMLESS || lara_item->gravity_status) {
|
||||||
|
@ -386,9 +386,9 @@ void SwitchCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwitchCollision2(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void SwitchCollision2(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (!CHK_ANY(Input, IN_ACTION) || item->status != IS_NOT_ACTIVE
|
if (!CHK_ANY(Input, IN_ACTION) || item->status != IS_NOT_ACTIVE
|
||||||
|| Lara.water_status != LWS_UNDERWATER) {
|
|| Lara.water_status != LWS_UNDERWATER) {
|
||||||
|
@ -423,9 +423,9 @@ void SwitchCollision2(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyHoleCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void KeyHoleCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (lara_item->current_anim_state != AS_STOP) {
|
if (lara_item->current_anim_state != AS_STOP) {
|
||||||
return;
|
return;
|
||||||
|
@ -517,9 +517,9 @@ void KeyHoleCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
}
|
}
|
||||||
|
|
||||||
void PuzzleHoleCollision(
|
void PuzzleHoleCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (lara_item->current_anim_state == AS_USEPUZZLE) {
|
if (lara_item->current_anim_state == AS_USEPUZZLE) {
|
||||||
if (!TestLaraPosition(PuzzleHoleBounds, item, lara_item)) {
|
if (!TestLaraPosition(PuzzleHoleBounds, item, lara_item)) {
|
||||||
|
@ -638,7 +638,7 @@ void PuzzleHoleCollision(
|
||||||
|
|
||||||
void SwitchControl(int16_t item_num)
|
void SwitchControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
item->flags |= IF_CODE_BITS;
|
item->flags |= IF_CODE_BITS;
|
||||||
if (!TriggerActive(item)) {
|
if (!TriggerActive(item)) {
|
||||||
item->goal_anim_state = SS_ON;
|
item->goal_anim_state = SS_ON;
|
||||||
|
@ -649,7 +649,7 @@ void SwitchControl(int16_t item_num)
|
||||||
|
|
||||||
int32_t SwitchTrigger(int16_t item_num, int16_t timer)
|
int32_t SwitchTrigger(int16_t item_num, int16_t timer)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (item->status != IS_DEACTIVATED) {
|
if (item->status != IS_DEACTIVATED) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -668,7 +668,7 @@ int32_t SwitchTrigger(int16_t item_num, int16_t timer)
|
||||||
|
|
||||||
int32_t KeyTrigger(int16_t item_num)
|
int32_t KeyTrigger(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
#ifdef T1M_FEAT_OG_FIXES
|
#ifdef T1M_FEAT_OG_FIXES
|
||||||
if (item->status == IS_ACTIVE
|
if (item->status == IS_ACTIVE
|
||||||
&& (T1MConfig.fix_key_triggers ? Lara.gun_status != LGS_HANDSBUSY
|
&& (T1MConfig.fix_key_triggers ? Lara.gun_status != LGS_HANDSBUSY
|
||||||
|
@ -687,7 +687,7 @@ int32_t KeyTrigger(int16_t item_num)
|
||||||
|
|
||||||
int32_t PickupTrigger(int16_t item_num)
|
int32_t PickupTrigger(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (item->status != IS_INVISIBLE) {
|
if (item->status != IS_INVISIBLE) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -696,10 +696,10 @@ int32_t PickupTrigger(int16_t item_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
void PickUpSaveGameCollision(
|
void PickUpSaveGameCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
#ifdef T1M_FEAT_SAVE_CRYSTALS
|
#ifdef T1M_FEAT_SAVE_CRYSTALS
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
ObjectCollision(item_num, lara_item, coll);
|
ObjectCollision(item_num, lara_item, coll);
|
||||||
|
|
||||||
if (!CHK_ANY(Input, IN_ACTION) || Lara.gun_status != LGS_ARMLESS
|
if (!CHK_ANY(Input, IN_ACTION) || Lara.gun_status != LGS_ARMLESS
|
||||||
|
|
|
@ -3,24 +3,24 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void AnimateLaraUntil(ITEM_INFO* lara_item, int32_t goal);
|
void AnimateLaraUntil(ITEM_INFO *lara_item, int32_t goal);
|
||||||
void PickUpCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
void PickUpCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void PickUpScionCollision(
|
void PickUpScionCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void PickUpScion4Collision(
|
void PickUpScion4Collision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void MidasCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
void MidasCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void SwitchCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
void SwitchCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void SwitchCollision2(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
void SwitchCollision2(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void KeyHoleCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
void KeyHoleCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void PuzzleHoleCollision(
|
void PuzzleHoleCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void SwitchControl(int16_t item_num);
|
void SwitchControl(int16_t item_num);
|
||||||
int32_t SwitchTrigger(int16_t item_num, int16_t timer);
|
int32_t SwitchTrigger(int16_t item_num, int16_t timer);
|
||||||
int32_t KeyTrigger(int16_t item_num);
|
int32_t KeyTrigger(int16_t item_num);
|
||||||
int32_t PickupTrigger(int16_t item_num);
|
int32_t PickupTrigger(int16_t item_num);
|
||||||
void PickUpSaveGameCollision(
|
void PickUpSaveGameCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void InitialiseSaveGameItem(int16_t item_num);
|
void InitialiseSaveGameItem(int16_t item_num);
|
||||||
void ControlSaveGameItem(int16_t item_num);
|
void ControlSaveGameItem(int16_t item_num);
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ static BITE_INFO RatBite = { 0, -11, 108, 3 };
|
||||||
|
|
||||||
void RatControl(int16_t item_num)
|
void RatControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -52,7 +52,7 @@ void RatControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* rat = item->data;
|
CREATURE_INFO *rat = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
|
|
||||||
|
@ -143,7 +143,7 @@ void RatControl(int16_t item_num)
|
||||||
|
|
||||||
void VoleControl(int16_t item_num)
|
void VoleControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
|
|
@ -1004,7 +1004,7 @@ void ObjectObjects()
|
||||||
void InitialiseObjects()
|
void InitialiseObjects()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < NUMBER_OBJECTS; i++) {
|
for (int i = 0; i < NUMBER_OBJECTS; i++) {
|
||||||
OBJECT_INFO* obj = &Objects[i];
|
OBJECT_INFO *obj = &Objects[i];
|
||||||
obj->intelligent = 0;
|
obj->intelligent = 0;
|
||||||
obj->save_position = 0;
|
obj->save_position = 0;
|
||||||
obj->save_hitpoints = 0;
|
obj->save_hitpoints = 0;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "game/vars.h"
|
#include "game/vars.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
int32_t TestCollision(ITEM_INFO* item, ITEM_INFO* lara_item)
|
int32_t TestCollision(ITEM_INFO *item, ITEM_INFO *lara_item)
|
||||||
{
|
{
|
||||||
SPHERE slist_baddie[34];
|
SPHERE slist_baddie[34];
|
||||||
SPHERE slist_lara[34];
|
SPHERE slist_lara[34];
|
||||||
|
@ -15,12 +15,12 @@ int32_t TestCollision(ITEM_INFO* item, ITEM_INFO* lara_item)
|
||||||
int32_t num2 = GetSpheres(lara_item, slist_lara, 1);
|
int32_t num2 = GetSpheres(lara_item, slist_lara, 1);
|
||||||
|
|
||||||
for (int i = 0; i < num1; i++) {
|
for (int i = 0; i < num1; i++) {
|
||||||
SPHERE* ptr1 = &slist_baddie[i];
|
SPHERE *ptr1 = &slist_baddie[i];
|
||||||
if (ptr1->r <= 0) {
|
if (ptr1->r <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (int j = 0; j < num2; j++) {
|
for (int j = 0; j < num2; j++) {
|
||||||
SPHERE* ptr2 = &slist_lara[j];
|
SPHERE *ptr2 = &slist_lara[j];
|
||||||
if (ptr2->r <= 0) {
|
if (ptr2->r <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ int32_t TestCollision(ITEM_INFO* item, ITEM_INFO* lara_item)
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t GetSpheres(ITEM_INFO* item, SPHERE* ptr, int32_t world_space)
|
int32_t GetSpheres(ITEM_INFO *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 };
|
||||||
|
|
||||||
|
@ -70,18 +70,18 @@ int32_t GetSpheres(ITEM_INFO* item, SPHERE* ptr, int32_t world_space)
|
||||||
|
|
||||||
phd_RotYXZ(item->pos.y_rot, item->pos.x_rot, item->pos.z_rot);
|
phd_RotYXZ(item->pos.y_rot, item->pos.x_rot, item->pos.z_rot);
|
||||||
|
|
||||||
int16_t* frame = GetBestFrame(item);
|
int16_t *frame = GetBestFrame(item);
|
||||||
phd_TranslateRel(
|
phd_TranslateRel(
|
||||||
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
||||||
|
|
||||||
int32_t* packed_rotation = (int32_t*)(frame + FRAME_ROT);
|
int32_t *packed_rotation = (int32_t *)(frame + FRAME_ROT);
|
||||||
phd_RotYXZpack(*packed_rotation++);
|
phd_RotYXZpack(*packed_rotation++);
|
||||||
|
|
||||||
OBJECT_INFO* object = &Objects[item->object_number];
|
OBJECT_INFO *object = &Objects[item->object_number];
|
||||||
int16_t** meshpp = &Meshes[object->mesh_index];
|
int16_t **meshpp = &Meshes[object->mesh_index];
|
||||||
int32_t* bone = &AnimBones[object->bone_index];
|
int32_t *bone = &AnimBones[object->bone_index];
|
||||||
|
|
||||||
int16_t* objptr = *meshpp++;
|
int16_t *objptr = *meshpp++;
|
||||||
phd_PushMatrix();
|
phd_PushMatrix();
|
||||||
phd_TranslateRel(objptr[0], objptr[1], objptr[2]);
|
phd_TranslateRel(objptr[0], objptr[1], objptr[2]);
|
||||||
ptr->x = x + (PhdMatrixPtr->_03 >> W2V_SHIFT);
|
ptr->x = x + (PhdMatrixPtr->_03 >> W2V_SHIFT);
|
||||||
|
@ -91,7 +91,7 @@ int32_t GetSpheres(ITEM_INFO* item, SPHERE* ptr, int32_t world_space)
|
||||||
ptr++;
|
ptr++;
|
||||||
phd_PopMatrix();
|
phd_PopMatrix();
|
||||||
|
|
||||||
int16_t* extra_rotation = item->data ? item->data : &null_rotation;
|
int16_t *extra_rotation = item->data ? item->data : &null_rotation;
|
||||||
for (int i = 1; i < object->nmeshes; i++) {
|
for (int i = 1; i < object->nmeshes; i++) {
|
||||||
int32_t bone_extra_flags = bone[0];
|
int32_t bone_extra_flags = bone[0];
|
||||||
if (bone_extra_flags & BEB_POP) {
|
if (bone_extra_flags & BEB_POP) {
|
||||||
|
@ -131,9 +131,9 @@ int32_t GetSpheres(ITEM_INFO* item, SPHERE* ptr, int32_t world_space)
|
||||||
return object->nmeshes;
|
return object->nmeshes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetJointAbsPosition(ITEM_INFO* item, PHD_VECTOR* vec, int32_t joint)
|
void GetJointAbsPosition(ITEM_INFO *item, PHD_VECTOR *vec, int32_t joint)
|
||||||
{
|
{
|
||||||
OBJECT_INFO* object = &Objects[item->object_number];
|
OBJECT_INFO *object = &Objects[item->object_number];
|
||||||
|
|
||||||
phd_PushUnitMatrix();
|
phd_PushUnitMatrix();
|
||||||
PhdMatrixPtr->_03 = 0;
|
PhdMatrixPtr->_03 = 0;
|
||||||
|
@ -142,16 +142,16 @@ void GetJointAbsPosition(ITEM_INFO* item, PHD_VECTOR* vec, int32_t joint)
|
||||||
|
|
||||||
phd_RotYXZ(item->pos.y_rot, item->pos.x_rot, item->pos.z_rot);
|
phd_RotYXZ(item->pos.y_rot, item->pos.x_rot, item->pos.z_rot);
|
||||||
|
|
||||||
int16_t* frame = GetBestFrame(item);
|
int16_t *frame = GetBestFrame(item);
|
||||||
phd_TranslateRel(
|
phd_TranslateRel(
|
||||||
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
||||||
|
|
||||||
int32_t* packed_rotation = (int32_t*)(frame + FRAME_ROT);
|
int32_t *packed_rotation = (int32_t *)(frame + FRAME_ROT);
|
||||||
phd_RotYXZpack(*packed_rotation++);
|
phd_RotYXZpack(*packed_rotation++);
|
||||||
|
|
||||||
int32_t* bone = &AnimBones[object->bone_index];
|
int32_t *bone = &AnimBones[object->bone_index];
|
||||||
|
|
||||||
int16_t* extra_rotation = (int16_t*)item->data;
|
int16_t *extra_rotation = (int16_t *)item->data;
|
||||||
for (int i = 0; i < joint; i++) {
|
for (int i = 0; i < joint; i++) {
|
||||||
int32_t bone_extra_flags = bone[0];
|
int32_t bone_extra_flags = bone[0];
|
||||||
if (bone_extra_flags & BEB_POP) {
|
if (bone_extra_flags & BEB_POP) {
|
||||||
|
@ -184,7 +184,7 @@ void GetJointAbsPosition(ITEM_INFO* item, PHD_VECTOR* vec, int32_t joint)
|
||||||
phd_PopMatrix();
|
phd_PopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaddieBiteEffect(ITEM_INFO* item, BITE_INFO* bite)
|
void BaddieBiteEffect(ITEM_INFO *item, BITE_INFO *bite)
|
||||||
{
|
{
|
||||||
PHD_VECTOR pos;
|
PHD_VECTOR pos;
|
||||||
pos.x = bite->x;
|
pos.x = bite->x;
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
#include "game/types.h"
|
#include "game/types.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
int32_t TestCollision(ITEM_INFO* item, ITEM_INFO* lara_item);
|
int32_t TestCollision(ITEM_INFO *item, ITEM_INFO *lara_item);
|
||||||
int32_t GetSpheres(ITEM_INFO* item, SPHERE* slist, int32_t world_space);
|
int32_t GetSpheres(ITEM_INFO *item, SPHERE *slist, int32_t world_space);
|
||||||
void GetJointAbsPosition(ITEM_INFO* item, PHD_VECTOR* vec, int32_t joint);
|
void GetJointAbsPosition(ITEM_INFO *item, PHD_VECTOR *vec, int32_t joint);
|
||||||
void BaddieBiteEffect(ITEM_INFO* item, BITE_INFO* bite);
|
void BaddieBiteEffect(ITEM_INFO *item, BITE_INFO *bite);
|
||||||
|
|
||||||
void T1MInjectGameSphere();
|
void T1MInjectGameSphere();
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ static int8_t TextRemapASCII[95] = {
|
||||||
100 /*{*/, 101 /*|*/, 102 /*}*/, 67 /*~*/
|
100 /*{*/, 101 /*|*/, 102 /*}*/, 67 /*~*/
|
||||||
};
|
};
|
||||||
|
|
||||||
int T_GetStringLen(const char* string)
|
int T_GetStringLen(const char *string)
|
||||||
{
|
{
|
||||||
int len = 1;
|
int len = 1;
|
||||||
while (*string++) {
|
while (*string++) {
|
||||||
|
@ -67,14 +67,14 @@ void T_InitPrint()
|
||||||
TextStringCount = 0;
|
TextStringCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEXTSTRING*
|
TEXTSTRING *
|
||||||
T_Print(int16_t xpos, int16_t ypos, int16_t zpos, const char* string)
|
T_Print(int16_t xpos, int16_t ypos, int16_t zpos, const char *string)
|
||||||
{
|
{
|
||||||
if (TextStringCount == MAX_TEXT_STRINGS) {
|
if (TextStringCount == MAX_TEXT_STRINGS) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEXTSTRING* result = &TextInfoTable[0];
|
TEXTSTRING *result = &TextInfoTable[0];
|
||||||
int n;
|
int n;
|
||||||
for (n = 0; n < MAX_TEXT_STRINGS; n++) {
|
for (n = 0; n < MAX_TEXT_STRINGS; n++) {
|
||||||
if (!(result->flags & TF_ACTIVE)) {
|
if (!(result->flags & TF_ACTIVE)) {
|
||||||
|
@ -122,7 +122,7 @@ T_Print(int16_t xpos, int16_t ypos, int16_t zpos, const char* string)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_ChangeText(TEXTSTRING* textstring, const char* string)
|
void T_ChangeText(TEXTSTRING *textstring, const char *string)
|
||||||
{
|
{
|
||||||
if (!(textstring->flags & TF_ACTIVE)) {
|
if (!(textstring->flags & TF_ACTIVE)) {
|
||||||
return;
|
return;
|
||||||
|
@ -133,13 +133,13 @@ void T_ChangeText(TEXTSTRING* textstring, const char* string)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_SetScale(TEXTSTRING* textstring, int32_t scale_h, int32_t scale_v)
|
void T_SetScale(TEXTSTRING *textstring, int32_t scale_h, int32_t scale_v)
|
||||||
{
|
{
|
||||||
textstring->scale_h = scale_h;
|
textstring->scale_h = scale_h;
|
||||||
textstring->scale_v = scale_v;
|
textstring->scale_v = scale_v;
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_FlashText(TEXTSTRING* textstring, int16_t b, int16_t rate)
|
void T_FlashText(TEXTSTRING *textstring, int16_t b, int16_t rate)
|
||||||
{
|
{
|
||||||
if (b) {
|
if (b) {
|
||||||
textstring->flags |= TF_FLASH;
|
textstring->flags |= TF_FLASH;
|
||||||
|
@ -151,8 +151,8 @@ void T_FlashText(TEXTSTRING* textstring, int16_t b, int16_t rate)
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_AddBackground(
|
void T_AddBackground(
|
||||||
TEXTSTRING* textstring, int16_t xsize, int16_t ysize, int16_t xoff,
|
TEXTSTRING *textstring, int16_t xsize, int16_t ysize, int16_t xoff,
|
||||||
int16_t yoff, int16_t zoff, int16_t colour, SG_COL* gourptr, int16_t flags)
|
int16_t yoff, int16_t zoff, int16_t colour, SG_COL *gourptr, int16_t flags)
|
||||||
{
|
{
|
||||||
textstring->flags |= TF_BGND;
|
textstring->flags |= TF_BGND;
|
||||||
textstring->bgnd_size_x = xsize;
|
textstring->bgnd_size_x = xsize;
|
||||||
|
@ -165,13 +165,13 @@ void T_AddBackground(
|
||||||
textstring->bgnd_flags = flags;
|
textstring->bgnd_flags = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_RemoveBackground(TEXTSTRING* textstring)
|
void T_RemoveBackground(TEXTSTRING *textstring)
|
||||||
{
|
{
|
||||||
textstring->flags &= ~TF_BGND;
|
textstring->flags &= ~TF_BGND;
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_AddOutline(
|
void T_AddOutline(
|
||||||
TEXTSTRING* textstring, int16_t b, int16_t colour, SG_COL* gourptr,
|
TEXTSTRING *textstring, int16_t b, int16_t colour, SG_COL *gourptr,
|
||||||
int16_t flags)
|
int16_t flags)
|
||||||
{
|
{
|
||||||
textstring->flags |= TF_OUTLINE;
|
textstring->flags |= TF_OUTLINE;
|
||||||
|
@ -180,12 +180,12 @@ void T_AddOutline(
|
||||||
textstring->outl_flags = flags;
|
textstring->outl_flags = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_RemoveOutline(TEXTSTRING* textstring)
|
void T_RemoveOutline(TEXTSTRING *textstring)
|
||||||
{
|
{
|
||||||
textstring->flags &= ~TF_OUTLINE;
|
textstring->flags &= ~TF_OUTLINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_CentreH(TEXTSTRING* textstring, int16_t b)
|
void T_CentreH(TEXTSTRING *textstring, int16_t b)
|
||||||
{
|
{
|
||||||
if (b) {
|
if (b) {
|
||||||
textstring->flags |= TF_CENTRE_H;
|
textstring->flags |= TF_CENTRE_H;
|
||||||
|
@ -194,7 +194,7 @@ void T_CentreH(TEXTSTRING* textstring, int16_t b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_CentreV(TEXTSTRING* textstring, int16_t b)
|
void T_CentreV(TEXTSTRING *textstring, int16_t b)
|
||||||
{
|
{
|
||||||
if (b) {
|
if (b) {
|
||||||
textstring->flags |= TF_CENTRE_V;
|
textstring->flags |= TF_CENTRE_V;
|
||||||
|
@ -203,7 +203,7 @@ void T_CentreV(TEXTSTRING* textstring, int16_t b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_RightAlign(TEXTSTRING* textstring, int16_t b)
|
void T_RightAlign(TEXTSTRING *textstring, int16_t b)
|
||||||
{
|
{
|
||||||
if (b) {
|
if (b) {
|
||||||
textstring->flags |= TF_RIGHT;
|
textstring->flags |= TF_RIGHT;
|
||||||
|
@ -212,7 +212,7 @@ void T_RightAlign(TEXTSTRING* textstring, int16_t b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_BottomAlign(TEXTSTRING* textstring, int16_t b)
|
void T_BottomAlign(TEXTSTRING *textstring, int16_t b)
|
||||||
{
|
{
|
||||||
if (b) {
|
if (b) {
|
||||||
textstring->flags |= TF_BOTTOM;
|
textstring->flags |= TF_BOTTOM;
|
||||||
|
@ -221,10 +221,10 @@ void T_BottomAlign(TEXTSTRING* textstring, int16_t b)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t T_GetTextWidth(TEXTSTRING* textstring)
|
int32_t T_GetTextWidth(TEXTSTRING *textstring)
|
||||||
{
|
{
|
||||||
int width = 0;
|
int width = 0;
|
||||||
char* ptr = textstring->string;
|
char *ptr = textstring->string;
|
||||||
for (char letter = *ptr; *ptr; letter = *ptr++) {
|
for (char letter = *ptr; *ptr; letter = *ptr++) {
|
||||||
if (letter == 0x7F || (letter > 10 && letter < 32)) {
|
if (letter == 0x7F || (letter > 10 && letter < 32)) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -252,7 +252,7 @@ int32_t T_GetTextWidth(TEXTSTRING* textstring)
|
||||||
return width;
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_RemovePrint(TEXTSTRING* textstring)
|
void T_RemovePrint(TEXTSTRING *textstring)
|
||||||
{
|
{
|
||||||
if (!textstring) {
|
if (!textstring) {
|
||||||
return;
|
return;
|
||||||
|
@ -273,7 +273,7 @@ void T_DrawText()
|
||||||
{
|
{
|
||||||
// TombATI FPS counter, pretty pointless IMO as it always shows 30 for me.
|
// TombATI FPS counter, pretty pointless IMO as it always shows 30 for me.
|
||||||
// Additionally, it's not present in TR2+.
|
// Additionally, it's not present in TR2+.
|
||||||
static TEXTSTRING* fps_text = NULL;
|
static TEXTSTRING *fps_text = NULL;
|
||||||
static char fps_buf[20];
|
static char fps_buf[20];
|
||||||
static int fps_counter1 = 0;
|
static int fps_counter1 = 0;
|
||||||
static int fps_counter2 = 0;
|
static int fps_counter2 = 0;
|
||||||
|
@ -309,14 +309,14 @@ void T_DrawText()
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < MAX_TEXT_STRINGS; i++) {
|
for (int i = 0; i < MAX_TEXT_STRINGS; i++) {
|
||||||
TEXTSTRING* textstring = &TextInfoTable[i];
|
TEXTSTRING *textstring = &TextInfoTable[i];
|
||||||
if (textstring->flags & TF_ACTIVE) {
|
if (textstring->flags & TF_ACTIVE) {
|
||||||
T_DrawThisText(textstring);
|
T_DrawThisText(textstring);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void T_DrawThisText(TEXTSTRING* textstring)
|
void T_DrawThisText(TEXTSTRING *textstring)
|
||||||
{
|
{
|
||||||
int sx, sy, sh, sv;
|
int sx, sy, sh, sv;
|
||||||
if (textstring->flags & TF_FLASH) {
|
if (textstring->flags & TF_FLASH) {
|
||||||
|
@ -328,7 +328,7 @@ void T_DrawThisText(TEXTSTRING* textstring)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char* string = textstring->string;
|
char *string = textstring->string;
|
||||||
int xpos = textstring->xpos;
|
int xpos = textstring->xpos;
|
||||||
int ypos = textstring->ypos;
|
int ypos = textstring->ypos;
|
||||||
int zpos = textstring->zpos;
|
int zpos = textstring->zpos;
|
||||||
|
|
|
@ -5,28 +5,28 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void T_InitPrint();
|
void T_InitPrint();
|
||||||
TEXTSTRING*
|
TEXTSTRING *
|
||||||
T_Print(int16_t xpos, int16_t ypos, int16_t zpos, const char* string);
|
T_Print(int16_t xpos, int16_t ypos, int16_t zpos, const char *string);
|
||||||
void T_ChangeText(TEXTSTRING* textstring, const char* string);
|
void T_ChangeText(TEXTSTRING *textstring, const char *string);
|
||||||
void T_SetScale(TEXTSTRING* textstring, int32_t scale_h, int32_t scale_v);
|
void T_SetScale(TEXTSTRING *textstring, int32_t scale_h, int32_t scale_v);
|
||||||
void T_FlashText(TEXTSTRING* textstring, int16_t b, int16_t rate);
|
void T_FlashText(TEXTSTRING *textstring, int16_t b, int16_t rate);
|
||||||
void T_AddBackground(
|
void T_AddBackground(
|
||||||
TEXTSTRING* textstring, int16_t xsize, int16_t ysize, int16_t xoff,
|
TEXTSTRING *textstring, int16_t xsize, int16_t ysize, int16_t xoff,
|
||||||
int16_t yoff, int16_t zoff, int16_t colour, SG_COL* gourptr, int16_t flags);
|
int16_t yoff, int16_t zoff, int16_t colour, SG_COL *gourptr, int16_t flags);
|
||||||
void T_RemoveBackground(TEXTSTRING* textstring);
|
void T_RemoveBackground(TEXTSTRING *textstring);
|
||||||
void T_AddOutline(
|
void T_AddOutline(
|
||||||
TEXTSTRING* textstring, int16_t b, int16_t colour, SG_COL* gourptr,
|
TEXTSTRING *textstring, int16_t b, int16_t colour, SG_COL *gourptr,
|
||||||
int16_t flags);
|
int16_t flags);
|
||||||
void T_RemoveOutline(TEXTSTRING* textstring);
|
void T_RemoveOutline(TEXTSTRING *textstring);
|
||||||
void T_CentreH(TEXTSTRING* textstring, int16_t b);
|
void T_CentreH(TEXTSTRING *textstring, int16_t b);
|
||||||
void T_CentreV(TEXTSTRING* textstring, int16_t b);
|
void T_CentreV(TEXTSTRING *textstring, int16_t b);
|
||||||
void T_RightAlign(TEXTSTRING* textstring, int16_t b);
|
void T_RightAlign(TEXTSTRING *textstring, int16_t b);
|
||||||
void T_BottomAlign(TEXTSTRING* textstring, int16_t b);
|
void T_BottomAlign(TEXTSTRING *textstring, int16_t b);
|
||||||
int32_t T_GetTextWidth(TEXTSTRING* textstring);
|
int32_t T_GetTextWidth(TEXTSTRING *textstring);
|
||||||
void T_RemovePrint(TEXTSTRING* textstring);
|
void T_RemovePrint(TEXTSTRING *textstring);
|
||||||
void T_RemoveAllPrints();
|
void T_RemoveAllPrints();
|
||||||
void T_DrawText();
|
void T_DrawText();
|
||||||
void T_DrawThisText(TEXTSTRING* textstring);
|
void T_DrawThisText(TEXTSTRING *textstring);
|
||||||
|
|
||||||
void T1MInjectGameText();
|
void T1MInjectGameText();
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,8 @@ static BITE_INFO Teeth3B = { 71, -10, -1718, 1 };
|
||||||
|
|
||||||
void InitialiseRollingBall(int16_t item_num)
|
void InitialiseRollingBall(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
GAME_VECTOR* old = game_malloc(sizeof(GAME_VECTOR), GBUF_ROLLINGBALL_STUFF);
|
GAME_VECTOR *old = game_malloc(sizeof(GAME_VECTOR), GBUF_ROLLINGBALL_STUFF);
|
||||||
item->data = old;
|
item->data = old;
|
||||||
old->x = item->pos.x;
|
old->x = item->pos.x;
|
||||||
old->y = item->pos.y;
|
old->y = item->pos.y;
|
||||||
|
@ -52,7 +52,7 @@ void InitialiseRollingBall(int16_t item_num)
|
||||||
|
|
||||||
void RollingBallControl(int16_t item_num)
|
void RollingBallControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (item->status == IS_ACTIVE) {
|
if (item->status == IS_ACTIVE) {
|
||||||
if (item->pos.y < item->floor) {
|
if (item->pos.y < item->floor) {
|
||||||
if (!item->gravity_status) {
|
if (!item->gravity_status) {
|
||||||
|
@ -68,7 +68,7 @@ void RollingBallControl(int16_t item_num)
|
||||||
AnimateItem(item);
|
AnimateItem(item);
|
||||||
|
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
if (item->room_number != room_num) {
|
if (item->room_number != room_num) {
|
||||||
ItemNewRoom(item_num, room_num);
|
ItemNewRoom(item_num, room_num);
|
||||||
|
@ -100,13 +100,13 @@ void RollingBallControl(int16_t item_num)
|
||||||
}
|
}
|
||||||
} else if (item->status == IS_DEACTIVATED && !TriggerActive(item)) {
|
} else if (item->status == IS_DEACTIVATED && !TriggerActive(item)) {
|
||||||
item->status = IS_NOT_ACTIVE;
|
item->status = IS_NOT_ACTIVE;
|
||||||
GAME_VECTOR* old = item->data;
|
GAME_VECTOR *old = item->data;
|
||||||
item->pos.x = old->x;
|
item->pos.x = old->x;
|
||||||
item->pos.y = old->y;
|
item->pos.y = old->y;
|
||||||
item->pos.z = old->z;
|
item->pos.z = old->z;
|
||||||
if (item->room_number != old->room_number) {
|
if (item->room_number != old->room_number) {
|
||||||
RemoveDrawnItem(item_num);
|
RemoveDrawnItem(item_num);
|
||||||
ROOM_INFO* r = &RoomInfo[old->room_number];
|
ROOM_INFO *r = &RoomInfo[old->room_number];
|
||||||
item->next_item = r->item_number;
|
item->next_item = r->item_number;
|
||||||
r->item_number = item_num;
|
r->item_number = item_num;
|
||||||
item->room_number = old->room_number;
|
item->room_number = old->room_number;
|
||||||
|
@ -123,9 +123,9 @@ void RollingBallControl(int16_t item_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
void RollingBallCollision(
|
void RollingBallCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status != IS_ACTIVE) {
|
if (item->status != IS_ACTIVE) {
|
||||||
if (item->status != IS_INVISIBLE) {
|
if (item->status != IS_INVISIBLE) {
|
||||||
|
@ -189,9 +189,9 @@ void RollingBallCollision(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpikeCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
void SpikeCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (lara_item->hit_points < 0) {
|
if (lara_item->hit_points < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ void SpikeCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
||||||
|
|
||||||
void TrapDoorControl(int16_t item_num)
|
void TrapDoorControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (TriggerActive(item)) {
|
if (TriggerActive(item)) {
|
||||||
if (item->current_anim_state == DOOR_CLOSED) {
|
if (item->current_anim_state == DOOR_CLOSED) {
|
||||||
item->goal_anim_state = DOOR_OPEN;
|
item->goal_anim_state = DOOR_OPEN;
|
||||||
|
@ -246,7 +246,7 @@ void TrapDoorControl(int16_t item_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrapDoorFloor(
|
void TrapDoorFloor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
if (!OnTrapDoor(item, x, z)) {
|
if (!OnTrapDoor(item, x, z)) {
|
||||||
return;
|
return;
|
||||||
|
@ -258,7 +258,7 @@ void TrapDoorFloor(
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrapDoorCeiling(
|
void TrapDoorCeiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
if (!OnTrapDoor(item, x, z)) {
|
if (!OnTrapDoor(item, x, z)) {
|
||||||
return;
|
return;
|
||||||
|
@ -269,7 +269,7 @@ void TrapDoorCeiling(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t OnTrapDoor(ITEM_INFO* item, int32_t x, int32_t z)
|
int32_t OnTrapDoor(ITEM_INFO *item, int32_t x, int32_t z)
|
||||||
{
|
{
|
||||||
x >>= WALL_SHIFT;
|
x >>= WALL_SHIFT;
|
||||||
z >>= WALL_SHIFT;
|
z >>= WALL_SHIFT;
|
||||||
|
@ -293,7 +293,7 @@ int32_t OnTrapDoor(ITEM_INFO* item, int32_t x, int32_t z)
|
||||||
// original name: Pendulum
|
// original name: Pendulum
|
||||||
void PendulumControl(int16_t item_num)
|
void PendulumControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (TriggerActive(item)) {
|
if (TriggerActive(item)) {
|
||||||
if (item->current_anim_state == TRAP_SET) {
|
if (item->current_anim_state == TRAP_SET) {
|
||||||
|
@ -315,7 +315,7 @@ void PendulumControl(int16_t item_num)
|
||||||
DoBloodSplat(x, y, z, LaraItem->speed, d, LaraItem->room_number);
|
DoBloodSplat(x, y, z, LaraItem->speed, d, LaraItem->room_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &item->room_number);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &item->room_number);
|
||||||
item->floor = GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
item->floor = GetHeight(floor, item->pos.x, item->pos.y, item->pos.z);
|
||||||
|
|
||||||
|
@ -325,7 +325,7 @@ void PendulumControl(int16_t item_num)
|
||||||
// original name: FallingBlock
|
// original name: FallingBlock
|
||||||
void FallingBlockControl(int16_t item_num)
|
void FallingBlockControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
switch (item->current_anim_state) {
|
switch (item->current_anim_state) {
|
||||||
case TRAP_SET:
|
case TRAP_SET:
|
||||||
|
@ -356,7 +356,7 @@ void FallingBlockControl(int16_t item_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
if (item->room_number != room_num) {
|
if (item->room_number != room_num) {
|
||||||
ItemNewRoom(item_num, room_num);
|
ItemNewRoom(item_num, room_num);
|
||||||
|
@ -374,7 +374,7 @@ void FallingBlockControl(int16_t item_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
void FallingBlockFloor(
|
void FallingBlockFloor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
if (y <= item->pos.y - STEP_L * 2
|
if (y <= item->pos.y - STEP_L * 2
|
||||||
&& (item->current_anim_state == TRAP_SET
|
&& (item->current_anim_state == TRAP_SET
|
||||||
|
@ -384,7 +384,7 @@ void FallingBlockFloor(
|
||||||
}
|
}
|
||||||
|
|
||||||
void FallingBlockCeiling(
|
void FallingBlockCeiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height)
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height)
|
||||||
{
|
{
|
||||||
if (y > item->pos.y - STEP_L * 2
|
if (y > item->pos.y - STEP_L * 2
|
||||||
&& (item->current_anim_state == TRAP_SET
|
&& (item->current_anim_state == TRAP_SET
|
||||||
|
@ -396,7 +396,7 @@ void FallingBlockCeiling(
|
||||||
// original name: TeethTrap
|
// original name: TeethTrap
|
||||||
void TeethTrapControl(int16_t item_num)
|
void TeethTrapControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (TriggerActive(item)) {
|
if (TriggerActive(item)) {
|
||||||
item->goal_anim_state = TT_NASTY;
|
item->goal_anim_state = TT_NASTY;
|
||||||
if (item->touch_bits && item->current_anim_state == TT_NASTY) {
|
if (item->touch_bits && item->current_anim_state == TT_NASTY) {
|
||||||
|
@ -418,7 +418,7 @@ void TeethTrapControl(int16_t item_num)
|
||||||
// original name: FallingCeiling
|
// original name: FallingCeiling
|
||||||
void FallingCeilingControl(int16_t item_num)
|
void FallingCeilingControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (item->current_anim_state == TRAP_SET) {
|
if (item->current_anim_state == TRAP_SET) {
|
||||||
item->goal_anim_state = TRAP_ACTIVATE;
|
item->goal_anim_state = TRAP_ACTIVATE;
|
||||||
item->gravity_status = 1;
|
item->gravity_status = 1;
|
||||||
|
@ -441,7 +441,7 @@ void FallingCeilingControl(int16_t item_num)
|
||||||
|
|
||||||
void InitialiseDamoclesSword(int16_t item_num)
|
void InitialiseDamoclesSword(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
item->pos.y_rot = GetRandomControl();
|
item->pos.y_rot = GetRandomControl();
|
||||||
item->required_anim_state = (GetRandomControl() - 0x4000) / 16;
|
item->required_anim_state = (GetRandomControl() - 0x4000) / 16;
|
||||||
item->fall_speed = 50;
|
item->fall_speed = 50;
|
||||||
|
@ -449,7 +449,7 @@ void InitialiseDamoclesSword(int16_t item_num)
|
||||||
|
|
||||||
void DamoclesSwordControl(int16_t item_num)
|
void DamoclesSwordControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (item->gravity_status) {
|
if (item->gravity_status) {
|
||||||
item->pos.y_rot += item->required_anim_state;
|
item->pos.y_rot += item->required_anim_state;
|
||||||
item->fall_speed += item->fall_speed < FASTFALL_SPEED ? GRAVITY : 1;
|
item->fall_speed += item->fall_speed < FASTFALL_SPEED ? GRAVITY : 1;
|
||||||
|
@ -480,9 +480,9 @@ void DamoclesSwordControl(int16_t item_num)
|
||||||
}
|
}
|
||||||
|
|
||||||
void DamoclesSwordCollision(
|
void DamoclesSwordCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll)
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
if (!TestBoundsCollide(item, lara_item, coll->radius)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -501,7 +501,7 @@ void DamoclesSwordCollision(
|
||||||
|
|
||||||
void DartEmitterControl(int16_t item_num)
|
void DartEmitterControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (TriggerActive(item)) {
|
if (TriggerActive(item)) {
|
||||||
if (item->current_anim_state == DE_IDLE) {
|
if (item->current_anim_state == DE_IDLE) {
|
||||||
|
@ -517,7 +517,7 @@ void DartEmitterControl(int16_t item_num)
|
||||||
&& item->frame_number == Anims[item->anim_number].frame_base) {
|
&& item->frame_number == Anims[item->anim_number].frame_base) {
|
||||||
int16_t dart_item_num = CreateItem();
|
int16_t dart_item_num = CreateItem();
|
||||||
if (dart_item_num != NO_ITEM) {
|
if (dart_item_num != NO_ITEM) {
|
||||||
ITEM_INFO* dart = &Items[dart_item_num];
|
ITEM_INFO *dart = &Items[dart_item_num];
|
||||||
dart->object_number = O_DARTS;
|
dart->object_number = O_DARTS;
|
||||||
dart->room_number = item->room_number;
|
dart->room_number = item->room_number;
|
||||||
dart->shade = -1;
|
dart->shade = -1;
|
||||||
|
@ -549,7 +549,7 @@ void DartEmitterControl(int16_t item_num)
|
||||||
|
|
||||||
int16_t fx_num = CreateEffect(dart->room_number);
|
int16_t fx_num = CreateEffect(dart->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos = dart->pos;
|
fx->pos = dart->pos;
|
||||||
fx->speed = 0;
|
fx->speed = 0;
|
||||||
fx->frame_number = 0;
|
fx->frame_number = 0;
|
||||||
|
@ -564,7 +564,7 @@ void DartEmitterControl(int16_t item_num)
|
||||||
|
|
||||||
void DartsControl(int16_t item_num)
|
void DartsControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (item->touch_bits) {
|
if (item->touch_bits) {
|
||||||
LaraItem->hit_points -= 50;
|
LaraItem->hit_points -= 50;
|
||||||
LaraItem->hit_status = 1;
|
LaraItem->hit_status = 1;
|
||||||
|
@ -575,7 +575,7 @@ void DartsControl(int16_t item_num)
|
||||||
AnimateItem(item);
|
AnimateItem(item);
|
||||||
|
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor =
|
FLOOR_INFO *floor =
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
if (item->room_number != room_num) {
|
if (item->room_number != room_num) {
|
||||||
ItemNewRoom(item_num, room_num);
|
ItemNewRoom(item_num, room_num);
|
||||||
|
@ -586,7 +586,7 @@ void DartsControl(int16_t item_num)
|
||||||
KillItem(item_num);
|
KillItem(item_num);
|
||||||
int16_t fx_num = CreateEffect(item->room_number);
|
int16_t fx_num = CreateEffect(item->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos = item->pos;
|
fx->pos = item->pos;
|
||||||
fx->speed = 0;
|
fx->speed = 0;
|
||||||
fx->counter = 6;
|
fx->counter = 6;
|
||||||
|
@ -598,7 +598,7 @@ void DartsControl(int16_t item_num)
|
||||||
|
|
||||||
void DartEffectControl(int16_t fx_num)
|
void DartEffectControl(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->counter++;
|
fx->counter++;
|
||||||
if (fx->counter >= 3) {
|
if (fx->counter >= 3) {
|
||||||
fx->counter = 0;
|
fx->counter = 0;
|
||||||
|
@ -611,12 +611,12 @@ void DartEffectControl(int16_t fx_num)
|
||||||
|
|
||||||
void FlameEmitterControl(int16_t item_num)
|
void FlameEmitterControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
if (TriggerActive(item)) {
|
if (TriggerActive(item)) {
|
||||||
if (!item->data) {
|
if (!item->data) {
|
||||||
int16_t fx_num = CreateEffect(item->room_number);
|
int16_t fx_num = CreateEffect(item->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.x = item->pos.x;
|
fx->pos.x = item->pos.x;
|
||||||
fx->pos.y = item->pos.y;
|
fx->pos.y = item->pos.y;
|
||||||
fx->pos.z = item->pos.z;
|
fx->pos.z = item->pos.z;
|
||||||
|
@ -624,7 +624,7 @@ void FlameEmitterControl(int16_t item_num)
|
||||||
fx->object_number = O_FLAME;
|
fx->object_number = O_FLAME;
|
||||||
fx->counter = 0;
|
fx->counter = 0;
|
||||||
}
|
}
|
||||||
item->data = (void*)(fx_num + 1);
|
item->data = (void *)(fx_num + 1);
|
||||||
}
|
}
|
||||||
} else if (item->data) {
|
} else if (item->data) {
|
||||||
StopSoundEffect(150, NULL);
|
StopSoundEffect(150, NULL);
|
||||||
|
@ -635,7 +635,7 @@ void FlameEmitterControl(int16_t item_num)
|
||||||
|
|
||||||
void FlameControl(int16_t fx_num)
|
void FlameControl(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
|
|
||||||
fx->frame_number--;
|
fx->frame_number--;
|
||||||
if (fx->frame_number <= Objects[O_FLAME].nmeshes) {
|
if (fx->frame_number <= Objects[O_FLAME].nmeshes) {
|
||||||
|
@ -659,7 +659,7 @@ void FlameControl(int16_t fx_num)
|
||||||
fx->pos.z = 0;
|
fx->pos.z = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
GetJointAbsPosition(LaraItem, (PHD_VECTOR*)&fx->pos, -1 - fx->counter);
|
GetJointAbsPosition(LaraItem, (PHD_VECTOR *)&fx->pos, -1 - fx->counter);
|
||||||
|
|
||||||
#ifdef T1M_FEAT_OG_FIXES
|
#ifdef T1M_FEAT_OG_FIXES
|
||||||
int32_t y = GetWaterHeight(
|
int32_t y = GetWaterHeight(
|
||||||
|
@ -713,7 +713,7 @@ void FlameControl(int16_t fx_num)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LavaBurn(ITEM_INFO* item)
|
void LavaBurn(ITEM_INFO *item)
|
||||||
{
|
{
|
||||||
#ifdef T1M_FEAT_CHEATS
|
#ifdef T1M_FEAT_CHEATS
|
||||||
if (Lara.water_status == LWS_CHEAT) {
|
if (Lara.water_status == LWS_CHEAT) {
|
||||||
|
@ -726,7 +726,7 @@ void LavaBurn(ITEM_INFO* item)
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(item->pos.x, 32000, item->pos.z, &room_num);
|
FLOOR_INFO *floor = GetFloor(item->pos.x, 32000, item->pos.z, &room_num);
|
||||||
|
|
||||||
if (item->floor != GetHeight(floor, item->pos.x, 32000, item->pos.z)) {
|
if (item->floor != GetHeight(floor, item->pos.x, 32000, item->pos.z)) {
|
||||||
return;
|
return;
|
||||||
|
@ -737,7 +737,7 @@ void LavaBurn(ITEM_INFO* item)
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
int16_t fx_num = CreateEffect(item->room_number);
|
int16_t fx_num = CreateEffect(item->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->object_number = O_FLAME;
|
fx->object_number = O_FLAME;
|
||||||
fx->frame_number =
|
fx->frame_number =
|
||||||
(Objects[O_FLAME].nmeshes * GetRandomControl()) / 0x7FFF;
|
(Objects[O_FLAME].nmeshes * GetRandomControl()) / 0x7FFF;
|
||||||
|
@ -749,10 +749,10 @@ void LavaBurn(ITEM_INFO* item)
|
||||||
// original name: LavaSpray
|
// original name: LavaSpray
|
||||||
void LavaEmitterControl(int16_t item_num)
|
void LavaEmitterControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
int16_t fx_num = CreateEffect(item->room_number);
|
int16_t fx_num = CreateEffect(item->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.x = item->pos.x;
|
fx->pos.x = item->pos.x;
|
||||||
fx->pos.y = item->pos.y;
|
fx->pos.y = item->pos.y;
|
||||||
fx->pos.z = item->pos.z;
|
fx->pos.z = item->pos.z;
|
||||||
|
@ -768,14 +768,14 @@ void LavaEmitterControl(int16_t item_num)
|
||||||
// original name: ControlLavaBlob
|
// original name: ControlLavaBlob
|
||||||
void LavaControl(int16_t fx_num)
|
void LavaControl(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.z += (fx->speed * phd_cos(fx->pos.y_rot)) >> W2V_SHIFT;
|
fx->pos.z += (fx->speed * phd_cos(fx->pos.y_rot)) >> W2V_SHIFT;
|
||||||
fx->pos.x += (fx->speed * phd_sin(fx->pos.y_rot)) >> W2V_SHIFT;
|
fx->pos.x += (fx->speed * phd_sin(fx->pos.y_rot)) >> W2V_SHIFT;
|
||||||
fx->fall_speed += GRAVITY;
|
fx->fall_speed += GRAVITY;
|
||||||
fx->pos.y += fx->fall_speed;
|
fx->pos.y += fx->fall_speed;
|
||||||
|
|
||||||
int16_t room_num = fx->room_number;
|
int16_t room_num = fx->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(fx->pos.x, fx->pos.y, fx->pos.z, &room_num);
|
FLOOR_INFO *floor = GetFloor(fx->pos.x, fx->pos.y, fx->pos.z, &room_num);
|
||||||
if (fx->pos.y >= GetHeight(floor, fx->pos.x, fx->pos.y, fx->pos.z)
|
if (fx->pos.y >= GetHeight(floor, fx->pos.x, fx->pos.y, fx->pos.z)
|
||||||
|| fx->pos.y < GetCeiling(floor, fx->pos.x, fx->pos.y, fx->pos.z)) {
|
|| fx->pos.y < GetCeiling(floor, fx->pos.x, fx->pos.y, fx->pos.z)) {
|
||||||
KillEffect(fx_num);
|
KillEffect(fx_num);
|
||||||
|
@ -791,7 +791,7 @@ void LavaControl(int16_t fx_num)
|
||||||
// original name: LavaWedge
|
// original name: LavaWedge
|
||||||
void LavaWedgeControl(int16_t item_num)
|
void LavaWedgeControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
int16_t room_num = item->room_number;
|
int16_t room_num = item->room_number;
|
||||||
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
GetFloor(item->pos.x, item->pos.y, item->pos.z, &room_num);
|
||||||
|
@ -822,7 +822,7 @@ void LavaWedgeControl(int16_t item_num)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
FLOOR_INFO* floor = GetFloor(x, item->pos.y, z, &room_num);
|
FLOOR_INFO *floor = GetFloor(x, item->pos.y, z, &room_num);
|
||||||
if (GetHeight(floor, x, item->pos.y, z) != item->pos.y) {
|
if (GetHeight(floor, x, item->pos.y, z) != item->pos.y) {
|
||||||
item->status = IS_DEACTIVATED;
|
item->status = IS_DEACTIVATED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,32 +7,32 @@
|
||||||
void InitialiseRollingBall(int16_t item_num);
|
void InitialiseRollingBall(int16_t item_num);
|
||||||
void RollingBallControl(int16_t item_num);
|
void RollingBallControl(int16_t item_num);
|
||||||
void RollingBallCollision(
|
void RollingBallCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void SpikeCollision(int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
void SpikeCollision(int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void TrapDoorControl(int16_t item_num);
|
void TrapDoorControl(int16_t item_num);
|
||||||
void TrapDoorFloor(
|
void TrapDoorFloor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
void TrapDoorCeiling(
|
void TrapDoorCeiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
int32_t OnTrapDoor(ITEM_INFO* item, int32_t x, int32_t z);
|
int32_t OnTrapDoor(ITEM_INFO *item, int32_t x, int32_t z);
|
||||||
void PendulumControl(int16_t item_num);
|
void PendulumControl(int16_t item_num);
|
||||||
void FallingBlockControl(int16_t item_num);
|
void FallingBlockControl(int16_t item_num);
|
||||||
void FallingBlockFloor(
|
void FallingBlockFloor(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
void FallingBlockCeiling(
|
void FallingBlockCeiling(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
void TeethTrapControl(int16_t item_num);
|
void TeethTrapControl(int16_t item_num);
|
||||||
void FallingCeilingControl(int16_t item_num);
|
void FallingCeilingControl(int16_t item_num);
|
||||||
void InitialiseDamoclesSword(int16_t item_num);
|
void InitialiseDamoclesSword(int16_t item_num);
|
||||||
void DamoclesSwordControl(int16_t item_num);
|
void DamoclesSwordControl(int16_t item_num);
|
||||||
void DamoclesSwordCollision(
|
void DamoclesSwordCollision(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
void DartEmitterControl(int16_t item_num);
|
void DartEmitterControl(int16_t item_num);
|
||||||
void DartsControl(int16_t item_num);
|
void DartsControl(int16_t item_num);
|
||||||
void DartEffectControl(int16_t fx_num);
|
void DartEffectControl(int16_t fx_num);
|
||||||
void FlameEmitterControl(int16_t item_num);
|
void FlameEmitterControl(int16_t item_num);
|
||||||
void FlameControl(int16_t fx_num);
|
void FlameControl(int16_t fx_num);
|
||||||
void LavaBurn(ITEM_INFO* item);
|
void LavaBurn(ITEM_INFO *item);
|
||||||
void LavaEmitterControl(int16_t item_num);
|
void LavaEmitterControl(int16_t item_num);
|
||||||
void LavaControl(int16_t fx_num);
|
void LavaControl(int16_t fx_num);
|
||||||
void LavaWedgeControl(int16_t item_num);
|
void LavaWedgeControl(int16_t item_num);
|
||||||
|
|
|
@ -823,7 +823,7 @@ typedef struct {
|
||||||
} FLOOR_INFO;
|
} FLOOR_INFO;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0000 */ FLOOR_INFO* floor;
|
/* 0000 */ FLOOR_INFO *floor;
|
||||||
/* 0004 */ FLOOR_INFO data;
|
/* 0004 */ FLOOR_INFO data;
|
||||||
/* 000C */ int16_t block;
|
/* 000C */ int16_t block;
|
||||||
/* 000E end */
|
/* 000E end */
|
||||||
|
@ -857,11 +857,11 @@ typedef struct {
|
||||||
} MESH_INFO;
|
} MESH_INFO;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0000 */ int16_t* data;
|
/* 0000 */ int16_t *data;
|
||||||
/* 0004 */ DOOR_INFOS* doors;
|
/* 0004 */ DOOR_INFOS *doors;
|
||||||
/* 0008 */ FLOOR_INFO* floor;
|
/* 0008 */ FLOOR_INFO *floor;
|
||||||
/* 000C */ LIGHT_INFO* light;
|
/* 000C */ LIGHT_INFO *light;
|
||||||
/* 0010 */ MESH_INFO* mesh;
|
/* 0010 */ MESH_INFO *mesh;
|
||||||
/* 0014 */ int32_t x;
|
/* 0014 */ int32_t x;
|
||||||
/* 0018 */ int32_t y;
|
/* 0018 */ int32_t y;
|
||||||
/* 001C */ int32_t z;
|
/* 001C */ int32_t z;
|
||||||
|
@ -914,7 +914,7 @@ typedef struct {
|
||||||
/* 0026 */ int16_t timer;
|
/* 0026 */ int16_t timer;
|
||||||
/* 0028 */ int16_t flags;
|
/* 0028 */ int16_t flags;
|
||||||
/* 002A */ int16_t shade;
|
/* 002A */ int16_t shade;
|
||||||
/* 002C */ void* data;
|
/* 002C */ void *data;
|
||||||
/* 0030 */ PHD_3DPOS pos;
|
/* 0030 */ PHD_3DPOS pos;
|
||||||
/* 0042 */ uint16_t active : 1;
|
/* 0042 */ uint16_t active : 1;
|
||||||
/* */ uint16_t status : 2;
|
/* */ uint16_t status : 2;
|
||||||
|
@ -926,7 +926,7 @@ typedef struct {
|
||||||
} ITEM_INFO;
|
} ITEM_INFO;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0000 */ int16_t* frame_base;
|
/* 0000 */ int16_t *frame_base;
|
||||||
/* 0004 */ int16_t frame_number;
|
/* 0004 */ int16_t frame_number;
|
||||||
/* 0006 */ int16_t lock;
|
/* 0006 */ int16_t lock;
|
||||||
/* 0008 */ PHD_ANGLE y_rot;
|
/* 0008 */ PHD_ANGLE y_rot;
|
||||||
|
@ -952,7 +952,7 @@ typedef struct {
|
||||||
} BOX_NODE;
|
} BOX_NODE;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0000 */ BOX_NODE* node;
|
/* 0000 */ BOX_NODE *node;
|
||||||
/* 0004 */ int16_t head;
|
/* 0004 */ int16_t head;
|
||||||
/* 0006 */ int16_t tail;
|
/* 0006 */ int16_t tail;
|
||||||
/* 0008 */ uint16_t search_number;
|
/* 0008 */ uint16_t search_number;
|
||||||
|
@ -996,10 +996,10 @@ typedef struct {
|
||||||
/* 0016 */ int16_t death_count;
|
/* 0016 */ int16_t death_count;
|
||||||
/* 0018 */ int16_t current_active;
|
/* 0018 */ int16_t current_active;
|
||||||
/* 001A */ int16_t spaz_effect_count;
|
/* 001A */ int16_t spaz_effect_count;
|
||||||
/* 001C */ FX_INFO* spaz_effect;
|
/* 001C */ FX_INFO *spaz_effect;
|
||||||
/* 0020 */ int32_t mesh_effects;
|
/* 0020 */ int32_t mesh_effects;
|
||||||
/* 0024 */ int16_t* mesh_ptrs[LM_NUMBER_OF];
|
/* 0024 */ int16_t *mesh_ptrs[LM_NUMBER_OF];
|
||||||
/* 0060 */ ITEM_INFO* target;
|
/* 0060 */ ITEM_INFO *target;
|
||||||
/* 0064 */ PHD_ANGLE target_angles[2];
|
/* 0064 */ PHD_ANGLE target_angles[2];
|
||||||
/* 0068 */ int16_t turn_rate;
|
/* 0068 */ int16_t turn_rate;
|
||||||
/* 006A */ int16_t move_angle;
|
/* 006A */ int16_t move_angle;
|
||||||
|
@ -1075,9 +1075,9 @@ typedef struct {
|
||||||
/* 0014 */ int16_t flash_rate;
|
/* 0014 */ int16_t flash_rate;
|
||||||
/* 0016 */ int16_t flash_count;
|
/* 0016 */ int16_t flash_count;
|
||||||
/* 0018 */ int16_t bgnd_colour;
|
/* 0018 */ int16_t bgnd_colour;
|
||||||
/* 001A */ SG_COL* bgnd_gour;
|
/* 001A */ SG_COL *bgnd_gour;
|
||||||
/* 001E */ int16_t outl_colour;
|
/* 001E */ int16_t outl_colour;
|
||||||
/* 0020 */ SG_COL* outl_gour;
|
/* 0020 */ SG_COL *outl_gour;
|
||||||
/* 0024 */ int16_t bgnd_size_x;
|
/* 0024 */ int16_t bgnd_size_x;
|
||||||
/* 0026 */ int16_t bgnd_size_y;
|
/* 0026 */ int16_t bgnd_size_y;
|
||||||
/* 0028 */ int16_t bgnd_off_x;
|
/* 0028 */ int16_t bgnd_off_x;
|
||||||
|
@ -1085,7 +1085,7 @@ typedef struct {
|
||||||
/* 002C */ int16_t bgnd_off_z;
|
/* 002C */ int16_t bgnd_off_z;
|
||||||
/* 002E */ int32_t scale_h;
|
/* 002E */ int32_t scale_h;
|
||||||
/* 0032 */ int32_t scale_v;
|
/* 0032 */ int32_t scale_v;
|
||||||
/* 0034 */ char* string;
|
/* 0034 */ char *string;
|
||||||
/* 0038 end */
|
/* 0038 end */
|
||||||
} TEXTSTRING;
|
} TEXTSTRING;
|
||||||
|
|
||||||
|
@ -1129,7 +1129,7 @@ typedef struct {
|
||||||
/* 004C */ int16_t facing;
|
/* 004C */ int16_t facing;
|
||||||
/* 004E */ int16_t quadrant;
|
/* 004E */ int16_t quadrant;
|
||||||
/* 0050 */ int16_t coll_type;
|
/* 0050 */ int16_t coll_type;
|
||||||
/* 0052 */ int16_t* trigger;
|
/* 0052 */ int16_t *trigger;
|
||||||
/* 0056 */ int8_t tilt_x;
|
/* 0056 */ int8_t tilt_x;
|
||||||
/* 0057 */ int8_t tilt_z;
|
/* 0057 */ int8_t tilt_z;
|
||||||
/* 0058 */ int8_t hit_by_baddie;
|
/* 0058 */ int8_t hit_by_baddie;
|
||||||
|
@ -1146,16 +1146,16 @@ typedef struct {
|
||||||
/* 0000 */ int16_t nmeshes;
|
/* 0000 */ int16_t nmeshes;
|
||||||
/* 0002 */ int16_t mesh_index;
|
/* 0002 */ int16_t mesh_index;
|
||||||
/* 0004 */ int32_t bone_index;
|
/* 0004 */ int32_t bone_index;
|
||||||
/* 0008 */ int16_t* frame_base;
|
/* 0008 */ int16_t *frame_base;
|
||||||
/* 000C */ void (*initialise)(int16_t item_num);
|
/* 000C */ void (*initialise)(int16_t item_num);
|
||||||
/* 0010 */ void (*control)(int16_t item_num);
|
/* 0010 */ void (*control)(int16_t item_num);
|
||||||
/* 0014 */ void (*floor)(
|
/* 0014 */ void (*floor)(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
/* 0018 */ void (*ceiling)(
|
/* 0018 */ void (*ceiling)(
|
||||||
ITEM_INFO* item, int32_t x, int32_t y, int32_t z, int16_t* height);
|
ITEM_INFO *item, int32_t x, int32_t y, int32_t z, int16_t *height);
|
||||||
/* 001C */ void (*draw_routine)(ITEM_INFO* item);
|
/* 001C */ void (*draw_routine)(ITEM_INFO *item);
|
||||||
/* 0020 */ void (*collision)(
|
/* 0020 */ void (*collision)(
|
||||||
int16_t item_num, ITEM_INFO* lara_item, COLL_INFO* coll);
|
int16_t item_num, ITEM_INFO *lara_item, COLL_INFO *coll);
|
||||||
/* 0024 */ int16_t anim_index;
|
/* 0024 */ int16_t anim_index;
|
||||||
/* 0026 */ int16_t hit_points;
|
/* 0026 */ int16_t hit_points;
|
||||||
/* 0028 */ int16_t pivot_length;
|
/* 0028 */ int16_t pivot_length;
|
||||||
|
@ -1240,14 +1240,14 @@ typedef struct {
|
||||||
/* 004E */ int16_t last;
|
/* 004E */ int16_t last;
|
||||||
/* 0050 */ int16_t timer;
|
/* 0050 */ int16_t timer;
|
||||||
/* 0052 */ int16_t speed;
|
/* 0052 */ int16_t speed;
|
||||||
/* 0054 */ ITEM_INFO* item;
|
/* 0054 */ ITEM_INFO *item;
|
||||||
/* 0058 */ ITEM_INFO* last_item;
|
/* 0058 */ ITEM_INFO *last_item;
|
||||||
/* 005C */ OBJECT_VECTOR* fixed;
|
/* 005C */ OBJECT_VECTOR *fixed;
|
||||||
/* 0060 end */
|
/* 0060 end */
|
||||||
} CAMERA_INFO;
|
} CAMERA_INFO;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0000 */ int16_t* frame_ptr;
|
/* 0000 */ int16_t *frame_ptr;
|
||||||
/* 0004 */ int16_t interpolation;
|
/* 0004 */ int16_t interpolation;
|
||||||
/* 0006 */ int16_t current_anim_state;
|
/* 0006 */ int16_t current_anim_state;
|
||||||
/* 0008 */ int32_t velocity;
|
/* 0008 */ int32_t velocity;
|
||||||
|
@ -1405,13 +1405,13 @@ typedef struct {
|
||||||
/* 0010 */ int16_t y;
|
/* 0010 */ int16_t y;
|
||||||
/* 0012 */ int16_t z;
|
/* 0012 */ int16_t z;
|
||||||
/* 0014 */ int32_t item_heading;
|
/* 0014 */ int32_t item_heading;
|
||||||
/* 0018 */ char* item_texts;
|
/* 0018 */ char *item_texts;
|
||||||
/* 001C */ int16_t item_text_len;
|
/* 001C */ int16_t item_text_len;
|
||||||
/* 001E */ TEXTSTRING* heading;
|
/* 001E */ TEXTSTRING *heading;
|
||||||
/* 0022 */ TEXTSTRING* background;
|
/* 0022 */ TEXTSTRING *background;
|
||||||
/* 0026 */ TEXTSTRING* moreup;
|
/* 0026 */ TEXTSTRING *moreup;
|
||||||
/* 002A */ TEXTSTRING* moredown;
|
/* 002A */ TEXTSTRING *moredown;
|
||||||
/* 002E */ TEXTSTRING* texts[MAX_REQLINES];
|
/* 002E */ TEXTSTRING *texts[MAX_REQLINES];
|
||||||
/* 006E */ int16_t flags[MAX_REQLINES];
|
/* 006E */ int16_t flags[MAX_REQLINES];
|
||||||
/* 008E end */
|
/* 008E end */
|
||||||
} REQUEST_INFO;
|
} REQUEST_INFO;
|
||||||
|
@ -1447,7 +1447,7 @@ typedef struct {
|
||||||
/* 0006 */ int16_t z;
|
/* 0006 */ int16_t z;
|
||||||
/* 0008 */ int32_t param1;
|
/* 0008 */ int32_t param1;
|
||||||
/* 000C */ int32_t param2;
|
/* 000C */ int32_t param2;
|
||||||
/* 0010 */ SG_COL* grdptr;
|
/* 0010 */ SG_COL *grdptr;
|
||||||
/* 0014 */ int16_t sprnum;
|
/* 0014 */ int16_t sprnum;
|
||||||
/* 0016 end */
|
/* 0016 end */
|
||||||
} INVENTORY_SPRITE;
|
} INVENTORY_SPRITE;
|
||||||
|
@ -1475,12 +1475,12 @@ typedef struct {
|
||||||
/* 0030 */ uint32_t which_meshes;
|
/* 0030 */ uint32_t which_meshes;
|
||||||
/* 0034 */ uint32_t drawn_meshes;
|
/* 0034 */ uint32_t drawn_meshes;
|
||||||
/* 0038 */ int16_t inv_pos;
|
/* 0038 */ int16_t inv_pos;
|
||||||
/* 003A */ INVENTORY_SPRITE** sprlist;
|
/* 003A */ INVENTORY_SPRITE **sprlist;
|
||||||
/* 003E end */
|
/* 003E end */
|
||||||
} INVENTORY_ITEM;
|
} INVENTORY_ITEM;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/* 0000 */ INVENTORY_ITEM** list;
|
/* 0000 */ INVENTORY_ITEM **list;
|
||||||
/* 0004 */ int16_t type;
|
/* 0004 */ int16_t type;
|
||||||
/* 0006 */ int16_t radius;
|
/* 0006 */ int16_t radius;
|
||||||
/* 0008 */ int16_t camera_pitch;
|
/* 0008 */ int16_t camera_pitch;
|
||||||
|
@ -1496,14 +1496,14 @@ typedef struct {
|
||||||
/* 001C */ PHD_3DPOS ringpos;
|
/* 001C */ PHD_3DPOS ringpos;
|
||||||
/* 002E */ PHD_3DPOS camera;
|
/* 002E */ PHD_3DPOS camera;
|
||||||
/* 0040 */ PHD_VECTOR light;
|
/* 0040 */ PHD_VECTOR light;
|
||||||
/* 004C */ IMOTION_INFO* imo;
|
/* 004C */ IMOTION_INFO *imo;
|
||||||
/* 0050 end */
|
/* 0050 end */
|
||||||
} RING_INFO;
|
} RING_INFO;
|
||||||
|
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
typedef void (*ControlRoutine)(ITEM_INFO*, COLL_INFO*);
|
typedef void (*ControlRoutine)(ITEM_INFO *, COLL_INFO *);
|
||||||
typedef void (*CollisionRoutine)(ITEM_INFO*, COLL_INFO*);
|
typedef void (*CollisionRoutine)(ITEM_INFO *, COLL_INFO *);
|
||||||
typedef void (*EffectRoutine)(ITEM_INFO* item);
|
typedef void (*EffectRoutine)(ITEM_INFO *item);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -96,7 +96,7 @@ static BITE_INFO WarriorShard = { -35, 269, 0, 9 };
|
||||||
|
|
||||||
void CentaurControl(int16_t item_num)
|
void CentaurControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -105,7 +105,7 @@ void CentaurControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* centaur = item->data;
|
CREATURE_INFO *centaur = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ void InitialiseWarrior2(int16_t item_num)
|
||||||
|
|
||||||
void FlyerControl(int16_t item_num)
|
void FlyerControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -216,7 +216,7 @@ void FlyerControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* flyer = item->data;
|
CREATURE_INFO *flyer = item->data;
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
int16_t angle = 0;
|
int16_t angle = 0;
|
||||||
|
|
||||||
|
@ -460,7 +460,7 @@ void FlyerControl(int16_t item_num)
|
||||||
|
|
||||||
void ControlMissile(int16_t fx_num)
|
void ControlMissile(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
|
|
||||||
int32_t speed = (fx->speed * phd_cos(fx->pos.x_rot)) >> W2V_SHIFT;
|
int32_t speed = (fx->speed * phd_cos(fx->pos.x_rot)) >> W2V_SHIFT;
|
||||||
fx->pos.y += (fx->speed * phd_sin(-fx->pos.x_rot)) >> W2V_SHIFT;
|
fx->pos.y += (fx->speed * phd_sin(-fx->pos.x_rot)) >> W2V_SHIFT;
|
||||||
|
@ -468,7 +468,7 @@ void ControlMissile(int16_t fx_num)
|
||||||
fx->pos.x += (speed * phd_sin(fx->pos.y_rot)) >> W2V_SHIFT;
|
fx->pos.x += (speed * phd_sin(fx->pos.y_rot)) >> W2V_SHIFT;
|
||||||
|
|
||||||
int16_t room_num = fx->room_number;
|
int16_t room_num = fx->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(fx->pos.x, fx->pos.y, fx->pos.z, &room_num);
|
FLOOR_INFO *floor = GetFloor(fx->pos.x, fx->pos.y, fx->pos.z, &room_num);
|
||||||
int32_t height = GetHeight(floor, fx->pos.x, fx->pos.y, fx->pos.z);
|
int32_t height = GetHeight(floor, fx->pos.x, fx->pos.y, fx->pos.z);
|
||||||
int32_t ceiling = GetCeiling(floor, fx->pos.x, fx->pos.y, fx->pos.z);
|
int32_t ceiling = GetCeiling(floor, fx->pos.x, fx->pos.y, fx->pos.z);
|
||||||
|
|
||||||
|
@ -529,13 +529,13 @@ void ControlMissile(int16_t fx_num)
|
||||||
fx->counter = 0;
|
fx->counter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShootAtLara(FX_INFO* fx)
|
void ShootAtLara(FX_INFO *fx)
|
||||||
{
|
{
|
||||||
int32_t x = LaraItem->pos.x - fx->pos.x;
|
int32_t x = LaraItem->pos.x - fx->pos.x;
|
||||||
int32_t y = LaraItem->pos.y - fx->pos.y;
|
int32_t y = LaraItem->pos.y - fx->pos.y;
|
||||||
int32_t z = LaraItem->pos.z - fx->pos.z;
|
int32_t z = LaraItem->pos.z - fx->pos.z;
|
||||||
|
|
||||||
int16_t* bounds = GetBoundsAccurate(LaraItem);
|
int16_t *bounds = GetBoundsAccurate(LaraItem);
|
||||||
y += bounds[FRAME_BOUND_MAX_Y]
|
y += bounds[FRAME_BOUND_MAX_Y]
|
||||||
+ (bounds[FRAME_BOUND_MIN_Y] - bounds[FRAME_BOUND_MAX_Y]) * 3 / 4;
|
+ (bounds[FRAME_BOUND_MIN_Y] - bounds[FRAME_BOUND_MAX_Y]) * 3 / 4;
|
||||||
|
|
||||||
|
@ -552,7 +552,7 @@ int16_t ShardGun(
|
||||||
{
|
{
|
||||||
int16_t fx_num = CreateEffect(room_num);
|
int16_t fx_num = CreateEffect(room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->room_number = room_num;
|
fx->room_number = room_num;
|
||||||
fx->pos.x = x;
|
fx->pos.x = x;
|
||||||
fx->pos.y = y;
|
fx->pos.y = y;
|
||||||
|
@ -575,7 +575,7 @@ int16_t RocketGun(
|
||||||
{
|
{
|
||||||
int16_t fx_num = CreateEffect(room_num);
|
int16_t fx_num = CreateEffect(room_num);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->room_number = room_num;
|
fx->room_number = room_num;
|
||||||
fx->pos.x = x;
|
fx->pos.x = x;
|
||||||
fx->pos.y = y;
|
fx->pos.y = y;
|
||||||
|
@ -594,16 +594,16 @@ int16_t RocketGun(
|
||||||
|
|
||||||
void InitialiseMummy(int16_t item_num)
|
void InitialiseMummy(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
item->touch_bits = 0;
|
item->touch_bits = 0;
|
||||||
item->mesh_bits = 0xFFFF87FF;
|
item->mesh_bits = 0xFFFF87FF;
|
||||||
item->data = game_malloc(sizeof(int16_t), GBUF_MUMMY_HEAD_TURN);
|
item->data = game_malloc(sizeof(int16_t), GBUF_MUMMY_HEAD_TURN);
|
||||||
*(int16_t*)item->data = 0;
|
*(int16_t *)item->data = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MummyControl(int16_t item_num)
|
void MummyControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
int16_t head = 0;
|
int16_t head = 0;
|
||||||
|
|
||||||
if (item->current_anim_state == MUMMY_STOP) {
|
if (item->current_anim_state == MUMMY_STOP) {
|
||||||
|
@ -628,11 +628,11 @@ void MummyControl(int16_t item_num)
|
||||||
|
|
||||||
int32_t ExplodingDeath(int16_t item_num, int32_t mesh_bits, int16_t damage)
|
int32_t ExplodingDeath(int16_t item_num, int32_t mesh_bits, int16_t damage)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
OBJECT_INFO* object = &Objects[item->object_number];
|
OBJECT_INFO *object = &Objects[item->object_number];
|
||||||
int32_t abortion = item->object_number == O_ABORTION;
|
int32_t abortion = item->object_number == O_ABORTION;
|
||||||
|
|
||||||
int16_t* frame = GetBestFrame(item);
|
int16_t *frame = GetBestFrame(item);
|
||||||
|
|
||||||
phd_PushUnitMatrix();
|
phd_PushUnitMatrix();
|
||||||
PhdMatrixPtr->_03 = 0;
|
PhdMatrixPtr->_03 = 0;
|
||||||
|
@ -643,10 +643,10 @@ int32_t ExplodingDeath(int16_t item_num, int32_t mesh_bits, int16_t damage)
|
||||||
phd_TranslateRel(
|
phd_TranslateRel(
|
||||||
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
frame[FRAME_POS_X], frame[FRAME_POS_Y], frame[FRAME_POS_Z]);
|
||||||
|
|
||||||
int32_t* packed_rotation = (int32_t*)(frame + FRAME_ROT);
|
int32_t *packed_rotation = (int32_t *)(frame + FRAME_ROT);
|
||||||
phd_RotYXZpack(*packed_rotation++);
|
phd_RotYXZpack(*packed_rotation++);
|
||||||
|
|
||||||
int32_t* bone = &AnimBones[object->bone_index];
|
int32_t *bone = &AnimBones[object->bone_index];
|
||||||
#if 0
|
#if 0
|
||||||
// NOTE: present in OG, removed by GLrage on the grounds that it sometimes
|
// NOTE: present in OG, removed by GLrage on the grounds that it sometimes
|
||||||
// crashes.
|
// crashes.
|
||||||
|
@ -657,7 +657,7 @@ int32_t ExplodingDeath(int16_t item_num, int32_t mesh_bits, int16_t damage)
|
||||||
if ((bit & mesh_bits) && (bit & item->mesh_bits)) {
|
if ((bit & mesh_bits) && (bit & item->mesh_bits)) {
|
||||||
int16_t fx_num = CreateEffect(item->room_number);
|
int16_t fx_num = CreateEffect(item->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->room_number = item->room_number;
|
fx->room_number = item->room_number;
|
||||||
fx->pos.x = (PhdMatrixPtr->_03 >> W2V_SHIFT) + item->pos.x;
|
fx->pos.x = (PhdMatrixPtr->_03 >> W2V_SHIFT) + item->pos.x;
|
||||||
fx->pos.y = (PhdMatrixPtr->_13 >> W2V_SHIFT) + item->pos.y;
|
fx->pos.y = (PhdMatrixPtr->_13 >> W2V_SHIFT) + item->pos.y;
|
||||||
|
@ -709,7 +709,7 @@ int32_t ExplodingDeath(int16_t item_num, int32_t mesh_bits, int16_t damage)
|
||||||
if ((bit & mesh_bits) && (bit & item->mesh_bits)) {
|
if ((bit & mesh_bits) && (bit & item->mesh_bits)) {
|
||||||
int16_t fx_num = CreateEffect(item->room_number);
|
int16_t fx_num = CreateEffect(item->room_number);
|
||||||
if (fx_num != NO_ITEM) {
|
if (fx_num != NO_ITEM) {
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->room_number = item->room_number;
|
fx->room_number = item->room_number;
|
||||||
fx->pos.x = (PhdMatrixPtr->_03 >> W2V_SHIFT) + item->pos.x;
|
fx->pos.x = (PhdMatrixPtr->_03 >> W2V_SHIFT) + item->pos.x;
|
||||||
fx->pos.y = (PhdMatrixPtr->_13 >> W2V_SHIFT) + item->pos.y;
|
fx->pos.y = (PhdMatrixPtr->_13 >> W2V_SHIFT) + item->pos.y;
|
||||||
|
@ -739,7 +739,7 @@ int32_t ExplodingDeath(int16_t item_num, int32_t mesh_bits, int16_t damage)
|
||||||
|
|
||||||
void ControlBodyPart(int16_t fx_num)
|
void ControlBodyPart(int16_t fx_num)
|
||||||
{
|
{
|
||||||
FX_INFO* fx = &Effects[fx_num];
|
FX_INFO *fx = &Effects[fx_num];
|
||||||
fx->pos.x_rot += 5 * PHD_DEGREE;
|
fx->pos.x_rot += 5 * PHD_DEGREE;
|
||||||
fx->pos.z_rot += 10 * PHD_DEGREE;
|
fx->pos.z_rot += 10 * PHD_DEGREE;
|
||||||
fx->pos.z += (fx->speed * phd_cos(fx->pos.y_rot)) >> W2V_SHIFT;
|
fx->pos.z += (fx->speed * phd_cos(fx->pos.y_rot)) >> W2V_SHIFT;
|
||||||
|
@ -748,7 +748,7 @@ void ControlBodyPart(int16_t fx_num)
|
||||||
fx->pos.y += fx->fall_speed;
|
fx->pos.y += fx->fall_speed;
|
||||||
|
|
||||||
int16_t room_num = fx->room_number;
|
int16_t room_num = fx->room_number;
|
||||||
FLOOR_INFO* floor = GetFloor(fx->pos.x, fx->pos.y, fx->pos.z, &room_num);
|
FLOOR_INFO *floor = GetFloor(fx->pos.x, fx->pos.y, fx->pos.z, &room_num);
|
||||||
|
|
||||||
int32_t ceiling = GetCeiling(floor, fx->pos.x, fx->pos.y, fx->pos.z);
|
int32_t ceiling = GetCeiling(floor, fx->pos.x, fx->pos.y, fx->pos.z);
|
||||||
if (fx->pos.y < ceiling) {
|
if (fx->pos.y < ceiling) {
|
||||||
|
@ -795,11 +795,11 @@ void ControlBodyPart(int16_t fx_num)
|
||||||
|
|
||||||
void InitialisePod(int16_t item_num)
|
void InitialisePod(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
int16_t bug_item_num = CreateItem();
|
int16_t bug_item_num = CreateItem();
|
||||||
if (bug_item_num != NO_ITEM) {
|
if (bug_item_num != NO_ITEM) {
|
||||||
ITEM_INFO* bug = &Items[bug_item_num];
|
ITEM_INFO *bug = &Items[bug_item_num];
|
||||||
|
|
||||||
switch ((item->flags & IF_CODE_BITS) >> 9) {
|
switch ((item->flags & IF_CODE_BITS) >> 9) {
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -830,7 +830,7 @@ void InitialisePod(int16_t item_num)
|
||||||
InitialiseItem(bug_item_num);
|
InitialiseItem(bug_item_num);
|
||||||
|
|
||||||
item->data = game_malloc(sizeof(int16_t), 0);
|
item->data = game_malloc(sizeof(int16_t), 0);
|
||||||
*(int16_t*)item->data = bug_item_num;
|
*(int16_t *)item->data = bug_item_num;
|
||||||
|
|
||||||
LevelItemCount++;
|
LevelItemCount++;
|
||||||
}
|
}
|
||||||
|
@ -841,7 +841,7 @@ void InitialisePod(int16_t item_num)
|
||||||
|
|
||||||
void PodControl(int16_t item_num)
|
void PodControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->goal_anim_state != POD_EXPLODE) {
|
if (item->goal_anim_state != POD_EXPLODE) {
|
||||||
int32_t explode = 0;
|
int32_t explode = 0;
|
||||||
|
@ -866,8 +866,8 @@ void PodControl(int16_t item_num)
|
||||||
item->collidable = 0;
|
item->collidable = 0;
|
||||||
ExplodingDeath(item_num, 0xFFFE00, 0);
|
ExplodingDeath(item_num, 0xFFFE00, 0);
|
||||||
|
|
||||||
int16_t bug_item_num = *(int16_t*)item->data;
|
int16_t bug_item_num = *(int16_t *)item->data;
|
||||||
ITEM_INFO* bug = &Items[bug_item_num];
|
ITEM_INFO *bug = &Items[bug_item_num];
|
||||||
bug->touch_bits = 0;
|
bug->touch_bits = 0;
|
||||||
AddActiveItem(bug_item_num);
|
AddActiveItem(bug_item_num);
|
||||||
if (EnableBaddieAI(bug_item_num, 0)) {
|
if (EnableBaddieAI(bug_item_num, 0)) {
|
||||||
|
@ -883,7 +883,7 @@ void PodControl(int16_t item_num)
|
||||||
|
|
||||||
void InitialiseStatue(int16_t item_num)
|
void InitialiseStatue(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
int16_t centaur_item_num = CreateItem();
|
int16_t centaur_item_num = CreateItem();
|
||||||
if (centaur_item_num == NO_ITEM) {
|
if (centaur_item_num == NO_ITEM) {
|
||||||
|
@ -891,7 +891,7 @@ void InitialiseStatue(int16_t item_num)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ITEM_INFO* centaur = &Items[centaur_item_num];
|
ITEM_INFO *centaur = &Items[centaur_item_num];
|
||||||
centaur->object_number = O_CENTAUR;
|
centaur->object_number = O_CENTAUR;
|
||||||
centaur->room_number = item->room_number;
|
centaur->room_number = item->room_number;
|
||||||
centaur->pos.x = item->pos.x;
|
centaur->pos.x = item->pos.x;
|
||||||
|
@ -910,14 +910,14 @@ void InitialiseStatue(int16_t item_num)
|
||||||
centaur->pos.y_rot = item->pos.y_rot;
|
centaur->pos.y_rot = item->pos.y_rot;
|
||||||
|
|
||||||
item->data = game_malloc(sizeof(int16_t), 0);
|
item->data = game_malloc(sizeof(int16_t), 0);
|
||||||
*(int16_t*)item->data = centaur_item_num;
|
*(int16_t *)item->data = centaur_item_num;
|
||||||
|
|
||||||
LevelItemCount++;
|
LevelItemCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatueControl(int16_t item_num)
|
void StatueControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
int32_t x = LaraItem->pos.x - item->pos.x;
|
int32_t x = LaraItem->pos.x - item->pos.x;
|
||||||
int32_t y = LaraItem->pos.y - item->pos.y;
|
int32_t y = LaraItem->pos.y - item->pos.y;
|
||||||
int32_t z = LaraItem->pos.z - item->pos.z;
|
int32_t z = LaraItem->pos.z - item->pos.z;
|
||||||
|
@ -928,8 +928,8 @@ void StatueControl(int16_t item_num)
|
||||||
KillItem(item_num);
|
KillItem(item_num);
|
||||||
item->status = IS_DEACTIVATED;
|
item->status = IS_DEACTIVATED;
|
||||||
|
|
||||||
int16_t centaur_item_num = *(int16_t*)item->data;
|
int16_t centaur_item_num = *(int16_t *)item->data;
|
||||||
ITEM_INFO* centaur = &Items[centaur_item_num];
|
ITEM_INFO *centaur = &Items[centaur_item_num];
|
||||||
centaur->touch_bits = 0;
|
centaur->touch_bits = 0;
|
||||||
AddActiveItem(centaur_item_num);
|
AddActiveItem(centaur_item_num);
|
||||||
EnableBaddieAI(centaur_item_num, 1);
|
EnableBaddieAI(centaur_item_num, 1);
|
||||||
|
|
|
@ -9,7 +9,7 @@ void InitialiseWarrior2(int16_t item_num);
|
||||||
void FlyerControl(int16_t item_num);
|
void FlyerControl(int16_t item_num);
|
||||||
|
|
||||||
void ControlMissile(int16_t fx_num);
|
void ControlMissile(int16_t fx_num);
|
||||||
void ShootAtLara(FX_INFO* fx);
|
void ShootAtLara(FX_INFO *fx);
|
||||||
int16_t ShardGun(
|
int16_t ShardGun(
|
||||||
int32_t x, int32_t y, int32_t z, int16_t speed, PHD_ANGLE y_rot,
|
int32_t x, int32_t y, int32_t z, int16_t speed, PHD_ANGLE y_rot,
|
||||||
int16_t room_num);
|
int16_t room_num);
|
||||||
|
|
|
@ -71,7 +71,7 @@ void InitialiseWolf(int16_t item_num)
|
||||||
|
|
||||||
void WolfControl(int16_t item_num)
|
void WolfControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -80,7 +80,7 @@ void WolfControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* wolf = item->data;
|
CREATURE_INFO *wolf = 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;
|
||||||
|
@ -227,7 +227,7 @@ void WolfControl(int16_t item_num)
|
||||||
|
|
||||||
void LionControl(int16_t item_num)
|
void LionControl(int16_t item_num)
|
||||||
{
|
{
|
||||||
ITEM_INFO* item = &Items[item_num];
|
ITEM_INFO *item = &Items[item_num];
|
||||||
|
|
||||||
if (item->status == IS_INVISIBLE) {
|
if (item->status == IS_INVISIBLE) {
|
||||||
if (!EnableBaddieAI(item_num, 0)) {
|
if (!EnableBaddieAI(item_num, 0)) {
|
||||||
|
@ -236,7 +236,7 @@ void LionControl(int16_t item_num)
|
||||||
item->status = IS_ACTIVE;
|
item->status = IS_ACTIVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CREATURE_INFO* lion = item->data;
|
CREATURE_INFO *lion = 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;
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -132,7 +132,7 @@ enum json_parse_flags_e {
|
||||||
/* Parse a JSON text file, returning a pointer to the root of the JSON
|
/* Parse a JSON text file, returning a pointer to the root of the JSON
|
||||||
* structure. json_parse performs 1 call to malloc for the entire encoding.
|
* structure. json_parse performs 1 call to malloc for the entire encoding.
|
||||||
* Returns 0 if an error occurred (malformed JSON input, or malloc failed). */
|
* Returns 0 if an error occurred (malformed JSON input, or malloc failed). */
|
||||||
struct json_value_s* json_parse(const void* src, size_t src_size);
|
struct json_value_s *json_parse(const void *src, size_t src_size);
|
||||||
|
|
||||||
/* Parse a JSON text file, returning a pointer to the root of the JSON
|
/* Parse a JSON text file, returning a pointer to the root of the JSON
|
||||||
* structure. json_parse performs 1 call to alloc_func_ptr for the entire
|
* structure. json_parse performs 1 call to alloc_func_ptr for the entire
|
||||||
|
@ -140,29 +140,29 @@ struct json_value_s* json_parse(const void* src, size_t src_size);
|
||||||
* failed). If an error occurred, the result struct (if not NULL) will explain
|
* failed). If an error occurred, the result struct (if not NULL) will explain
|
||||||
* the type of error, and the location in the input it occurred. If
|
* the type of error, and the location in the input it occurred. If
|
||||||
* alloc_func_ptr is null then malloc is used. */
|
* alloc_func_ptr is null then malloc is used. */
|
||||||
struct json_value_s* json_parse_ex(
|
struct json_value_s *json_parse_ex(
|
||||||
const void* src, size_t src_size, size_t flags_bitset,
|
const void *src, size_t src_size, size_t flags_bitset,
|
||||||
void* (*alloc_func_ptr)(void*, size_t), void* user_data,
|
void *(*alloc_func_ptr)(void *, size_t), void *user_data,
|
||||||
struct json_parse_result_s* result);
|
struct json_parse_result_s *result);
|
||||||
|
|
||||||
/* Extracts a value and all the data that makes it up into a newly created
|
/* Extracts a value and all the data that makes it up into a newly created
|
||||||
* value. json_extract_value performs 1 call to malloc for the entire encoding.
|
* value. json_extract_value performs 1 call to malloc for the entire encoding.
|
||||||
*/
|
*/
|
||||||
struct json_value_s* json_extract_value(const struct json_value_s* value);
|
struct json_value_s *json_extract_value(const struct json_value_s *value);
|
||||||
|
|
||||||
/* Extracts a value and all the data that makes it up into a newly created
|
/* Extracts a value and all the data that makes it up into a newly created
|
||||||
* value. json_extract_value performs 1 call to alloc_func_ptr for the entire
|
* value. json_extract_value performs 1 call to alloc_func_ptr for the entire
|
||||||
* encoding. If alloc_func_ptr is null then malloc is used. */
|
* encoding. If alloc_func_ptr is null then malloc is used. */
|
||||||
struct json_value_s* json_extract_value_ex(
|
struct json_value_s *json_extract_value_ex(
|
||||||
const struct json_value_s* value, void* (*alloc_func_ptr)(void*, size_t),
|
const struct json_value_s *value, void *(*alloc_func_ptr)(void *, size_t),
|
||||||
void* user_data);
|
void *user_data);
|
||||||
|
|
||||||
/* Write out a minified JSON utf-8 string. This string is an encoding of the
|
/* Write out a minified JSON utf-8 string. This string is an encoding of the
|
||||||
* minimal string characters required to still encode the same data.
|
* minimal string characters required to still encode the same data.
|
||||||
* json_write_minified performs 1 call to malloc for the entire encoding. Return
|
* json_write_minified performs 1 call to malloc for the entire encoding. Return
|
||||||
* 0 if an error occurred (malformed JSON input, or malloc failed). The out_size
|
* 0 if an error occurred (malformed JSON input, or malloc failed). The out_size
|
||||||
* parameter is optional as the utf-8 string is null terminated. */
|
* parameter is optional as the utf-8 string is null terminated. */
|
||||||
void* json_write_minified(const struct json_value_s* value, size_t* out_size);
|
void *json_write_minified(const struct json_value_s *value, size_t *out_size);
|
||||||
|
|
||||||
/* Write out a pretty JSON utf-8 string. This string is encoded such that the
|
/* Write out a pretty JSON utf-8 string. This string is encoded such that the
|
||||||
* resultant JSON is pretty in that it is easily human readable. The indent and
|
* resultant JSON is pretty in that it is easily human readable. The indent and
|
||||||
|
@ -173,34 +173,34 @@ void* json_write_minified(const struct json_value_s* value, size_t* out_size);
|
||||||
* json_write_pretty performs 1 call to malloc for the entire encoding. Return 0
|
* json_write_pretty performs 1 call to malloc for the entire encoding. Return 0
|
||||||
* if an error occurred (malformed JSON input, or malloc failed). The out_size
|
* if an error occurred (malformed JSON input, or malloc failed). The out_size
|
||||||
* parameter is optional as the utf-8 string is null terminated. */
|
* parameter is optional as the utf-8 string is null terminated. */
|
||||||
void* json_write_pretty(
|
void *json_write_pretty(
|
||||||
const struct json_value_s* value, const char* indent, const char* newline,
|
const struct json_value_s *value, const char *indent, const char *newline,
|
||||||
size_t* out_size);
|
size_t *out_size);
|
||||||
|
|
||||||
/* Reinterpret a JSON value as a string. Returns null is the value was not a
|
/* Reinterpret a JSON value as a string. Returns null is the value was not a
|
||||||
* string. */
|
* string. */
|
||||||
struct json_string_s* json_value_as_string(struct json_value_s* const value);
|
struct json_string_s *json_value_as_string(struct json_value_s *const value);
|
||||||
|
|
||||||
/* Reinterpret a JSON value as a number. Returns null is the value was not a
|
/* Reinterpret a JSON value as a number. Returns null is the value was not a
|
||||||
* number. */
|
* number. */
|
||||||
struct json_number_s* json_value_as_number(struct json_value_s* const value);
|
struct json_number_s *json_value_as_number(struct json_value_s *const value);
|
||||||
|
|
||||||
/* Reinterpret a JSON value as an object. Returns null is the value was not an
|
/* Reinterpret a JSON value as an object. Returns null is the value was not an
|
||||||
* object. */
|
* object. */
|
||||||
struct json_object_s* json_value_as_object(struct json_value_s* const value);
|
struct json_object_s *json_value_as_object(struct json_value_s *const value);
|
||||||
|
|
||||||
/* Reinterpret a JSON value as an array. Returns null is the value was not an
|
/* Reinterpret a JSON value as an array. Returns null is the value was not an
|
||||||
* array. */
|
* array. */
|
||||||
struct json_array_s* json_value_as_array(struct json_value_s* const value);
|
struct json_array_s *json_value_as_array(struct json_value_s *const value);
|
||||||
|
|
||||||
/* Whether the value is true. */
|
/* Whether the value is true. */
|
||||||
int json_value_is_true(const struct json_value_s* const value);
|
int json_value_is_true(const struct json_value_s *const value);
|
||||||
|
|
||||||
/* Whether the value is false. */
|
/* Whether the value is false. */
|
||||||
int json_value_is_false(const struct json_value_s* const value);
|
int json_value_is_false(const struct json_value_s *const value);
|
||||||
|
|
||||||
/* Whether the value is null. */
|
/* Whether the value is null. */
|
||||||
int json_value_is_null(const struct json_value_s* const value);
|
int json_value_is_null(const struct json_value_s *const value);
|
||||||
|
|
||||||
/* The various types JSON values can be. Used to identify what a value is. */
|
/* The various types JSON values can be. Used to identify what a value is. */
|
||||||
enum json_type_e {
|
enum json_type_e {
|
||||||
|
@ -216,7 +216,7 @@ enum json_type_e {
|
||||||
/* A JSON string value. */
|
/* A JSON string value. */
|
||||||
struct json_string_s {
|
struct json_string_s {
|
||||||
/* utf-8 string */
|
/* utf-8 string */
|
||||||
const char* string;
|
const char *string;
|
||||||
/* The size (in bytes) of the string */
|
/* The size (in bytes) of the string */
|
||||||
size_t string_size;
|
size_t string_size;
|
||||||
};
|
};
|
||||||
|
@ -239,7 +239,7 @@ struct json_string_ex_s {
|
||||||
/* A JSON number value. */
|
/* A JSON number value. */
|
||||||
struct json_number_s {
|
struct json_number_s {
|
||||||
/* ASCII string containing representation of the number. */
|
/* ASCII string containing representation of the number. */
|
||||||
const char* number;
|
const char *number;
|
||||||
/* the size (in bytes) of the number. */
|
/* the size (in bytes) of the number. */
|
||||||
size_t number_size;
|
size_t number_size;
|
||||||
};
|
};
|
||||||
|
@ -247,18 +247,18 @@ struct json_number_s {
|
||||||
/* an element of a JSON object. */
|
/* an element of a JSON object. */
|
||||||
struct json_object_element_s {
|
struct json_object_element_s {
|
||||||
/* the name of this element. */
|
/* the name of this element. */
|
||||||
struct json_string_s* name;
|
struct json_string_s *name;
|
||||||
/* the value of this element. */
|
/* the value of this element. */
|
||||||
struct json_value_s* value;
|
struct json_value_s *value;
|
||||||
/* the next object element (can be NULL if the last element in the object).
|
/* the next object element (can be NULL if the last element in the object).
|
||||||
*/
|
*/
|
||||||
struct json_object_element_s* next;
|
struct json_object_element_s *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* a JSON object value. */
|
/* a JSON object value. */
|
||||||
struct json_object_s {
|
struct json_object_s {
|
||||||
/* a linked list of the elements in the object. */
|
/* a linked list of the elements in the object. */
|
||||||
struct json_object_element_s* start;
|
struct json_object_element_s *start;
|
||||||
/* the number of elements in the object. */
|
/* the number of elements in the object. */
|
||||||
size_t length;
|
size_t length;
|
||||||
};
|
};
|
||||||
|
@ -266,15 +266,15 @@ struct json_object_s {
|
||||||
/* an element of a JSON array. */
|
/* an element of a JSON array. */
|
||||||
struct json_array_element_s {
|
struct json_array_element_s {
|
||||||
/* the value of this element. */
|
/* the value of this element. */
|
||||||
struct json_value_s* value;
|
struct json_value_s *value;
|
||||||
/* the next array element (can be NULL if the last element in the array). */
|
/* the next array element (can be NULL if the last element in the array). */
|
||||||
struct json_array_element_s* next;
|
struct json_array_element_s *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* a JSON array value. */
|
/* a JSON array value. */
|
||||||
struct json_array_s {
|
struct json_array_s {
|
||||||
/* a linked list of the elements in the array. */
|
/* a linked list of the elements in the array. */
|
||||||
struct json_array_element_s* start;
|
struct json_array_element_s *start;
|
||||||
/* the number of elements in the array. */
|
/* the number of elements in the array. */
|
||||||
size_t length;
|
size_t length;
|
||||||
};
|
};
|
||||||
|
@ -286,7 +286,7 @@ struct json_value_s {
|
||||||
* what.
|
* what.
|
||||||
*/
|
*/
|
||||||
/* the type of this value is. */
|
/* the type of this value is. */
|
||||||
void* payload;
|
void *payload;
|
||||||
/* must be one of json_type_e. If type is json_type_true, json_type_false,
|
/* must be one of json_type_e. If type is json_type_true, json_type_false,
|
||||||
* or.
|
* or.
|
||||||
*/
|
*/
|
||||||
|
@ -430,12 +430,12 @@ struct json_parse_result_s {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct json_parse_state_s {
|
struct json_parse_state_s {
|
||||||
const char* src;
|
const char *src;
|
||||||
size_t size;
|
size_t size;
|
||||||
size_t offset;
|
size_t offset;
|
||||||
size_t flags_bitset;
|
size_t flags_bitset;
|
||||||
char* data;
|
char *data;
|
||||||
char* dom;
|
char *dom;
|
||||||
size_t dom_size;
|
size_t dom_size;
|
||||||
size_t data_size;
|
size_t data_size;
|
||||||
size_t line_no; /* line counter for error reporting. */
|
size_t line_no; /* line counter for error reporting. */
|
||||||
|
@ -447,149 +447,149 @@ struct json_parse_state_s {
|
||||||
int json_hexadecimal_digit(const char c);
|
int json_hexadecimal_digit(const char c);
|
||||||
|
|
||||||
int json_hexadecimal_value(
|
int json_hexadecimal_value(
|
||||||
const char* c, const unsigned long size, unsigned long* result);
|
const char *c, const unsigned long size, unsigned long *result);
|
||||||
|
|
||||||
int json_skip_whitespace(struct json_parse_state_s* state);
|
int json_skip_whitespace(struct json_parse_state_s *state);
|
||||||
|
|
||||||
int json_skip_c_style_comments(struct json_parse_state_s* state);
|
int json_skip_c_style_comments(struct json_parse_state_s *state);
|
||||||
|
|
||||||
int json_skip_all_skippables(struct json_parse_state_s* state);
|
int json_skip_all_skippables(struct json_parse_state_s *state);
|
||||||
|
|
||||||
int json_get_value_size(struct json_parse_state_s* state, int is_global_object);
|
int json_get_value_size(struct json_parse_state_s *state, int is_global_object);
|
||||||
|
|
||||||
int json_get_string_size(struct json_parse_state_s* state, size_t is_key);
|
int json_get_string_size(struct json_parse_state_s *state, size_t is_key);
|
||||||
|
|
||||||
int is_valid_unquoted_key_char(const char c);
|
int is_valid_unquoted_key_char(const char c);
|
||||||
|
|
||||||
int json_get_key_size(struct json_parse_state_s* state);
|
int json_get_key_size(struct json_parse_state_s *state);
|
||||||
|
|
||||||
int json_get_object_size(
|
int json_get_object_size(
|
||||||
struct json_parse_state_s* state, int is_global_object);
|
struct json_parse_state_s *state, int is_global_object);
|
||||||
|
|
||||||
int json_get_array_size(struct json_parse_state_s* state);
|
int json_get_array_size(struct json_parse_state_s *state);
|
||||||
|
|
||||||
int json_get_number_size(struct json_parse_state_s* state);
|
int json_get_number_size(struct json_parse_state_s *state);
|
||||||
|
|
||||||
int json_get_value_size(struct json_parse_state_s* state, int is_global_object);
|
int json_get_value_size(struct json_parse_state_s *state, int is_global_object);
|
||||||
|
|
||||||
void json_parse_value(
|
void json_parse_value(
|
||||||
struct json_parse_state_s* state, int is_global_object,
|
struct json_parse_state_s *state, int is_global_object,
|
||||||
struct json_value_s* value);
|
struct json_value_s *value);
|
||||||
|
|
||||||
void json_parse_string(
|
void json_parse_string(
|
||||||
struct json_parse_state_s* state, struct json_string_s* string);
|
struct json_parse_state_s *state, struct json_string_s *string);
|
||||||
|
|
||||||
void json_parse_key(
|
void json_parse_key(
|
||||||
struct json_parse_state_s* state, struct json_string_s* string);
|
struct json_parse_state_s *state, struct json_string_s *string);
|
||||||
|
|
||||||
void json_parse_object(
|
void json_parse_object(
|
||||||
struct json_parse_state_s* state, int is_global_object,
|
struct json_parse_state_s *state, int is_global_object,
|
||||||
struct json_object_s* object);
|
struct json_object_s *object);
|
||||||
|
|
||||||
void json_parse_array(
|
void json_parse_array(
|
||||||
struct json_parse_state_s* state, struct json_array_s* array);
|
struct json_parse_state_s *state, struct json_array_s *array);
|
||||||
|
|
||||||
void json_parse_number(
|
void json_parse_number(
|
||||||
struct json_parse_state_s* state, struct json_number_s* number);
|
struct json_parse_state_s *state, struct json_number_s *number);
|
||||||
|
|
||||||
void json_parse_value(
|
void json_parse_value(
|
||||||
struct json_parse_state_s* state, int is_global_object,
|
struct json_parse_state_s *state, int is_global_object,
|
||||||
struct json_value_s* value);
|
struct json_value_s *value);
|
||||||
|
|
||||||
struct json_value_s* json_parse_ex(
|
struct json_value_s *json_parse_ex(
|
||||||
const void* src, size_t src_size, size_t flags_bitset,
|
const void *src, size_t src_size, size_t flags_bitset,
|
||||||
void* (*alloc_func_ptr)(void* user_data, size_t size), void* user_data,
|
void *(*alloc_func_ptr)(void *user_data, size_t size), void *user_data,
|
||||||
struct json_parse_result_s* result);
|
struct json_parse_result_s *result);
|
||||||
|
|
||||||
struct json_extract_result_s {
|
struct json_extract_result_s {
|
||||||
size_t dom_size;
|
size_t dom_size;
|
||||||
size_t data_size;
|
size_t data_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct json_value_s* json_extract_value(const struct json_value_s* value);
|
struct json_value_s *json_extract_value(const struct json_value_s *value);
|
||||||
|
|
||||||
struct json_extract_result_s
|
struct json_extract_result_s
|
||||||
json_extract_get_number_size(const struct json_number_s* const number);
|
json_extract_get_number_size(const struct json_number_s *const number);
|
||||||
struct json_extract_result_s
|
struct json_extract_result_s
|
||||||
json_extract_get_string_size(const struct json_string_s* const string);
|
json_extract_get_string_size(const struct json_string_s *const string);
|
||||||
struct json_extract_result_s
|
struct json_extract_result_s
|
||||||
json_extract_get_object_size(const struct json_object_s* const object);
|
json_extract_get_object_size(const struct json_object_s *const object);
|
||||||
struct json_extract_result_s
|
struct json_extract_result_s
|
||||||
json_extract_get_array_size(const struct json_array_s* const array);
|
json_extract_get_array_size(const struct json_array_s *const array);
|
||||||
struct json_extract_result_s
|
struct json_extract_result_s
|
||||||
json_extract_get_value_size(const struct json_value_s* const value);
|
json_extract_get_value_size(const struct json_value_s *const value);
|
||||||
|
|
||||||
struct json_extract_state_s {
|
struct json_extract_state_s {
|
||||||
char* dom;
|
char *dom;
|
||||||
char* data;
|
char *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
void json_extract_copy_value(
|
void json_extract_copy_value(
|
||||||
struct json_extract_state_s* const state,
|
struct json_extract_state_s *const state,
|
||||||
const struct json_value_s* const value);
|
const struct json_value_s *const value);
|
||||||
|
|
||||||
int json_write_minified_get_value_size(
|
int json_write_minified_get_value_size(
|
||||||
const struct json_value_s* value, size_t* size);
|
const struct json_value_s *value, size_t *size);
|
||||||
|
|
||||||
int json_write_get_number_size(
|
int json_write_get_number_size(
|
||||||
const struct json_number_s* number, size_t* size);
|
const struct json_number_s *number, size_t *size);
|
||||||
|
|
||||||
int json_write_get_string_size(
|
int json_write_get_string_size(
|
||||||
const struct json_string_s* string, size_t* size);
|
const struct json_string_s *string, size_t *size);
|
||||||
|
|
||||||
int json_write_minified_get_array_size(
|
int json_write_minified_get_array_size(
|
||||||
const struct json_array_s* array, size_t* size);
|
const struct json_array_s *array, size_t *size);
|
||||||
|
|
||||||
int json_write_minified_get_object_size(
|
int json_write_minified_get_object_size(
|
||||||
const struct json_object_s* object, size_t* size);
|
const struct json_object_s *object, size_t *size);
|
||||||
|
|
||||||
int json_write_minified_get_value_size(
|
int json_write_minified_get_value_size(
|
||||||
const struct json_value_s* value, size_t* size);
|
const struct json_value_s *value, size_t *size);
|
||||||
|
|
||||||
char* json_write_minified_value(const struct json_value_s* value, char* data);
|
char *json_write_minified_value(const struct json_value_s *value, char *data);
|
||||||
|
|
||||||
char* json_write_number(const struct json_number_s* number, char* data);
|
char *json_write_number(const struct json_number_s *number, char *data);
|
||||||
|
|
||||||
char* json_write_string(const struct json_string_s* string, char* data);
|
char *json_write_string(const struct json_string_s *string, char *data);
|
||||||
|
|
||||||
char* json_write_minified_array(const struct json_array_s* array, char* data);
|
char *json_write_minified_array(const struct json_array_s *array, char *data);
|
||||||
|
|
||||||
char* json_write_minified_object(
|
char *
|
||||||
const struct json_object_s* object, char* data);
|
json_write_minified_object(const struct json_object_s *object, char *data);
|
||||||
|
|
||||||
char* json_write_minified_value(const struct json_value_s* value, char* data);
|
char *json_write_minified_value(const struct json_value_s *value, char *data);
|
||||||
|
|
||||||
int json_write_pretty_get_value_size(
|
int json_write_pretty_get_value_size(
|
||||||
const struct json_value_s* value, size_t depth, size_t indent_size,
|
const struct json_value_s *value, size_t depth, size_t indent_size,
|
||||||
size_t newline_size, size_t* size);
|
size_t newline_size, size_t *size);
|
||||||
|
|
||||||
int json_write_pretty_get_array_size(
|
int json_write_pretty_get_array_size(
|
||||||
const struct json_array_s* array, size_t depth, size_t indent_size,
|
const struct json_array_s *array, size_t depth, size_t indent_size,
|
||||||
size_t newline_size, size_t* size);
|
size_t newline_size, size_t *size);
|
||||||
|
|
||||||
int json_write_pretty_get_object_size(
|
int json_write_pretty_get_object_size(
|
||||||
const struct json_object_s* object, size_t depth, size_t indent_size,
|
const struct json_object_s *object, size_t depth, size_t indent_size,
|
||||||
size_t newline_size, size_t* size);
|
size_t newline_size, size_t *size);
|
||||||
|
|
||||||
int json_write_pretty_get_value_size(
|
int json_write_pretty_get_value_size(
|
||||||
const struct json_value_s* value, size_t depth, size_t indent_size,
|
const struct json_value_s *value, size_t depth, size_t indent_size,
|
||||||
size_t newline_size, size_t* size);
|
size_t newline_size, size_t *size);
|
||||||
|
|
||||||
char* json_write_pretty_value(
|
char *json_write_pretty_value(
|
||||||
const struct json_value_s* value, size_t depth, const char* indent,
|
const struct json_value_s *value, size_t depth, const char *indent,
|
||||||
const char* newline, char* data);
|
const char *newline, char *data);
|
||||||
|
|
||||||
char* json_write_pretty_array(
|
char *json_write_pretty_array(
|
||||||
const struct json_array_s* array, size_t depth, const char* indent,
|
const struct json_array_s *array, size_t depth, const char *indent,
|
||||||
const char* newline, char* data);
|
const char *newline, char *data);
|
||||||
|
|
||||||
char* json_write_pretty_object(
|
char *json_write_pretty_object(
|
||||||
const struct json_object_s* object, size_t depth, const char* indent,
|
const struct json_object_s *object, size_t depth, const char *indent,
|
||||||
const char* newline, char* data);
|
const char *newline, char *data);
|
||||||
|
|
||||||
char* json_write_pretty_value(
|
char *json_write_pretty_value(
|
||||||
const struct json_value_s* value, size_t depth, const char* indent,
|
const struct json_value_s *value, size_t depth, const char *indent,
|
||||||
const char* newline, char* data);
|
const char *newline, char *data);
|
||||||
|
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#pragma clang diagnostic pop
|
#pragma clang diagnostic pop
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
struct json_value_s* JSONGetField(struct json_value_s* root, const char* name)
|
struct json_value_s *JSONGetField(struct json_value_s *root, const char *name)
|
||||||
{
|
{
|
||||||
if (root == NULL || root->type != json_type_object) {
|
if (root == NULL || root->type != json_type_object) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
struct json_object_s* object = json_value_as_object(root);
|
struct json_object_s *object = json_value_as_object(root);
|
||||||
struct json_object_element_s* item = object->start;
|
struct json_object_element_s *item = object->start;
|
||||||
while (item) {
|
while (item) {
|
||||||
if (!strcmp(item->name->string, name)) {
|
if (!strcmp(item->name->string, name)) {
|
||||||
return item->value;
|
return item->value;
|
||||||
|
@ -19,9 +19,9 @@ struct json_value_s* JSONGetField(struct json_value_s* root, const char* name)
|
||||||
}
|
}
|
||||||
|
|
||||||
int JSONGetBooleanValue(
|
int JSONGetBooleanValue(
|
||||||
struct json_value_s* root, const char* name, int8_t* value)
|
struct json_value_s *root, const char *name, int8_t *value)
|
||||||
{
|
{
|
||||||
struct json_value_s* field = JSONGetField(root, name);
|
struct json_value_s *field = JSONGetField(root, name);
|
||||||
if (!field
|
if (!field
|
||||||
|| (field->type != json_type_true && field->type != json_type_false)) {
|
|| (field->type != json_type_true && field->type != json_type_false)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -31,13 +31,13 @@ int JSONGetBooleanValue(
|
||||||
}
|
}
|
||||||
|
|
||||||
int JSONGetIntegerValue(
|
int JSONGetIntegerValue(
|
||||||
struct json_value_s* root, const char* name, int32_t* value)
|
struct json_value_s *root, const char *name, int32_t *value)
|
||||||
{
|
{
|
||||||
struct json_value_s* field = JSONGetField(root, name);
|
struct json_value_s *field = JSONGetField(root, name);
|
||||||
if (!field) {
|
if (!field) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
struct json_number_s* number = json_value_as_number(field);
|
struct json_number_s *number = json_value_as_number(field);
|
||||||
if (!number) {
|
if (!number) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -46,13 +46,13 @@ int JSONGetIntegerValue(
|
||||||
}
|
}
|
||||||
|
|
||||||
int JSONGetStringValue(
|
int JSONGetStringValue(
|
||||||
struct json_value_s* root, const char* name, const char** value)
|
struct json_value_s *root, const char *name, const char **value)
|
||||||
{
|
{
|
||||||
struct json_value_s* field = JSONGetField(root, name);
|
struct json_value_s *field = JSONGetField(root, name);
|
||||||
if (!field || field->type != json_type_string) {
|
if (!field || field->type != json_type_string) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
struct json_string_s* string = json_value_as_string(field);
|
struct json_string_s *string = json_value_as_string(field);
|
||||||
if (!string) {
|
if (!string) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
#include "json-parser/json.h"
|
#include "json-parser/json.h"
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
struct json_value_s* JSONGetField(struct json_value_s* root, const char* name);
|
struct json_value_s *JSONGetField(struct json_value_s *root, const char *name);
|
||||||
int JSONGetBooleanValue(
|
int JSONGetBooleanValue(
|
||||||
struct json_value_s* root, const char* name, int8_t* value);
|
struct json_value_s *root, const char *name, int8_t *value);
|
||||||
int JSONGetIntegerValue(
|
int JSONGetIntegerValue(
|
||||||
struct json_value_s* root, const char* name, int32_t* value);
|
struct json_value_s *root, const char *name, int32_t *value);
|
||||||
int JSONGetStringValue(
|
int JSONGetStringValue(
|
||||||
struct json_value_s* root, const char* name, const char** default_value);
|
struct json_value_s *root, const char *name, const char **default_value);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -26,16 +26,16 @@ int32_t SpriteInfoCount = 0;
|
||||||
int32_t SpriteCount = 0;
|
int32_t SpriteCount = 0;
|
||||||
int32_t OverlapCount = 0;
|
int32_t OverlapCount = 0;
|
||||||
|
|
||||||
int32_t LoadLevel(const char* filename, int32_t level_num)
|
int32_t LoadLevel(const char *filename, int32_t level_num)
|
||||||
{
|
{
|
||||||
int32_t version;
|
int32_t version;
|
||||||
int32_t file_level_num;
|
int32_t file_level_num;
|
||||||
|
|
||||||
const char* full_path = GetFullPath(filename);
|
const char *full_path = GetFullPath(filename);
|
||||||
TRACE("%s", full_path);
|
TRACE("%s", full_path);
|
||||||
|
|
||||||
init_game_malloc();
|
init_game_malloc();
|
||||||
FILE* fp = _fopen(full_path, "rb");
|
FILE *fp = _fopen(full_path, "rb");
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
sprintf(StringToShow, "S_LoadLevel(): Could not open %s", full_path);
|
sprintf(StringToShow, "S_LoadLevel(): Could not open %s", full_path);
|
||||||
S_ExitSystem(StringToShow);
|
S_ExitSystem(StringToShow);
|
||||||
|
@ -120,7 +120,7 @@ int32_t LoadLevel(const char* filename, int32_t level_num)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadRooms(FILE* fp)
|
int32_t LoadRooms(FILE *fp)
|
||||||
{
|
{
|
||||||
uint16_t count2;
|
uint16_t count2;
|
||||||
uint32_t count4;
|
uint32_t count4;
|
||||||
|
@ -139,7 +139,7 @@ int32_t LoadRooms(FILE* fp)
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (ROOM_INFO* current_room_info = RoomInfo; i < RoomCount;
|
for (ROOM_INFO *current_room_info = RoomInfo; i < RoomCount;
|
||||||
++i, ++current_room_info) {
|
++i, ++current_room_info) {
|
||||||
// Room position
|
// Room position
|
||||||
_fread(¤t_room_info->x, sizeof(uint32_t), 1, fp);
|
_fread(¤t_room_info->x, sizeof(uint32_t), 1, fp);
|
||||||
|
@ -226,7 +226,7 @@ int32_t LoadRooms(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadObjects(FILE* fp)
|
int32_t LoadObjects(FILE *fp)
|
||||||
{
|
{
|
||||||
_fread(&MeshCount, sizeof(int32_t), 1, fp);
|
_fread(&MeshCount, sizeof(int32_t), 1, fp);
|
||||||
TRACE("%d meshes", MeshCount);
|
TRACE("%d meshes", MeshCount);
|
||||||
|
@ -234,11 +234,11 @@ int32_t LoadObjects(FILE* fp)
|
||||||
_fread(MeshBase, sizeof(int16_t), MeshCount, fp);
|
_fread(MeshBase, sizeof(int16_t), MeshCount, fp);
|
||||||
|
|
||||||
_fread(&MeshPtrCount, sizeof(int32_t), 1, fp);
|
_fread(&MeshPtrCount, sizeof(int32_t), 1, fp);
|
||||||
uint32_t* mesh_indices =
|
uint32_t *mesh_indices =
|
||||||
game_malloc(sizeof(uint32_t) * MeshPtrCount, GBUF_MESH_POINTERS);
|
game_malloc(sizeof(uint32_t) * MeshPtrCount, GBUF_MESH_POINTERS);
|
||||||
_fread(mesh_indices, sizeof(uint32_t), MeshPtrCount, fp);
|
_fread(mesh_indices, sizeof(uint32_t), MeshPtrCount, fp);
|
||||||
|
|
||||||
Meshes = game_malloc(sizeof(int16_t*) * MeshPtrCount, GBUF_MESH_POINTERS);
|
Meshes = game_malloc(sizeof(int16_t *) * MeshPtrCount, GBUF_MESH_POINTERS);
|
||||||
for (int i = 0; i < MeshPtrCount; i++) {
|
for (int i = 0; i < MeshPtrCount; i++) {
|
||||||
Meshes[i] = &MeshBase[mesh_indices[i] / 2];
|
Meshes[i] = &MeshBase[mesh_indices[i] / 2];
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ int32_t LoadObjects(FILE* fp)
|
||||||
for (int i = 0; i < ObjectCount; i++) {
|
for (int i = 0; i < ObjectCount; i++) {
|
||||||
int32_t tmp;
|
int32_t tmp;
|
||||||
_fread(&tmp, sizeof(int32_t), 1, fp);
|
_fread(&tmp, sizeof(int32_t), 1, fp);
|
||||||
OBJECT_INFO* object = &Objects[tmp];
|
OBJECT_INFO *object = &Objects[tmp];
|
||||||
|
|
||||||
_fread(&object->nmeshes, sizeof(int16_t), 1, fp);
|
_fread(&object->nmeshes, sizeof(int16_t), 1, fp);
|
||||||
_fread(&object->mesh_index, sizeof(int16_t), 1, fp);
|
_fread(&object->mesh_index, sizeof(int16_t), 1, fp);
|
||||||
|
@ -304,7 +304,7 @@ int32_t LoadObjects(FILE* fp)
|
||||||
for (int i = 0; i < StaticCount; i++) {
|
for (int i = 0; i < StaticCount; i++) {
|
||||||
int32_t tmp;
|
int32_t tmp;
|
||||||
_fread(&tmp, sizeof(int32_t), 1, fp);
|
_fread(&tmp, sizeof(int32_t), 1, fp);
|
||||||
STATIC_INFO* object = &StaticObjects[tmp];
|
STATIC_INFO *object = &StaticObjects[tmp];
|
||||||
|
|
||||||
_fread(&object->mesh_number, sizeof(int16_t), 1, fp);
|
_fread(&object->mesh_number, sizeof(int16_t), 1, fp);
|
||||||
_fread(&object->x_minp, sizeof(int16_t), 6, fp);
|
_fread(&object->x_minp, sizeof(int16_t), 6, fp);
|
||||||
|
@ -323,7 +323,7 @@ int32_t LoadObjects(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadSprites(FILE* fp)
|
int32_t LoadSprites(FILE *fp)
|
||||||
{
|
{
|
||||||
_fread(&SpriteInfoCount, sizeof(int32_t), 1, fp);
|
_fread(&SpriteInfoCount, sizeof(int32_t), 1, fp);
|
||||||
_fread(&PhdSpriteInfo, sizeof(PHDSPRITESTRUCT), SpriteInfoCount, fp);
|
_fread(&PhdSpriteInfo, sizeof(PHDSPRITESTRUCT), SpriteInfoCount, fp);
|
||||||
|
@ -346,7 +346,7 @@ int32_t LoadSprites(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadItems(FILE* fp)
|
int32_t LoadItems(FILE *fp)
|
||||||
{
|
{
|
||||||
int32_t item_count = 0;
|
int32_t item_count = 0;
|
||||||
_fread(&item_count, sizeof(int32_t), 1, fp);
|
_fread(&item_count, sizeof(int32_t), 1, fp);
|
||||||
|
@ -371,7 +371,7 @@ int32_t LoadItems(FILE* fp)
|
||||||
InitialiseItemArray(NUMBER_ITEMS);
|
InitialiseItemArray(NUMBER_ITEMS);
|
||||||
|
|
||||||
for (int i = 0; i < item_count; ++i) {
|
for (int i = 0; i < item_count; ++i) {
|
||||||
ITEM_INFO* item = &Items[i];
|
ITEM_INFO *item = &Items[i];
|
||||||
_fread(&item->object_number, sizeof(int16_t), 1, fp);
|
_fread(&item->object_number, sizeof(int16_t), 1, fp);
|
||||||
_fread(&item->room_number, sizeof(int16_t), 1, fp);
|
_fread(&item->room_number, sizeof(int16_t), 1, fp);
|
||||||
_fread(&item->pos.x, sizeof(int32_t), 1, fp);
|
_fread(&item->pos.x, sizeof(int32_t), 1, fp);
|
||||||
|
@ -397,7 +397,7 @@ int32_t LoadItems(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadDepthQ(FILE* fp)
|
int32_t LoadDepthQ(FILE *fp)
|
||||||
{
|
{
|
||||||
TRACE("");
|
TRACE("");
|
||||||
_fread(DepthQTable, sizeof(uint8_t), 32 * 256, fp);
|
_fread(DepthQTable, sizeof(uint8_t), 32 * 256, fp);
|
||||||
|
@ -412,7 +412,7 @@ int32_t LoadDepthQ(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadPalette(FILE* fp)
|
int32_t LoadPalette(FILE *fp)
|
||||||
{
|
{
|
||||||
TRACE("");
|
TRACE("");
|
||||||
_fread(GamePalette, sizeof(uint8_t), 256 * 3, fp);
|
_fread(GamePalette, sizeof(uint8_t), 256 * 3, fp);
|
||||||
|
@ -431,7 +431,7 @@ int32_t LoadPalette(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadCameras(FILE* fp)
|
int32_t LoadCameras(FILE *fp)
|
||||||
{
|
{
|
||||||
_fread(&NumberCameras, sizeof(int32_t), 1, fp);
|
_fread(&NumberCameras, sizeof(int32_t), 1, fp);
|
||||||
TRACE("%d cameras", NumberCameras);
|
TRACE("%d cameras", NumberCameras);
|
||||||
|
@ -447,7 +447,7 @@ int32_t LoadCameras(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadSoundEffects(FILE* fp)
|
int32_t LoadSoundEffects(FILE *fp)
|
||||||
{
|
{
|
||||||
_fread(&NumberSoundEffects, sizeof(int32_t), 1, fp);
|
_fread(&NumberSoundEffects, sizeof(int32_t), 1, fp);
|
||||||
TRACE("%d sound effects", NumberSoundEffects);
|
TRACE("%d sound effects", NumberSoundEffects);
|
||||||
|
@ -463,7 +463,7 @@ int32_t LoadSoundEffects(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadBoxes(FILE* fp)
|
int32_t LoadBoxes(FILE *fp)
|
||||||
{
|
{
|
||||||
_fread(&NumberBoxes, sizeof(int32_t), 1, fp);
|
_fread(&NumberBoxes, sizeof(int32_t), 1, fp);
|
||||||
Boxes = game_malloc(sizeof(BOX_INFO) * NumberBoxes, GBUF_BOXES);
|
Boxes = game_malloc(sizeof(BOX_INFO) * NumberBoxes, GBUF_BOXES);
|
||||||
|
@ -473,7 +473,7 @@ int32_t LoadBoxes(FILE* fp)
|
||||||
}
|
}
|
||||||
|
|
||||||
_fread(&OverlapCount, sizeof(int32_t), 1, fp);
|
_fread(&OverlapCount, sizeof(int32_t), 1, fp);
|
||||||
Overlap = (uint16_t*)game_malloc(2 * OverlapCount, 22);
|
Overlap = (uint16_t *)game_malloc(2 * OverlapCount, 22);
|
||||||
if (!_fread(Overlap, sizeof(int16_t), OverlapCount, fp)) {
|
if (!_fread(Overlap, sizeof(int16_t), OverlapCount, fp)) {
|
||||||
sprintf(StringToShow, "LoadBoxes(): Unable to load box overlaps");
|
sprintf(StringToShow, "LoadBoxes(): Unable to load box overlaps");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -506,7 +506,7 @@ int32_t LoadBoxes(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadAnimatedTextures(FILE* fp)
|
int32_t LoadAnimatedTextures(FILE *fp)
|
||||||
{
|
{
|
||||||
_fread(&AnimTextureRangeCount, sizeof(int32_t), 1, fp);
|
_fread(&AnimTextureRangeCount, sizeof(int32_t), 1, fp);
|
||||||
TRACE("%d animated textures", AnimTextureRangeCount);
|
TRACE("%d animated textures", AnimTextureRangeCount);
|
||||||
|
@ -516,7 +516,7 @@ int32_t LoadAnimatedTextures(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadCinematic(FILE* fp)
|
int32_t LoadCinematic(FILE *fp)
|
||||||
{
|
{
|
||||||
_fread(&NumCineFrames, sizeof(int16_t), 1, fp);
|
_fread(&NumCineFrames, sizeof(int16_t), 1, fp);
|
||||||
TRACE("%d cinematic frames", NumCineFrames);
|
TRACE("%d cinematic frames", NumCineFrames);
|
||||||
|
@ -532,7 +532,7 @@ int32_t LoadCinematic(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadDemo(FILE* fp)
|
int32_t LoadDemo(FILE *fp)
|
||||||
{
|
{
|
||||||
DemoCount = 0;
|
DemoCount = 0;
|
||||||
DemoPtr =
|
DemoPtr =
|
||||||
|
@ -547,11 +547,11 @@ int32_t LoadDemo(FILE* fp)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LoadTexturePages(FILE* fp)
|
int32_t LoadTexturePages(FILE *fp)
|
||||||
{
|
{
|
||||||
_fread(&TexturePageCount, sizeof(int32_t), 1, fp);
|
_fread(&TexturePageCount, sizeof(int32_t), 1, fp);
|
||||||
TRACE("%d texture pages", TexturePageCount);
|
TRACE("%d texture pages", TexturePageCount);
|
||||||
int8_t* base = game_malloc(TexturePageCount * 65536, GBUF_TEXTURE_PAGES);
|
int8_t *base = game_malloc(TexturePageCount * 65536, GBUF_TEXTURE_PAGES);
|
||||||
_fread(base, 65536, TexturePageCount, fp);
|
_fread(base, 65536, TexturePageCount, fp);
|
||||||
for (int i = 0; i < TexturePageCount; i++) {
|
for (int i = 0; i < TexturePageCount; i++) {
|
||||||
TexturePagePtrs[i] = base;
|
TexturePagePtrs[i] = base;
|
||||||
|
@ -600,7 +600,7 @@ int32_t S_LoadLevel(int level_num)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* GetFullPath(const char* filename)
|
const char *GetFullPath(const char *filename)
|
||||||
{
|
{
|
||||||
static char newpath[128];
|
static char newpath[128];
|
||||||
TRACE("%s", filename);
|
TRACE("%s", filename);
|
||||||
|
@ -622,7 +622,7 @@ void FindCdDrive()
|
||||||
#ifdef T1M_FEAT_NOCD
|
#ifdef T1M_FEAT_NOCD
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
FILE* fp;
|
FILE *fp;
|
||||||
char root[5] = "C:\\";
|
char root[5] = "C:\\";
|
||||||
char tmp_path[MAX_PATH];
|
char tmp_path[MAX_PATH];
|
||||||
|
|
||||||
|
@ -657,8 +657,8 @@ int GetSecretCount()
|
||||||
uint32_t secrets = 0;
|
uint32_t secrets = 0;
|
||||||
|
|
||||||
for (int i = 0; i < RoomCount; i++) {
|
for (int i = 0; i < RoomCount; i++) {
|
||||||
ROOM_INFO* r = &RoomInfo[i];
|
ROOM_INFO *r = &RoomInfo[i];
|
||||||
FLOOR_INFO* floor = &r->floor[0];
|
FLOOR_INFO *floor = &r->floor[0];
|
||||||
for (int j = 0; j < r->y_size * r->x_size; j++, floor++) {
|
for (int j = 0; j < r->y_size * r->x_size; j++, floor++) {
|
||||||
int k = floor->index;
|
int k = floor->index;
|
||||||
if (!k) {
|
if (!k) {
|
||||||
|
@ -727,8 +727,8 @@ void FixPyramidSecretTrigger()
|
||||||
|
|
||||||
for (int i = 0; i < RoomCount; i++) {
|
for (int i = 0; i < RoomCount; i++) {
|
||||||
uint32_t room_secrets = 0;
|
uint32_t room_secrets = 0;
|
||||||
ROOM_INFO* r = &RoomInfo[i];
|
ROOM_INFO *r = &RoomInfo[i];
|
||||||
FLOOR_INFO* floor = &r->floor[0];
|
FLOOR_INFO *floor = &r->floor[0];
|
||||||
for (int j = 0; j < r->y_size * r->x_size; j++, floor++) {
|
for (int j = 0; j < r->y_size * r->x_size; j++, floor++) {
|
||||||
int k = floor->index;
|
int k = floor->index;
|
||||||
if (!k) {
|
if (!k) {
|
||||||
|
@ -758,7 +758,7 @@ void FixPyramidSecretTrigger()
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
int16_t* command = &FloorData[k++];
|
int16_t *command = &FloorData[k++];
|
||||||
if (TRIG_BITS(*command) == TO_CAMERA) {
|
if (TRIG_BITS(*command) == TO_CAMERA) {
|
||||||
k++;
|
k++;
|
||||||
} else if (TRIG_BITS(*command) == TO_SECRET) {
|
} else if (TRIG_BITS(*command) == TO_SECRET) {
|
||||||
|
|
|
@ -17,22 +17,22 @@
|
||||||
#define _fread ((size_t (*)(void *, size_t, size_t, FILE *))0x00442C20)
|
#define _fread ((size_t (*)(void *, size_t, size_t, FILE *))0x00442C20)
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
int32_t LoadLevel(const char* filename, int32_t level_num);
|
int32_t LoadLevel(const char *filename, int32_t level_num);
|
||||||
int32_t LoadRooms(FILE* fp);
|
int32_t LoadRooms(FILE *fp);
|
||||||
int32_t LoadObjects(FILE* fp);
|
int32_t LoadObjects(FILE *fp);
|
||||||
int32_t LoadSprites(FILE* fp);
|
int32_t LoadSprites(FILE *fp);
|
||||||
int32_t LoadItems(FILE* fp);
|
int32_t LoadItems(FILE *fp);
|
||||||
int32_t LoadDepthQ(FILE* fp);
|
int32_t LoadDepthQ(FILE *fp);
|
||||||
int32_t LoadPalette(FILE* fp);
|
int32_t LoadPalette(FILE *fp);
|
||||||
int32_t LoadCameras(FILE* fp);
|
int32_t LoadCameras(FILE *fp);
|
||||||
int32_t LoadSoundEffects(FILE* fp);
|
int32_t LoadSoundEffects(FILE *fp);
|
||||||
int32_t LoadBoxes(FILE* fp);
|
int32_t LoadBoxes(FILE *fp);
|
||||||
int32_t LoadAnimatedTextures(FILE* fp);
|
int32_t LoadAnimatedTextures(FILE *fp);
|
||||||
int32_t LoadCinematic(FILE* fp);
|
int32_t LoadCinematic(FILE *fp);
|
||||||
int32_t LoadDemo(FILE* fp);
|
int32_t LoadDemo(FILE *fp);
|
||||||
int32_t LoadTexturePages(FILE* fp);
|
int32_t LoadTexturePages(FILE *fp);
|
||||||
int32_t S_LoadLevel(int32_t level_num);
|
int32_t S_LoadLevel(int32_t level_num);
|
||||||
const char* GetFullPath(const char* filename);
|
const char *GetFullPath(const char *filename);
|
||||||
void FindCdDrive();
|
void FindCdDrive();
|
||||||
|
|
||||||
#ifdef T1M_FEAT_OG_FIXES
|
#ifdef T1M_FEAT_OG_FIXES
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
void DB_Log(char* fmt, ...)
|
void DB_Log(char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list va;
|
va_list va;
|
||||||
char buffer[256] = { 0 };
|
char buffer[256] = { 0 };
|
||||||
|
@ -87,7 +87,7 @@ void CalculateWibbleTable()
|
||||||
void S_SeedRandom()
|
void S_SeedRandom()
|
||||||
{
|
{
|
||||||
time_t lt = time(0);
|
time_t lt = time(0);
|
||||||
struct tm* tptr = localtime(<);
|
struct tm *tptr = localtime(<);
|
||||||
SeedRandomControl(tptr->tm_sec + 57 * tptr->tm_min + 3543 * tptr->tm_hour);
|
SeedRandomControl(tptr->tm_sec + 57 * tptr->tm_min + 3543 * tptr->tm_hour);
|
||||||
SeedRandomDraw(tptr->tm_sec + 43 * tptr->tm_min + 3477 * tptr->tm_hour);
|
SeedRandomDraw(tptr->tm_sec + 43 * tptr->tm_min + 3477 * tptr->tm_hour);
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ int32_t GetRenderScale(int32_t unit)
|
||||||
|
|
||||||
void BarLocation(
|
void BarLocation(
|
||||||
int8_t bar_location, int32_t scale, int32_t width, int32_t height,
|
int8_t bar_location, int32_t scale, int32_t width, int32_t height,
|
||||||
int32_t* x, int32_t* y)
|
int32_t *x, int32_t *y)
|
||||||
{
|
{
|
||||||
if (bar_location == T1M_BL_TOP_LEFT || bar_location == T1M_BL_BOTTOM_LEFT) {
|
if (bar_location == T1M_BL_TOP_LEFT || bar_location == T1M_BL_BOTTOM_LEFT) {
|
||||||
*x = 8 * scale;
|
*x = 8 * scale;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include <dbghelp.h>
|
#include <dbghelp.h>
|
||||||
|
|
||||||
void T1MTraceFunc(
|
void T1MTraceFunc(
|
||||||
const char* file, int line, const char* func, const char* fmt, ...)
|
const char *file, int line, const char *func, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list va;
|
va_list va;
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
|
@ -15,7 +15,7 @@ void T1MTraceFunc(
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void T1MInjectFunc(void* from, void* to)
|
void T1MInjectFunc(void *from, void *to)
|
||||||
{
|
{
|
||||||
if (from == to) {
|
if (from == to) {
|
||||||
return;
|
return;
|
||||||
|
@ -44,9 +44,9 @@ void T1MPrintStackTrace()
|
||||||
STACKFRAME64 stack;
|
STACKFRAME64 stack;
|
||||||
ULONG frame;
|
ULONG frame;
|
||||||
DWORD64 displacement;
|
DWORD64 displacement;
|
||||||
IMAGEHLP_SYMBOL64* pSymbol =
|
IMAGEHLP_SYMBOL64 *pSymbol =
|
||||||
malloc(sizeof(IMAGEHLP_SYMBOL64) + (MaxNameLen + 1) * sizeof(TCHAR));
|
malloc(sizeof(IMAGEHLP_SYMBOL64) + (MaxNameLen + 1) * sizeof(TCHAR));
|
||||||
char* name = malloc(MaxNameLen + 1);
|
char *name = malloc(MaxNameLen + 1);
|
||||||
|
|
||||||
RtlCaptureContext(&context);
|
RtlCaptureContext(&context);
|
||||||
memset(&stack, 0, sizeof(STACKFRAME64));
|
memset(&stack, 0, sizeof(STACKFRAME64));
|
||||||
|
|
10
src/util.h
10
src/util.h
|
@ -45,18 +45,18 @@ typedef struct {
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
#define TRACE(...) T1MTraceFunc(__FILE__, __LINE__, __func__, __VA_ARGS__)
|
#define TRACE(...) T1MTraceFunc(__FILE__, __LINE__, __func__, __VA_ARGS__)
|
||||||
#define VAR_U_(address, type) (*(type*)(address))
|
#define VAR_U_(address, type) (*(type *)(address))
|
||||||
#define VAR_I_(address, type, value) (*(type*)(address))
|
#define VAR_I_(address, type, value) (*(type *)(address))
|
||||||
#define ARRAY_(address, type, length) (*(type(*) length)(address))
|
#define ARRAY_(address, type, length) (*(type(*) length)(address))
|
||||||
|
|
||||||
void T1MTraceFunc(
|
void T1MTraceFunc(
|
||||||
const char* file, int line, const char* func, const char* fmt, ...);
|
const char *file, int line, const char *func, const char *fmt, ...);
|
||||||
void T1MInjectFunc(void* from, void* to);
|
void T1MInjectFunc(void *from, void *to);
|
||||||
void T1MPrintStackTrace();
|
void T1MPrintStackTrace();
|
||||||
|
|
||||||
#define INJECT(from, to) \
|
#define INJECT(from, to) \
|
||||||
{ \
|
{ \
|
||||||
T1MInjectFunc((void*)from, (void*)to); \
|
T1MInjectFunc((void *)from, (void *)to); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -41,20 +41,20 @@ void test_empty_config()
|
||||||
|
|
||||||
void test_config_override()
|
void test_config_override()
|
||||||
{
|
{
|
||||||
FILE* fp = fopen("Tomb1Main.json5", "rb");
|
FILE *fp = fopen("Tomb1Main.json5", "rb");
|
||||||
ASSERT_OK(!!fp);
|
ASSERT_OK(!!fp);
|
||||||
|
|
||||||
fseek(fp, 0, SEEK_END);
|
fseek(fp, 0, SEEK_END);
|
||||||
int cfg_size = ftell(fp);
|
int cfg_size = ftell(fp);
|
||||||
fseek(fp, 0, SEEK_SET);
|
fseek(fp, 0, SEEK_SET);
|
||||||
|
|
||||||
char* cfg_data = malloc(cfg_size);
|
char *cfg_data = malloc(cfg_size);
|
||||||
ASSERT_OK(!!cfg_data);
|
ASSERT_OK(!!cfg_data);
|
||||||
|
|
||||||
fread(cfg_data, 1, cfg_size, fp);
|
fread(cfg_data, 1, cfg_size, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
char* tmp = strstr(cfg_data, "enable_cheats\": false");
|
char *tmp = strstr(cfg_data, "enable_cheats\": false");
|
||||||
ASSERT_OK(!!tmp);
|
ASSERT_OK(!!tmp);
|
||||||
tmp = strstr(tmp, "false");
|
tmp = strstr(tmp, "false");
|
||||||
ASSERT_OK(!!tmp);
|
ASSERT_OK(!!tmp);
|
||||||
|
@ -69,7 +69,7 @@ void test_config_override()
|
||||||
free(cfg_data);
|
free(cfg_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
test_empty_config();
|
test_empty_config();
|
||||||
test_config_override();
|
test_config_override();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue