mirror of
https://github.com/LostArtefacts/TRX.git
synced 2025-04-28 20:58:07 +03:00
update struct.h
This commit is contained in:
parent
e6960067cb
commit
7d4a2696ed
2 changed files with 374 additions and 243 deletions
202
src/func.c
202
src/func.c
|
@ -75,10 +75,10 @@ int FindCdDrive() {
|
||||||
|
|
||||||
int LoadRooms(FILE *fp) {
|
int LoadRooms(FILE *fp) {
|
||||||
TRACE("");
|
TRACE("");
|
||||||
__int16 wCount;
|
uint16_t count2;
|
||||||
__int32 dwCount;
|
uint32_t count4;
|
||||||
|
|
||||||
_fread(&RoomCount, sizeof(__int16), 1, fp);
|
_fread(&RoomCount, sizeof(uint16_t), 1, fp);
|
||||||
if (RoomCount > 1024) {
|
if (RoomCount > 1024) {
|
||||||
strcpy(StringToShow, "LoadRoom(): Too many rooms");
|
strcpy(StringToShow, "LoadRoom(): Too many rooms");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -99,96 +99,98 @@ int LoadRooms(FILE *fp) {
|
||||||
++i, ++current_room_info
|
++i, ++current_room_info
|
||||||
) {
|
) {
|
||||||
// Room position
|
// Room position
|
||||||
_fread(¤t_room_info->x, sizeof(__int32), 1, fp);
|
_fread(¤t_room_info->x, sizeof(uint32_t), 1, fp);
|
||||||
current_room_info->y = 0;
|
current_room_info->y = 0;
|
||||||
_fread(¤t_room_info->z, sizeof(__int32), 1, fp);
|
_fread(¤t_room_info->z, sizeof(uint32_t), 1, fp);
|
||||||
|
|
||||||
// Room floor/ceiling
|
// Room floor/ceiling
|
||||||
_fread(¤t_room_info->minFloor, sizeof(__int32), 1, fp);
|
_fread(¤t_room_info->min_floor, sizeof(uint32_t), 1, fp);
|
||||||
_fread(¤t_room_info->maxCeiling, sizeof(__int32), 1, fp);
|
_fread(¤t_room_info->max_ceiling, sizeof(uint32_t), 1, fp);
|
||||||
|
|
||||||
// Room mesh
|
// Room mesh
|
||||||
_fread(&dwCount, sizeof(__int32), 1, fp);
|
_fread(&count4, sizeof(uint32_t), 1, fp);
|
||||||
current_room_info->data = (__int16 *)game_malloc(
|
current_room_info->data = (uint16_t *)game_malloc(
|
||||||
sizeof(__int16) * dwCount, GBUF_RoomMesh
|
sizeof(uint16_t) * count4, GBUF_RoomMesh
|
||||||
);
|
);
|
||||||
_fread(current_room_info->data, sizeof(__int16), dwCount, fp);
|
_fread(current_room_info->data, sizeof(uint16_t), count4, fp);
|
||||||
|
|
||||||
// Doors
|
// Doors
|
||||||
_fread(&wCount, sizeof(__int16), 1, fp);
|
_fread(&count2, sizeof(uint16_t), 1, fp);
|
||||||
if (!wCount) {
|
if (!count2) {
|
||||||
current_room_info->doors = NULL;
|
current_room_info->doors = NULL;
|
||||||
} else {
|
} else {
|
||||||
current_room_info->doors = (DOOR_INFOS *)game_malloc(
|
current_room_info->doors = (DOOR_INFOS *)game_malloc(
|
||||||
sizeof(__int16) + sizeof(DOOR_INFO) * wCount, GBUF_RoomDoor
|
sizeof(uint16_t) + sizeof(DOOR_INFO) * count2, GBUF_RoomDoor
|
||||||
|
);
|
||||||
|
current_room_info->doors->count = count2;
|
||||||
|
_fread(
|
||||||
|
¤t_room_info->doors->door, sizeof(DOOR_INFO), count2, fp
|
||||||
);
|
);
|
||||||
current_room_info->doors->count = wCount;
|
|
||||||
_fread(¤t_room_info->doors->door, sizeof(DOOR_INFO), wCount, fp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Room floor
|
// Room floor
|
||||||
_fread(¤t_room_info->xSize, sizeof(__int16), 1, fp);
|
_fread(¤t_room_info->x_size, sizeof(uint16_t), 1, fp);
|
||||||
_fread(¤t_room_info->ySize, sizeof(__int16), 1, fp);
|
_fread(¤t_room_info->y_size, sizeof(uint16_t), 1, fp);
|
||||||
dwCount = current_room_info->ySize * current_room_info->xSize;
|
count4 = current_room_info->y_size * current_room_info->x_size;
|
||||||
current_room_info->floor = (FLOOR_INFO *)game_malloc(
|
current_room_info->floor = (FLOOR_INFO *)game_malloc(
|
||||||
sizeof(FLOOR_INFO) * dwCount, GBUF_RoomFloor
|
sizeof(FLOOR_INFO) * count4, GBUF_RoomFloor
|
||||||
);
|
);
|
||||||
_fread(current_room_info->floor, sizeof(FLOOR_INFO), dwCount, fp);
|
_fread(current_room_info->floor, sizeof(FLOOR_INFO), count4, fp);
|
||||||
|
|
||||||
// Room lights
|
// Room lights
|
||||||
_fread(¤t_room_info->ambient, sizeof(__int16), 1, fp);
|
_fread(¤t_room_info->ambient, sizeof(uint16_t), 1, fp);
|
||||||
_fread(¤t_room_info->numLights, sizeof(__int16), 1, fp);
|
_fread(¤t_room_info->num_lights, sizeof(uint16_t), 1, fp);
|
||||||
if (!current_room_info->numLights) {
|
if (!current_room_info->num_lights) {
|
||||||
current_room_info->light = NULL;
|
current_room_info->light = NULL;
|
||||||
} else {
|
} else {
|
||||||
current_room_info->light = (LIGHT_INFO *)game_malloc(
|
current_room_info->light = (LIGHT_INFO *)game_malloc(
|
||||||
sizeof(LIGHT_INFO) * current_room_info->numLights,
|
sizeof(LIGHT_INFO) * current_room_info->num_lights,
|
||||||
GBUF_RoomLights
|
GBUF_RoomLights
|
||||||
);
|
);
|
||||||
_fread(
|
_fread(
|
||||||
current_room_info->light,
|
current_room_info->light,
|
||||||
sizeof(LIGHT_INFO),
|
sizeof(LIGHT_INFO),
|
||||||
current_room_info->numLights,
|
current_room_info->num_lights,
|
||||||
fp
|
fp
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static mesh infos
|
// Static mesh infos
|
||||||
_fread(¤t_room_info->numMeshes, sizeof(__int16), 1, fp);
|
_fread(¤t_room_info->num_meshes, sizeof(uint16_t), 1, fp);
|
||||||
if (!current_room_info->numMeshes) {
|
if (!current_room_info->num_meshes) {
|
||||||
current_room_info->mesh = NULL;
|
current_room_info->mesh = NULL;
|
||||||
} else {
|
} else {
|
||||||
current_room_info->mesh = (MESH_INFO *)game_malloc(
|
current_room_info->mesh = (MESH_INFO *)game_malloc(
|
||||||
sizeof(MESH_INFO) * current_room_info->numMeshes,
|
sizeof(MESH_INFO) * current_room_info->num_meshes,
|
||||||
GBUF_RoomStaticMeshInfos
|
GBUF_RoomStaticMeshInfos
|
||||||
);
|
);
|
||||||
_fread(
|
_fread(
|
||||||
current_room_info->mesh,
|
current_room_info->mesh,
|
||||||
sizeof(MESH_INFO),
|
sizeof(MESH_INFO),
|
||||||
current_room_info->numMeshes,
|
current_room_info->num_meshes,
|
||||||
fp
|
fp
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flipped (alternative) room
|
// Flipped (alternative) room
|
||||||
_fread(¤t_room_info->flippedRoom, sizeof(__int16), 1, fp);
|
_fread(¤t_room_info->flipped_room, sizeof(uint16_t), 1, fp);
|
||||||
|
|
||||||
// Room flags
|
// Room flags
|
||||||
_fread(¤t_room_info->flags, sizeof(__int16), 1, fp);
|
_fread(¤t_room_info->flags, sizeof(uint16_t), 1, fp);
|
||||||
|
|
||||||
// Initialise some variables
|
// Initialise some variables
|
||||||
current_room_info->boundActive = 0;
|
current_room_info->bound_active = 0;
|
||||||
current_room_info->boundLeft = PhdWinMaxX;
|
current_room_info->bound_left = PhdWinMaxX;
|
||||||
current_room_info->boundTop = PhdWinMaxY;
|
current_room_info->bound_top = PhdWinMaxY;
|
||||||
current_room_info->boundBottom = 0;
|
current_room_info->bound_bottom = 0;
|
||||||
current_room_info->boundRight = 0;
|
current_room_info->bound_right = 0;
|
||||||
current_room_info->itemNumber = -1;
|
current_room_info->item_number = -1;
|
||||||
current_room_info->fxNumber = -1;
|
current_room_info->fx_number = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
_fread(&dwCount, sizeof(__int32), 1, fp);
|
_fread(&count4, sizeof(uint32_t), 1, fp);
|
||||||
FloorData = game_malloc(sizeof(__int16) * dwCount, GBUF_FloorData);
|
FloorData = game_malloc(sizeof(uint16_t) * count4, GBUF_FloorData);
|
||||||
_fread(FloorData, sizeof(__int16), dwCount, fp);
|
_fread(FloorData, sizeof(uint16_t), count4, fp);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -197,7 +199,7 @@ void __cdecl LevelStats(int levelID) {
|
||||||
TRACE("");
|
TRACE("");
|
||||||
|
|
||||||
if (TR1MConfig.keep_health_between_levels) {
|
if (TR1MConfig.keep_health_between_levels) {
|
||||||
TR1MData.stored_lara_health = LaraItem ? LaraItem->hitPoints : 1000;
|
TR1MData.stored_lara_health = LaraItem ? LaraItem->hit_points : LARA_HITPOINTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char buf[100];
|
static char buf[100];
|
||||||
|
@ -317,14 +319,13 @@ int __cdecl LoadLevelByID(int levelID) {
|
||||||
// currently loaded level.
|
// currently loaded level.
|
||||||
int laraFound = 0;
|
int laraFound = 0;
|
||||||
for (int i = 0; i < LevelItemCount; i++) {
|
for (int i = 0; i < LevelItemCount; i++) {
|
||||||
if (Items[i].objectID == ID_LARA) {
|
if (Items[i].object_id == ID_LARA) {
|
||||||
laraFound = 1;
|
laraFound = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!laraFound) {
|
if (!laraFound) {
|
||||||
TRACE("Resetting stored Lara health");
|
TR1MData.stored_lara_health = LARA_HITPOINTS;
|
||||||
TR1MData.stored_lara_health = 1000;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,34 +393,34 @@ int __cdecl LoadItems(FILE *handle)
|
||||||
|
|
||||||
for (int i = 0; i < itemCount; ++i) {
|
for (int i = 0; i < itemCount; ++i) {
|
||||||
ITEM_INFO *currentItem = &Items[i];
|
ITEM_INFO *currentItem = &Items[i];
|
||||||
_fread(¤tItem->objectID, 2u, 1u, handle);
|
_fread(¤tItem->object_id, 2u, 1u, handle);
|
||||||
_fread(¤tItem->roomNumber, 2u, 1u, handle);
|
_fread(¤tItem->room_number, 2u, 1u, handle);
|
||||||
_fread(¤tItem->pos.x, 4u, 1u, handle);
|
_fread(¤tItem->pos.x, 4u, 1u, handle);
|
||||||
_fread(¤tItem->pos.y, 4u, 1u, handle);
|
_fread(¤tItem->pos.y, 4u, 1u, handle);
|
||||||
_fread(¤tItem->pos.z, 4u, 1u, handle);
|
_fread(¤tItem->pos.z, 4u, 1u, handle);
|
||||||
_fread(¤tItem->pos.rotY, 2u, 1u, handle);
|
_fread(¤tItem->pos.rot_y, 2u, 1u, handle);
|
||||||
_fread(¤tItem->shade1, 2u, 1u, handle);
|
_fread(¤tItem->shade1, 2u, 1u, handle);
|
||||||
_fread(¤tItem->flags, 2u, 1u, handle);
|
_fread(¤tItem->flags, 2u, 1u, handle);
|
||||||
|
|
||||||
int objectID = currentItem->objectID;
|
int object_id = currentItem->object_id;
|
||||||
if (objectID < 0 || objectID >= ID_NUMBER_OBJECTS) {
|
if (object_id < 0 || object_id >= ID_NUMBER_OBJECTS) {
|
||||||
sprintf(
|
sprintf(
|
||||||
StringToShow,
|
StringToShow,
|
||||||
"LoadItems(): Bad Object number (%d) on Item %d",
|
"LoadItems(): Bad Object number (%d) on Item %d",
|
||||||
objectID,
|
object_id,
|
||||||
i
|
i
|
||||||
);
|
);
|
||||||
S_ExitSystem(StringToShow);
|
S_ExitSystem(StringToShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TR1MConfig.disable_medpacks && (
|
if (TR1MConfig.disable_medpacks && (
|
||||||
objectID == ID_LARGE_MEDIPACK_ITEM ||
|
object_id == ID_LARGE_MEDIPACK_ITEM ||
|
||||||
objectID == ID_SMALL_MEDIPACK_ITEM
|
object_id == ID_SMALL_MEDIPACK_ITEM
|
||||||
)) {
|
)) {
|
||||||
currentItem->pos.x = -1;
|
currentItem->pos.x = -1;
|
||||||
currentItem->pos.y = -1;
|
currentItem->pos.y = -1;
|
||||||
currentItem->pos.z = -1;
|
currentItem->pos.z = -1;
|
||||||
currentItem->roomNumber = 0;
|
currentItem->room_number = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
InitialiseItem(i);
|
InitialiseItem(i);
|
||||||
|
@ -429,57 +430,58 @@ int __cdecl LoadItems(FILE *handle)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __cdecl InitialiseLara(void) {
|
void __cdecl InitialiseLara() {
|
||||||
TRACE("");
|
TRACE("");
|
||||||
LaraItem->moreFlags &= 0xFFDFu;
|
LaraItem->more_flags &= 0xFFDFu;
|
||||||
LaraItem->data = &Lara;
|
LaraItem->data = &Lara;
|
||||||
if (TR1MConfig.keep_health_between_levels) {
|
|
||||||
TRACE("Restoring Lara health: %d", TR1MData.stored_lara_health);
|
LaraItem->hit_points = TR1MConfig.keep_health_between_levels
|
||||||
LaraItem->hitPoints = TR1MData.stored_lara_health;
|
? TR1MData.stored_lara_health
|
||||||
|
: LARA_HITPOINTS;
|
||||||
|
|
||||||
|
Lara.air = LARA_AIR;
|
||||||
|
Lara.torso_z_rot = 0;
|
||||||
|
Lara.torso_x_rot = 0;
|
||||||
|
Lara.torso_y_rot = 0;
|
||||||
|
Lara.head_z_rot = 0;
|
||||||
|
Lara.head_y_rot = 0;
|
||||||
|
Lara.head_x_rot = 0;
|
||||||
|
Lara.calc_fallspeed = 0;
|
||||||
|
Lara.mesh_effects = 0;
|
||||||
|
Lara.hit_frames = 0;
|
||||||
|
Lara.hit_direction = 0;
|
||||||
|
Lara.death_count = 0;
|
||||||
|
Lara.target = 0;
|
||||||
|
Lara.spaz_effect = 0;
|
||||||
|
Lara.spaz_effect_count = 0;
|
||||||
|
Lara.turn_rate = 0;
|
||||||
|
Lara.move_angle = 0;
|
||||||
|
Lara.right_arm.flash_gun = 0;
|
||||||
|
Lara.left_arm.flash_gun = 0;
|
||||||
|
Lara.right_arm.lock = 0;
|
||||||
|
Lara.left_arm.lock = 0;
|
||||||
|
|
||||||
|
if (RoomInfo[LaraItem->room_number].flags & 1) {
|
||||||
|
Lara.water_status = LARA_UNDERWATER;
|
||||||
|
LaraItem->fall_speed = 0;
|
||||||
|
LaraItem->goal_anim_state = AS_TREAD;
|
||||||
|
LaraItem->current_anim_state = AS_TREAD;
|
||||||
|
LaraItem->anim_number = TREAD_A;
|
||||||
|
LaraItem->frame_number = TREAD_F;
|
||||||
} else {
|
} else {
|
||||||
TRACE("Restoring Lara health: default");
|
Lara.water_status = LARA_ABOVEWATER;
|
||||||
LaraItem->hitPoints = 1000;
|
LaraItem->goal_anim_state = AS_STOP;
|
||||||
|
LaraItem->current_anim_state = AS_STOP;
|
||||||
|
LaraItem->anim_number = STOP_A;
|
||||||
|
LaraItem->frame_number = STOP_F;
|
||||||
}
|
}
|
||||||
|
|
||||||
Lara.air = 1800;
|
Lara.current_active = 0;
|
||||||
Lara.field_8 = 0;
|
|
||||||
Lara.field_20 = 0;
|
|
||||||
Lara.field_E = 0;
|
|
||||||
Lara.field_10 = 0;
|
|
||||||
Lara.field_16 = 0;
|
|
||||||
Lara.field_60 = 0;
|
|
||||||
Lara.field_1C = 0;
|
|
||||||
Lara.field_1A = 0;
|
|
||||||
Lara.field_96 = 0;
|
|
||||||
Lara.field_86 = 0;
|
|
||||||
Lara.field_8E = 0;
|
|
||||||
Lara.field_7E = 0;
|
|
||||||
Lara.field_6C = 0;
|
|
||||||
Lara.field_68 = 0;
|
|
||||||
Lara.field_74 = 0;
|
|
||||||
Lara.field_70 = 0;
|
|
||||||
|
|
||||||
TRACE("%x\n", &Lara.field_4 - &Lara.itemNumber);
|
InitialiseLOT(&Lara.LOT);
|
||||||
|
Lara.LOT.step = WALL_L * 20;
|
||||||
|
Lara.LOT.drop = -WALL_L * 20;
|
||||||
|
Lara.LOT.fly = STEP_L;
|
||||||
|
|
||||||
if (RoomInfo[LaraItem->roomNumber].flags & 1) {
|
|
||||||
Lara.waterStatus = 1;
|
|
||||||
LaraItem->fallSpeed = 0;
|
|
||||||
LaraItem->goalAnimState = 13;
|
|
||||||
LaraItem->currentAnimState = 13;
|
|
||||||
LaraItem->animNumber = 108;
|
|
||||||
LaraItem->frameNumber = 1736;
|
|
||||||
} else {
|
|
||||||
Lara.waterStatus = 0;
|
|
||||||
LaraItem->goalAnimState = 2;
|
|
||||||
LaraItem->currentAnimState = 2;
|
|
||||||
LaraItem->animNumber = 11;
|
|
||||||
LaraItem->frameNumber = 185;
|
|
||||||
}
|
|
||||||
|
|
||||||
Lara.field_18 = 0;
|
|
||||||
InitialiseLOT(&Lara.field_C8);
|
|
||||||
Lara.field_D4 = 20480;
|
|
||||||
Lara.field_D6 = -20480;
|
|
||||||
Lara.field_D8 = 256;
|
|
||||||
InitialiseLaraInventory(CurrentLevel);
|
InitialiseLaraInventory(CurrentLevel);
|
||||||
}
|
}
|
||||||
|
|
415
src/struct.h
415
src/struct.h
|
@ -2,6 +2,21 @@
|
||||||
#define TR1MAIN_STRUCT_H
|
#define TR1MAIN_STRUCT_H
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
typedef uint16_t PHD_ANGLE;
|
||||||
|
typedef void UNKNOWN_STRUCT;
|
||||||
|
|
||||||
|
#define LARA_HITPOINTS 1000
|
||||||
|
#define LARA_AIR 1800
|
||||||
|
|
||||||
|
#define TREAD_A 108
|
||||||
|
#define TREAD_F 1736
|
||||||
|
#define STOP_A 11
|
||||||
|
#define STOP_F 185
|
||||||
|
|
||||||
|
#define WALL_L 1024
|
||||||
|
#define STEP_L 256
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ID_LARA = 0,
|
ID_LARA = 0,
|
||||||
|
@ -11,174 +26,288 @@ typedef enum {
|
||||||
} GAME_OBJECT_ID;
|
} GAME_OBJECT_ID;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GBUF_RoomInfos = 11,
|
LARA_ABOVEWATER = 0,
|
||||||
GBUF_RoomMesh = 12,
|
LARA_UNDERWATER = 1,
|
||||||
GBUF_RoomDoor = 13,
|
LARA_SURFACE = 2,
|
||||||
GBUF_RoomFloor = 14,
|
} LARA_WATER_STATES;
|
||||||
GBUF_RoomLights = 15,
|
|
||||||
|
typedef enum {
|
||||||
|
AS_WALK = 0,
|
||||||
|
AS_RUN = 1,
|
||||||
|
AS_STOP = 2,
|
||||||
|
AS_FORWARDJUMP = 3,
|
||||||
|
AS_POSE = 4,
|
||||||
|
AS_FASTBACK = 5,
|
||||||
|
AS_TURN_R = 6,
|
||||||
|
AS_TURN_L = 7,
|
||||||
|
AS_DEATH = 8,
|
||||||
|
AS_FASTFALL = 9,
|
||||||
|
AS_HANG = 10,
|
||||||
|
AS_REACH = 11,
|
||||||
|
AS_SPLAT = 12,
|
||||||
|
AS_TREAD = 13,
|
||||||
|
AS_LAND = 14,
|
||||||
|
AS_COMPRESS = 15,
|
||||||
|
AS_BACK = 16,
|
||||||
|
AS_SWIM = 17,
|
||||||
|
AS_GLIDE = 18,
|
||||||
|
AS_NULL = 19,
|
||||||
|
AS_FASTTURN = 20,
|
||||||
|
AS_STEPRIGHT = 21,
|
||||||
|
AS_STEPLEFT = 22,
|
||||||
|
AS_HIT = 23,
|
||||||
|
AS_SLIDE = 24,
|
||||||
|
AS_BACKJUMP = 25,
|
||||||
|
AS_RIGHTJUMP = 26,
|
||||||
|
AS_LEFTJUMP = 27,
|
||||||
|
AS_UPJUMP = 28,
|
||||||
|
AS_FALLBACK = 29,
|
||||||
|
AS_HANGLEFT = 30,
|
||||||
|
AS_HANGRIGHT = 31,
|
||||||
|
AS_SLIDEBACK = 32,
|
||||||
|
AS_SURFTREAD = 33,
|
||||||
|
AS_SURFSWIM = 34,
|
||||||
|
AS_DIVE = 35,
|
||||||
|
AS_PUSHBLOCK = 36,
|
||||||
|
AS_PULLBLOCK = 37,
|
||||||
|
AS_PPREADY = 38,
|
||||||
|
AS_PICKUP = 39,
|
||||||
|
AS_SWITCHON = 40,
|
||||||
|
AS_SWITCHOFF = 41,
|
||||||
|
AS_USEKEY = 42,
|
||||||
|
AS_USEPUZZLE = 43,
|
||||||
|
AS_UWDEATH = 44,
|
||||||
|
AS_ROLL = 45,
|
||||||
|
AS_SPECIAL = 46,
|
||||||
|
AS_SURFBACK = 47,
|
||||||
|
AS_SURFLEFT = 48,
|
||||||
|
AS_SURFRIGHT = 49,
|
||||||
|
AS_USEMIDAS = 50,
|
||||||
|
AS_DIEMIDAS = 51,
|
||||||
|
AS_SWANDIVE = 52,
|
||||||
|
AS_FASTDIVE = 53,
|
||||||
|
AS_GYMNAST = 54,
|
||||||
|
AS_WATEROU = 55,
|
||||||
|
} LARA_STATES;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
GBUF_RoomInfos = 11,
|
||||||
|
GBUF_RoomMesh = 12,
|
||||||
|
GBUF_RoomDoor = 13,
|
||||||
|
GBUF_RoomFloor = 14,
|
||||||
|
GBUF_RoomLights = 15,
|
||||||
GBUF_RoomStaticMeshInfos = 16,
|
GBUF_RoomStaticMeshInfos = 16,
|
||||||
GBUF_FloorData = 17,
|
GBUF_FloorData = 17,
|
||||||
} GAMEALLOC_BUFFER;
|
} GAMEALLOC_BUFFER;
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
|
|
||||||
typedef struct Pos2D_t {
|
typedef struct {
|
||||||
__int16 x;
|
/* 0000 */ uint16_t x;
|
||||||
__int16 y;
|
/* 0002 */ uint16_t y;
|
||||||
|
/* 0004 end */
|
||||||
} POS_2D;
|
} POS_2D;
|
||||||
|
|
||||||
typedef struct Pos3D_t {
|
typedef struct {
|
||||||
__int16 x;
|
/* 0000 */ uint16_t x;
|
||||||
__int16 y;
|
/* 0002 */ uint16_t y;
|
||||||
__int16 z;
|
/* 0004 */ uint16_t z;
|
||||||
|
/* 0006 end */
|
||||||
} POS_3D;
|
} POS_3D;
|
||||||
|
|
||||||
typedef struct DoorInfo_t {
|
typedef struct {
|
||||||
__int16 room;
|
/* 0000 */ int16_t x;
|
||||||
__int16 x;
|
/* 0002 */ int16_t y;
|
||||||
__int16 y;
|
/* 0004 */ int16_t z;
|
||||||
__int16 z;
|
/* 0006 end */
|
||||||
POS_3D vertex[4];
|
} PHD_VECTOR;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
/* 0000 */ uint16_t room;
|
||||||
|
/* 0002 */ uint16_t x;
|
||||||
|
/* 0004 */ uint16_t y;
|
||||||
|
/* 0006 */ uint16_t z;
|
||||||
|
/* 0008 */ POS_3D vertex[4];
|
||||||
|
/* 0020 end */
|
||||||
} DOOR_INFO;
|
} DOOR_INFO;
|
||||||
|
|
||||||
typedef struct DoorInfos_t {
|
typedef struct {
|
||||||
__int16 count;
|
/* 0000 */ uint16_t count;
|
||||||
DOOR_INFO door[];
|
/* 0002 */ DOOR_INFO door[];
|
||||||
|
/* 0006 end */
|
||||||
} DOOR_INFOS;
|
} DOOR_INFOS;
|
||||||
|
|
||||||
typedef struct FloorInfo_t {
|
typedef struct {
|
||||||
__int16 index;
|
/* 0000 */ uint16_t index;
|
||||||
__int16 box;
|
/* 0002 */ uint16_t box;
|
||||||
__int8 pitRoom;
|
/* 0004 */ uint8_t pit_room;
|
||||||
__int8 floor;
|
/* 0005 */ uint8_t floor;
|
||||||
__int8 skyRoom;
|
/* 0006 */ uint8_t sky_room;
|
||||||
__int8 ceiling;
|
/* 0007 */ uint8_t ceiling;
|
||||||
|
/* 0008 end */
|
||||||
} FLOOR_INFO;
|
} FLOOR_INFO;
|
||||||
|
|
||||||
typedef struct LightInfo_t {
|
typedef struct {
|
||||||
__int32 x;
|
/* 0000 */ uint32_t x;
|
||||||
__int32 y;
|
/* 0004 */ uint32_t y;
|
||||||
__int32 z;
|
/* 0008 */ uint32_t z;
|
||||||
__int16 intensity;
|
/* 000C */ uint16_t intensity;
|
||||||
__int32 falloff;
|
/* 000E */ uint32_t falloff;
|
||||||
|
/* 0012 end */
|
||||||
} LIGHT_INFO;
|
} LIGHT_INFO;
|
||||||
|
|
||||||
typedef struct MeshInfo_t {
|
typedef struct {
|
||||||
__int32 x;
|
/* 0000 */ uint32_t x;
|
||||||
__int32 y;
|
/* 0004 */ uint32_t y;
|
||||||
__int32 z;
|
/* 0008 */ uint32_t z;
|
||||||
__int16 yRot;
|
/* 000C */ uint16_t y_rot;
|
||||||
__int16 shade;
|
/* 000E */ uint16_t shade;
|
||||||
__int16 staticNumber;
|
/* 0010 */ uint16_t static_number;
|
||||||
|
/* 0012 end */
|
||||||
} MESH_INFO;
|
} MESH_INFO;
|
||||||
|
|
||||||
typedef struct RoomInfo_t {
|
typedef struct {
|
||||||
__int16 *data;
|
/* 0000 */ uint16_t *data;
|
||||||
DOOR_INFOS *doors;
|
/* 0004 */ DOOR_INFOS *doors;
|
||||||
FLOOR_INFO *floor;
|
/* 0008 */ FLOOR_INFO *floor;
|
||||||
LIGHT_INFO *light;
|
/* 000C */ LIGHT_INFO *light;
|
||||||
MESH_INFO *mesh;
|
/* 0010 */ MESH_INFO *mesh;
|
||||||
__int32 x;
|
/* 0014 */ uint32_t x;
|
||||||
__int32 y;
|
/* 0018 */ uint32_t y;
|
||||||
__int32 z;
|
/* 001C */ uint32_t z;
|
||||||
__int32 minFloor;
|
/* 0020 */ uint32_t min_floor;
|
||||||
__int32 maxCeiling;
|
/* 0024 */ uint32_t max_ceiling;
|
||||||
__int16 xSize;
|
/* 0028 */ uint16_t x_size;
|
||||||
__int16 ySize;
|
/* 002A */ uint16_t y_size;
|
||||||
__int16 ambient;
|
/* 002C */ uint16_t ambient;
|
||||||
__int16 numLights;
|
/* 002E */ uint16_t num_lights;
|
||||||
__int16 numMeshes;
|
/* 0030 */ uint16_t num_meshes;
|
||||||
__int16 boundLeft;
|
/* 0032 */ uint16_t bound_left;
|
||||||
__int16 boundRight;
|
/* 0034 */ uint16_t bound_right;
|
||||||
__int16 boundTop;
|
/* 0036 */ uint16_t bound_top;
|
||||||
__int16 boundBottom;
|
/* 0038 */ uint16_t bound_bottom;
|
||||||
__int16 boundActive;
|
/* 003A */ uint16_t bound_active;
|
||||||
__int16 itemNumber;
|
/* 003C */ uint16_t item_number;
|
||||||
__int16 fxNumber;
|
/* 003E */ uint16_t fx_number;
|
||||||
__int16 flippedRoom;
|
/* 0040 */ uint16_t flipped_room;
|
||||||
__int16 flags;
|
/* 0042 */ uint16_t flags;
|
||||||
|
/* 0044 end */
|
||||||
} ROOM_INFO;
|
} ROOM_INFO;
|
||||||
|
|
||||||
typedef struct Phd3dPos_t {
|
typedef struct {
|
||||||
int x;
|
/* 0000 */ int32_t x;
|
||||||
int y;
|
/* 0004 */ int32_t y;
|
||||||
int z;
|
/* 0008 */ int32_t z;
|
||||||
__int16 rotX;
|
/* 000C */ uint16_t rot_x;
|
||||||
__int16 rotY;
|
/* 000E */ uint16_t rot_y;
|
||||||
__int16 rotZ;
|
/* 0010 */ uint16_t rot_z;
|
||||||
|
/* 0012 end */
|
||||||
} PHD_3DPOS;
|
} PHD_3DPOS;
|
||||||
|
|
||||||
typedef struct ItemInfo_t {
|
typedef struct {
|
||||||
int floor;
|
/* 0000 */ uint32_t floor;
|
||||||
__int32 touchBits;
|
/* 0004 */ uint32_t touch_bits;
|
||||||
__int32 meshBits;
|
/* 0008 */ uint32_t mesh_bits;
|
||||||
__int16 objectID;
|
/* 000C */ uint16_t object_id;
|
||||||
__int16 currentAnimState;
|
/* 000E */ uint16_t current_anim_state;
|
||||||
__int16 goalAnimState;
|
/* 0010 */ uint16_t goal_anim_state;
|
||||||
__int16 requiredAnimState;
|
/* 0012 */ uint16_t required_anim_state;
|
||||||
__int16 animNumber;
|
/* 0014 */ uint16_t anim_number;
|
||||||
__int16 frameNumber;
|
/* 0016 */ uint16_t frame_number;
|
||||||
__int16 roomNumber;
|
/* 0018 */ uint16_t room_number;
|
||||||
__int16 nextItem;
|
/* 001A */ uint16_t next_item;
|
||||||
__int16 nextActive;
|
/* 001C */ uint16_t next_active;
|
||||||
__int16 speed;
|
/* 001E */ uint16_t speed;
|
||||||
__int16 fallSpeed;
|
/* 0020 */ uint16_t fall_speed;
|
||||||
__int16 hitPoints;
|
/* 0022 */ uint16_t hit_points;
|
||||||
__int16 boxNumber;
|
/* 0024 */ uint16_t box_number;
|
||||||
__int16 timer;
|
/* 0026 */ uint16_t timer;
|
||||||
unsigned __int16 flags; // see IFL_* defines
|
/* 0028 */ uint16_t flags;
|
||||||
__int16 shade1;
|
/* 002A */ uint16_t shade1;
|
||||||
void *data;
|
/* 002C */ void *data;
|
||||||
PHD_3DPOS pos;
|
/* 0030 */ PHD_3DPOS pos;
|
||||||
unsigned __int16 moreFlags;
|
/* 0042 */ uint16_t more_flags;
|
||||||
|
/* 0044 end */
|
||||||
} ITEM_INFO;
|
} ITEM_INFO;
|
||||||
|
|
||||||
typedef struct LaraInfo_t {
|
typedef struct {
|
||||||
__int16 itemNumber;
|
/* 0000 */ uint16_t *frame_base;
|
||||||
__int16 gunStatus;
|
/* 0004 */ uint16_t frame_number;
|
||||||
__int16 field_4;
|
/* 0006 */ uint16_t lock;
|
||||||
__int16 field_6;
|
/* 0008 */ PHD_ANGLE y_rot;
|
||||||
__int16 field_8;
|
/* 000A */ PHD_ANGLE x_rot;
|
||||||
__int16 waterStatus;
|
/* 000C */ PHD_ANGLE z_rot;
|
||||||
__int16 field_C;
|
/* 000E */ uint16_t flash_gun;
|
||||||
__int16 field_E;
|
/* 0010 end */
|
||||||
__int16 field_10;
|
} LARA_ARM;
|
||||||
__int16 air;
|
|
||||||
__int16 field_14;
|
typedef struct {
|
||||||
__int16 field_16;
|
/* 0000 */ int32_t ammo;
|
||||||
__int16 field_18;
|
/* 0004 */ int32_t hit;
|
||||||
__int16 field_1A;
|
/* 0008 */ int32_t miss;
|
||||||
__int32 field_1C;
|
/* 000C end */
|
||||||
__int32 field_20;
|
} AMMO_INFO;
|
||||||
__int8 field_24[60];
|
|
||||||
__int32 field_60;
|
typedef struct {
|
||||||
__int8 field_64[4];
|
/* 0000 */ int16_t exit_box;
|
||||||
__int32 field_68;
|
/* 0002 */ uint16_t search_number;
|
||||||
__int32 field_6C;
|
/* 0004 */ int16_t next_expansion;
|
||||||
__int32 field_70;
|
/* 0006 */ int16_t box_number;
|
||||||
__int32 field_74;
|
/* 0008 end */
|
||||||
__int8 field_78[6];
|
} BOX_NODE;
|
||||||
__int16 field_7E;
|
|
||||||
__int8 field_80[6];
|
typedef struct {
|
||||||
__int16 field_86;
|
/* 0000 */ BOX_NODE *node;
|
||||||
__int8 field_88[6];
|
/* 0004 */ int16_t head;
|
||||||
__int16 field_8E;
|
/* 0006 */ int16_t tail;
|
||||||
__int8 field_90[6];
|
/* 0008 */ uint16_t search_number;
|
||||||
__int16 field_96;
|
/* 000A */ uint16_t block_mask;
|
||||||
__int32 field_98;
|
/* 000C */ int16_t step;
|
||||||
__int8 field_9C[8];
|
/* 000E */ int16_t drop;
|
||||||
__int32 field_A4;
|
/* 0010 */ int16_t fly;
|
||||||
__int8 field_A8[8];
|
/* 0012 */ int16_t zone_count;
|
||||||
__int32 field_B0;
|
/* 0014 */ int16_t target_box;
|
||||||
__int8 field_B4[8];
|
/* 0016 */ int16_t required_box;
|
||||||
__int32 field_BC;
|
/* 0018 */ PHD_VECTOR target;
|
||||||
__int8 field_C0[8];
|
/* 001E end */
|
||||||
__int8 field_C8[8];
|
} LOT_INFO;
|
||||||
__int16 field_D0;
|
|
||||||
__int16 field_D2;
|
typedef struct {
|
||||||
__int16 field_D4;
|
/* 0000 */ int16_t item_number;
|
||||||
__int16 field_D6;
|
/* 0002 */ int16_t gun_status;
|
||||||
__int16 field_D8;
|
/* 0004 */ int16_t gun_type;
|
||||||
|
/* 0006 */ int16_t request_gun_type;
|
||||||
|
/* 0008 */ int16_t calc_fallspeed;
|
||||||
|
/* 000A */ int16_t water_status;
|
||||||
|
/* 000C */ int16_t pose_count;
|
||||||
|
/* 000E */ int16_t hit_frames;
|
||||||
|
/* 0010 */ int16_t hit_direction;
|
||||||
|
/* 0012 */ int16_t air;
|
||||||
|
/* 0014 */ int16_t dive_count;
|
||||||
|
/* 0016 */ int16_t death_count;
|
||||||
|
/* 0018 */ int16_t current_active;
|
||||||
|
/* 001A */ int16_t spaz_effect_count;
|
||||||
|
/* 001C */ UNKNOWN_STRUCT *spaz_effect;
|
||||||
|
/* 0020 */ int32_t mesh_effects;
|
||||||
|
/* 0024 */ int16_t *mesh_ptrs[15];
|
||||||
|
/* 0060 */ ITEM_INFO *target;
|
||||||
|
/* 0064 */ PHD_ANGLE target_angles[2];
|
||||||
|
/* 0068 */ int16_t turn_rate;
|
||||||
|
/* 006A */ int16_t move_angle;
|
||||||
|
/* 006C */ int16_t head_y_rot;
|
||||||
|
/* 006E */ int16_t head_x_rot;
|
||||||
|
/* 0070 */ int16_t head_z_rot;
|
||||||
|
/* 0072 */ int16_t torso_x_rot;
|
||||||
|
/* 0074 */ int16_t torso_y_rot;
|
||||||
|
/* 0076 */ int16_t torso_z_rot;
|
||||||
|
/* 0078 */ LARA_ARM left_arm;
|
||||||
|
/* 0088 */ LARA_ARM right_arm;
|
||||||
|
/* 0098 */ AMMO_INFO pistols;
|
||||||
|
/* 00A4 */ AMMO_INFO magnums;
|
||||||
|
/* 00B0 */ AMMO_INFO uzis;
|
||||||
|
/* 00BC */ AMMO_INFO shotgun;
|
||||||
|
/* 00C8 */ LOT_INFO LOT;
|
||||||
|
/* 00E6 end */
|
||||||
} LARA_INFO;
|
} LARA_INFO;
|
||||||
|
|
||||||
#pragma pop
|
#pragma pop
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue