123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143 |
-
-
- #ifndef _TOMBRAIDERDATA_H_
- #define _TOMBRAIDERDATA_H_
-
- #include <cstdint>
-
- #ifdef WIN32
-
- #define __attribute__(packed)
-
-
- #define TR2_H 1
- #pragma pack(push, tr2_h, 1)
- #endif
-
- #define TR_SOUND_FOOTSTEP0 1
- #define TR_SOUND_F_PISTOL 12
-
- #define TR_ANIAMTION_RUN 0
- #define TR_ANIAMTION_STAND 11
- #define TR_ANIAMTION_TURN_L 12
- #define TR_ANIAMTION_TURN_R 13
- #define TR_ANIAMTION_HIT_WALL_FRONT 53
- #define TR_ANIAMTION_SWIM_IDLE 87
- #define TR_ANIAMTION_SWIM 86
- #define TR_ANIAMTION_SWIM_L 143
- #define TR_ANIAMTION_SWIM_R 144
- #define TR_ANIAMTION_GRAB_LEDGE 96
- #define TR_ANIAMTION_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 WIN32
- #pragma pack(pop, tr2_h, 1)
- #endif
-
- #endif
|