1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138 |
-
-
- #ifndef _TOMBRAIDERDATA_H_
- #define _TOMBRAIDERDATA_H_
-
- #include <cstdint>
-
- #ifdef _MSC_VER
- #pragma pack(push, tr2_h, 1)
- #endif
-
- #define TR_SOUND_FOOTSTEP0 1
- #define TR_SOUND_F_PISTOL 12
-
- #define TR_ANIMATION_RUN 0
- #define TR_ANIMATION_STAND 11
- #define TR_ANIMATION_TURN_L 12
- #define TR_ANIMATION_TURN_R 13
- #define TR_ANIMATION_HIT_WALL_FRONT 53
- #define TR_ANIMATION_SWIM_IDLE 87
- #define TR_ANIMATION_SWIM 86
- #define TR_ANIMATION_SWIM_L 143
- #define TR_ANIMATION_SWIM_R 144
- #define TR_ANIMATION_GRAB_LEDGE 96
- #define TR_ANIMATION_PULLING_UP 97
-
- typedef enum {
- TR_VERSION_UNKNOWN,
- TR_VERSION_1,
- TR_VERSION_2,
- TR_VERSION_3,
- TR_VERSION_4,
- TR_VERSION_5
- } tr2_version_type;
-
- typedef enum {
- TR_FREAD_NORMAL = 0,
- TR_FREAD_COMPRESSED
- } tr_fread_mode_t;
-
- typedef enum {
- tombraiderLight_typeDirectional = 1,
- tombraiderLight_typeSpot = 2,
- tombraiderLight_typePoint = 3
- } tombraiderLightType;
-
- typedef enum {
- tombraiderLight_useCutoff = 1,
- tombraiderLight_useAttenuation = 2
- } tombraiderLightFlags;
-
- typedef enum {
- tombraiderRoom_underWater = 1
- } tombraiderRoomFlags;
-
- typedef enum {
- tombraiderSector_wall = 1
- } tombraiderSectorFlags;
-
- typedef enum {
- tombraiderFace_Alpha = (1 << 0),
- tombraiderFace_Colored = (1 << 1),
- tombraiderFace_PartialAlpha = (1 << 2)
- } tombraiderFace_Flags;
-
- enum TR4_Objects {
- TR4_LARA = 0,
- TR4_PISTOLS_ANIM = 1,
- TR4_UZI_ANIM = 2,
- TR4_SHOTGUN_ANIM = 3,
- TR4_CROSSBOW_ANIM = 4,
- TR4_GRENADE_GUN_ANIM = 5,
- TR4_SIXSHOOTER_ANIM = 6,
- TR4_FLARE_ANIM = 7,
- TR4_LARA_SKIN = 8,
- TR4_LARA_SKIN_JOINTS = 9,
- TR4_LARA_SCREAM = 10,
- TR4_LARA_CROSSBOW_LASER = 11,
- TR4_LARA_REVOLVER_LASER = 12,
- TR4_LARA_HOLSTERS = 13,
- TR4_LARA_HOLSTERS_PISTOLS = 14,
- TR4_LARA_HOLSTERS_UZIS = 15,
- TR4_LARA_HOLSTERS_SIXSHOOTER = 16,
- TR4_LARA_SPEECH_HEAD1 = 17,
- TR4_LARA_SPEECH_HEAD2 = 18,
- TR4_LARA_SPEECH_HEAD3 = 19,
- TR4_LARA_SPEECH_HEAD4 = 20
- };
-
-
- typedef struct {
- unsigned char r;
- unsigned char g;
- unsigned char b;
- } __attribute__ ((packed)) tr2_colour_t;
-
-
- typedef struct {
- short x;
- short y;
- short z;
- } __attribute__ ((packed)) tr2_vertex_t;
-
-
- typedef struct {
- unsigned short vertices[4];
- unsigned short texture;
- } __attribute__ ((packed)) tr2_quad_t;
-
- typedef struct {
- unsigned short vertices[4];
- unsigned short texture;
- unsigned short lighting;
-
-
- } __attribute__ ((packed)) tr4_quad_t;
-
-
- typedef struct {
- unsigned short vertices[3];
- unsigned short texture;
- } __attribute__ ((packed)) tr2_tri_t;
-
- typedef struct {
- unsigned short vertices[3];
- unsigned short texture;
- unsigned short lighting;
- } __attribute__ ((packed)) tr4_tri_t;
-
-
- typedef struct {
- unsigned char tile[256 * 256];
- } __attribute__ ((packed)) tr2_textile8_t;
-
-
- typedef struct {
- unsigned short tile[256 * 256];
- } __attribute__ ((packed)) tr2_textile16_t;
-
-
- typedef struct {
- unsigned int tile[256 * 256];
- } __attribute__ ((packed)) tr2_textile32_t;
-
-
- typedef struct {
- int x;
- int z;
- int y_bottom;
- int y_top;
- } __attribute__ ((packed)) tr2_room_info_t;
-
-
- typedef struct {
- unsigned short adjoining_room;
- tr2_vertex_t normal;
- tr2_vertex_t vertices[4];
- } __attribute__ ((packed)) tr2_room_portal_t;
-
-
- typedef struct {
- unsigned short fd_index;
- unsigned short box_index;
- unsigned char room_below;
- char floor;
- unsigned char room_above;
- char ceiling;
- } __attribute__ ((packed)) tr2_room_sector_t;
-
-
- typedef struct {
- int x;
- int y;
- int z;
- unsigned short intensity1;
- unsigned short intensity2;
- unsigned int fade1;
- unsigned int fade2;
- } __attribute__ ((packed)) tr2_room_light_t;
-
- typedef struct {
- int xPosition;
- int yPosition;
- int zPosition;
- tr2_colour_t color;
- unsigned char lightType;
- unsigned char unknown;
- unsigned char intensity;
- float in;
- float out;
- float length;
- float cutoff;
- float xDir, yDir, zDir;
- } __attribute__ ((packed)) tr4_room_light_t;
-
-
- typedef struct {
- tr2_vertex_t vertex;
- short lighting1;
-
-
- unsigned short attributes;
-
-
- short lighting2;
- } __attribute__ ((packed)) tr2_vertex_room_t;
-
-
- typedef struct {
- short vertex;
- short texture;
- } __attribute__ ((packed)) tr2_room_sprite_t;
-
-
- typedef struct tr2_room_data_s {
- short num_vertices;
- tr2_vertex_room_t *vertices;
- short num_rectangles;
- tr2_quad_t *rectangles;
- short num_triangles;
- tr2_tri_t *triangles;
- short num_sprites;
- tr2_room_sprite_t *sprites;
- } __attribute__ ((packed)) tr2_room_data_t;
-
-
- typedef struct {
- int x;
- int y;
- int z;
- unsigned short rotation;
- unsigned short intensity1;
- unsigned short intensity2;
- unsigned short object_id;
- } __attribute__ ((packed)) tr2_room_staticmesh_t;
-
-
-
- typedef struct {
- tr2_room_info_t info;
- unsigned int num_data_words;
- unsigned char *data;
- tr2_room_data_t room_data;
- unsigned short num_portals;
- tr2_room_portal_t *portals;
- unsigned short num_zsectors;
- unsigned short num_xsectors;
- tr2_room_sector_t *sector_list;
- short intensity1;
- short intensity2;
- short light_mode;
- unsigned short num_lights;
- tr2_room_light_t *lights;
- unsigned short num_static_meshes;
- tr2_room_staticmesh_t *static_meshes;
- short alternate_room;
- short flags;
-
- tr2_colour_t room_light_colour;
- tr4_room_light_t *tr4Lights;
- } __attribute__ ((packed)) tr2_room_t;
-
-
- typedef struct {
- unsigned int frame_offset;
- unsigned char frame_rate;
- unsigned char frame_size;
- short state_id;
- short unknown1;
- short unknown2;
- short unknown3;
- short unknown4;
- unsigned short frame_start;
- unsigned short frame_end;
- unsigned short next_animation;
- unsigned short next_frame;
- unsigned short num_state_changes;
- unsigned short state_change_offset;
- unsigned short num_anim_commands;
- unsigned short anim_command;
- } __attribute__ ((packed)) tr2_animation_t;
-
-
- typedef struct {
- unsigned int frame_offset;
- unsigned char frame_rate;
- unsigned char frame_size;
- unsigned short state_id;
- short unknown;
- short speed;
- unsigned short accel_lo;
- short accel_hi;
- unsigned char unknown2[8];
- unsigned short frame_start;
- unsigned short frame_end;
- unsigned short next_animation;
- unsigned short next_frame;
- unsigned short num_state_changes;
- unsigned short state_change_offset;
- unsigned short num_anim_commands;
- unsigned short anim_command;
- } __attribute__ ((packed)) tr4_animation_t;
-
-
- typedef struct {
- unsigned short state_id;
- unsigned short num_anim_dispatches;
- unsigned short anim_dispatch;
- } __attribute__ ((packed)) tr2_state_change_t;
-
-
- typedef struct {
- short low;
- short high;
- short next_animation;
- short next_frame;
- } __attribute__ ((packed)) tr2_anim_dispatch_t;
-
-
- typedef struct {
- short value;
- } __attribute__ ((packed)) tr2_anim_command_t;
-
-
- typedef struct {
- int flags;
- int x;
- int y;
- int z;
- } __attribute__ ((packed)) tr2_meshtree_t;
-
-
- typedef struct {
- unsigned int object_id;
- unsigned short num_meshes;
- unsigned short starting_mesh;
- unsigned int mesh_tree;
- unsigned int frame_offset;
- unsigned short animation;
- } __attribute__ ((packed)) tr2_moveable_t;
-
-
- typedef struct {
- unsigned int object_id;
- unsigned short starting_mesh;
- tr2_vertex_t bounding_box[2][2];
- unsigned short flags;
- } __attribute__ ((packed)) tr2_staticmesh_t;
-
-
- typedef struct {
- unsigned char xcoordinate;
- unsigned char xpixel;
- unsigned char ycoordinate;
- unsigned char ypixel;
- } __attribute__ ((packed)) tr2_object_texture_vert_t;
-
-
- typedef struct {
- unsigned short transparency_flags;
-
- unsigned short tile;
- tr2_object_texture_vert_t vertices[4];
- } __attribute__ ((packed)) tr2_object_texture_t;
-
-
- typedef struct {
- unsigned short tile;
- unsigned char x;
- unsigned char y;
- unsigned short width;
- unsigned short height;
- short left_side;
- short top_side;
- short right_side;
- short bottom_side;
- } __attribute__ ((packed)) tr2_sprite_texture_t;
-
-
- typedef struct {
- int object_id;
- short negative_length;
- short offset;
- } __attribute__ ((packed)) tr2_sprite_sequence_t;
-
-
- typedef struct {
- tr2_vertex_t centre;
-
- int collision_size;
- short num_vertices;
- tr2_vertex_t *vertices;
- short num_normals;
- tr2_vertex_t *normals;
- short *mesh_lights;
- short num_textured_rectangles;
- tr2_quad_t *textured_rectangles;
- short num_textured_triangles;
- tr2_tri_t *textured_triangles;
- short num_coloured_rectangles;
- tr2_quad_t *coloured_rectangles;
- short num_coloured_triangles;
- tr2_tri_t *coloured_triangles;
- } __attribute__ ((packed)) tr2_mesh_t;
-
-
- typedef struct {
- tr2_vertex_t vector[3];
- int num_words;
- unsigned short *words;
- } __attribute__ ((packed)) tr2_frame_t;
-
-
- typedef struct {
- short object_id;
- short room;
- int x;
- int y;
- int z;
- short angle;
- short intensity1;
- short intensity2;
- short flags;
- } __attribute__ ((packed)) tr2_item_t;
-
-
- typedef struct {
- int x;
- int y;
- int z;
- unsigned short sound_id;
- unsigned short flags;
- } __attribute__ ((packed)) tr2_sound_source_t;
-
-
- typedef struct {
- unsigned char zmin;
- unsigned char zmax;
- unsigned char xmin;
- unsigned char xmax;
- short true_floor;
- short overlap_index;
- } __attribute__ ((packed)) tr2_box_t;
-
-
- typedef struct {
- short num_texture_ids;
- short *texture_list;
- } __attribute__ ((packed)) tr2_animated_texture_t;
-
-
- typedef struct {
- int x;
- int y;
- int z;
- short room;
- unsigned short unknown1;
- } __attribute__ ((packed)) tr2_camera_t;
-
-
- typedef struct {
- int pos[6];
- unsigned char index[2];
- unsigned short unknown[5];
- int id;
- } __attribute__ ((packed)) tr4_extra_camera_t;
-
-
- typedef struct {
- short sample;
- short volume;
- short sound_range;
- short flags;
-
- } __attribute__ ((packed)) tr2_sound_details_t;
-
-
- typedef struct {
- short roty;
- short rotz;
- short rotz2;
- short posz;
- short posy;
- short posx;
- short unknown1;
- short rotx;
- } __attribute__ ((packed)) tr2_cinematic_frame_t;
-
-
- typedef struct {
- unsigned short int object_id;
-
- unsigned short int room;
- int x, y, a;
- unsigned short int ocb;
- unsigned short int flags;
-
- int angle;
- } __attribute__ ((packed)) tr4_ai_object_t;
-
-
- typedef struct {
- unsigned short attribute;
- unsigned short tile;
- unsigned short flags;
- tr2_object_texture_vert_t vertices[4];
- unsigned int unknown1, unknown2;
- unsigned int xsize, ysize;
- } __attribute__ ((packed)) tr4_object_texture_t;
-
-
- typedef struct {
- uint32_t numLayerVertices;
- uint16_t unknownL1;
- uint16_t numLayerRectangles;
- uint16_t numLayerTriangles;
- uint16_t unknownL2;
-
- uint16_t filler;
- uint16_t filler2;
-
- float layerBoundingBoxX1;
- float layerBoundingBoxY1;
- float layerBoundingBoxZ1;
- float layerBoundingBoxX2;
- float layerBoundingBoxY2;
- float layerBoundingBoxZ2;
- uint32_t filler3;
- uint32_t unknownL6;
- uint32_t unknownL7;
- uint32_t unknownL8;
- } tr5_room_layer_t;
-
-
- typedef struct {
- uint16_t vertices[4];
-
- uint16_t texture;
-
- uint16_t unknownF4;
- } tr5_face4_t;
-
-
- typedef struct {
- uint16_t vertices[3];
-
- uint16_t texture;
-
- uint16_t unknownF3;
- } tr5_face3_t;
-
-
- typedef struct {
- float x;
- float y;
- float z;
- float nx;
- float ny;
- float nz;
- uint32_t vColor;
- } tr5_vertex_t;
-
-
- typedef struct {
- tr5_face4_t *quads;
- tr5_face3_t *tris;
- tr5_vertex_t *verts;
- } tr5_room_geometry_t;
-
-
- typedef struct {
- float x;
- float y;
- float z;
-
-
-
- float red;
- float green;
- float blue;
-
- uint32_t seperator;
-
- float input;
- float output;
-
-
-
- float radInput;
- float radOutput;
-
-
- float range;
-
- float directionVectorX;
- float directionVectorY;
- float directionVectorZ;
-
-
-
- int32_t x2;
- int32_t y2;
- int32_t z2;
-
-
- int32_t directionVectorX2;
- int32_t directionVectorY2;
- int32_t directionVectorZ2;
-
-
- uint8_t lightType;
-
- uint8_t seperator2[3];
- } tr5_light_t;
-
-
- typedef struct {
- uint32_t checkXELA;
- uint32_t roomDataSize;
-
- uint32_t seperator;
- uint32_t endSDOffset;
-
- uint32_t startSDOffset;
-
- uint32_t seperator2;
- uint32_t endPortalOffset;
-
- int32_t x;
- int32_t seperator3;
- int32_t z;
- int32_t yBottom;
- int32_t yTop;
- uint16_t numZSectors;
- uint16_t numXSectors;
- uint32_t roomAmbientColor;
- uint16_t numRoomLights;
- uint16_t numStaticMeshes;
- uint16_t unknownR1;
- uint16_t unknownR2;
- uint32_t filler;
- uint32_t filler2;
- uint32_t seperator4;
- uint32_t seperator5;
- unsigned char seperator6[6];
- uint16_t roomFlag;
- uint16_t unknownR5;
- unsigned char seperator7[10];
- uint32_t seperator8;
- uint32_t unknownR6;
- float roomX;
-
- uint32_t seperator9;
- float roomZ;
-
- uint32_t seperator10;
- uint32_t seperator11;
- uint32_t seperator12;
- uint32_t seperator13;
- uint32_t seperator14;
- uint32_t seperator15;
- uint32_t numRoomTriangles;
- uint32_t numRoomRectangles;
- uint32_t seperator16;
- uint32_t lightSize;
- uint32_t numTotalRoomLights;
- uint32_t unknownR7;
- int32_t unknownR8;
-
- int32_t lyBottom;
- uint32_t numLayers;
- uint32_t layerOffset;
-
- uint32_t verticesOffset;
-
- uint32_t polyOffset;
-
- uint32_t polyOffset2;
- uint32_t verticesSize;
- uint32_t seperator17;
- uint32_t seperator18;
- uint32_t seperator19;
- uint32_t seperator20;
- tr5_light_t *lights;
-
- tr2_room_sector_t *sectors;
-
- uint16_t numDoors;
- tr2_room_portal_t *doors;
-
- uint16_t seperator21;
- tr2_room_staticmesh_t *meshes;
-
- tr5_room_layer_t *layers;
-
- tr5_room_geometry_t *faces;
-
-
- tr5_vertex_t *vertices;
-
-
- } tr5_room_t;
-
-
- typedef struct {
- uint8_t xCoordinate;
-
- uint8_t xPixel;
- uint8_t yCoordinate;
-
- uint8_t yPixel;
- } tr5_object_texture_vertex_t;
-
-
- typedef struct {
- uint16_t attribute;
- uint32_t tile;
-
- tr5_object_texture_vertex_t vertices[4];
- uint32_t uv1;
- uint32_t uv2;
- uint32_t xSize;
- uint32_t ySize;
- uint16_t seperator;
- } tr5_object_texture_t;
-
-
- typedef struct {
- int32_t cameraX;
- int32_t cameraY;
- int32_t cameraZ;
- int32_t targetX;
- int32_t targetY;
- int32_t targetZ;
- int8_t sequence;
- int8_t cameraNumber;
- uint16_t fov;
- uint16_t roll;
- uint16_t timer;
- uint16_t speed;
- uint16_t flags;
- uint32_t room;
- } tr5_flyby_camera_t;
-
-
- typedef struct {
- uint32_t objectId;
- uint16_t numMeshes;
- uint16_t startingMesh;
- uint32_t meshTree;
- uint32_t frameOffset;
- uint16_t animation;
- uint16_t filler;
- } tr5_moveable_t;
-
- typedef struct {
- tr2_vertex_t center;
- uint8_t unknown1[4];
- int16_t numVertices;
- tr2_vertex_t *vertices;
- int16_t numNormals;
- tr2_vertex_t *normals;
-
- int16_t numTexturedRectangles;
- tr5_face4_t *texturedRectangles;
- int16_t numTexturedTriangles;
- tr5_face3_t *texturedTriangles;
- } tr5_mesh_t;
-
-
- typedef struct {
- uint32_t FrameOffset;
- uint8_t FrameRate;
- uint8_t FrameSize;
- uint16_t StateId;
- int16_t Unknown;
- int16_t Speed;
- uint16_t AccelLo;
- int16_t AccelHi;
- uint8_t AUnknown[8];
- uint16_t FrameStart;
- uint16_t FrameEnd;
- uint16_t NextAnimation;
- uint16_t NextFrame;
- uint16_t NumStateChanges;
- uint16_t StateChangeOffset;
- uint16_t NumAnimCommands;
- uint16_t AnimCommand;
- } tr5_animation_t;
-
- typedef struct {
- unsigned int unknown[24];
- } tr5_cinematic_frame_t;
-
- #ifdef _MSC_VER
- #pragma pack(pop, tr2_h, 1)
- #endif
-
- #endif
|