12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139 |
-
-
- #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
|