Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| trs:prjfile [2017/03/24 21:11] – created zdimension | trs:prjfile [2019/08/09 06:11] (current) – stohrendorf | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== TRLE .PRJ file format ====== | ====== TRLE .PRJ file format ====== | ||
| + | ===== Entire format ===== | ||
| + | |||
| + | <code cpp> | ||
| + | uint8_t signature[8]; | ||
| + | uint32_t version; // Version of RoomEdit (49/0x31 for standard TRLE, 51/0x33 for leaked TR5 RoomEdit) | ||
| + | |||
| + | uint32_t numRooms; | ||
| + | PRJ_Room rooms[numRooms]; | ||
| + | |||
| + | uint32_t numObjects; | ||
| + | uint32_t maxObjects; | ||
| + | uint32_t unusedObjects[2000]; | ||
| + | |||
| + | uint32_t numLights; | ||
| + | uint32_t unusedLights[768]; | ||
| + | |||
| + | uint32_t numTriggers; | ||
| + | uint32_t unusedTriggers[512]; | ||
| + | |||
| + | uint8_t textureFile[]; | ||
| + | |||
| + | #if TextureFile != " | ||
| + | uint32_t numTextInfo; | ||
| + | PRJ_TextInfo textInfo[numTextInfo]; | ||
| + | #endif | ||
| + | |||
| + | uint8_t objectFile[]; | ||
| + | |||
| + | uint32_t numObjectData; | ||
| + | PRJ_ObjectData objectData[numObjectData]; | ||
| + | |||
| + | uint32_t numAnimTextures; | ||
| + | uint32_t unusedAnimTextures[40]; | ||
| + | uint32_t animTextures[256]; | ||
| + | PRJ_AnimText animRanges[40]; | ||
| + | |||
| + | uint8_t terrain[256]; | ||
| + | uint8_t bump[256]; | ||
| + | </ | ||
| + | |||
| + | '' | ||
| + | * 0 -- Mud | ||
| + | * 1 -- Snow | ||
| + | * 2 -- Sand | ||
| + | * 3 -- Gravel | ||
| + | * 4 -- Ice | ||
| + | * 5 -- Water | ||
| + | * 6 -- Stone | ||
| + | * 7 -- Wood | ||
| + | * 8 -- Metal | ||
| + | * 9 -- Marble | ||
| + | * 10 -- Grass | ||
| + | * 11 -- Concrete | ||
| + | * 12 -- OldWood | ||
| + | * 13 -- OldMetal | ||
| + | |||
| + | '' | ||
| + | * 0 -- None | ||
| + | * 1 -- Level 1 | ||
| + | * 2 -- Level 2 | ||
| + | |||
| + | ===== Structures ===== | ||
| + | |||
| + | //not in order, todo// | ||
| + | |||
| + | ==== Texture info ==== | ||
| + | |||
| + | <code cpp> | ||
| + | struct PRJ_TextInfo // 8 bytes | ||
| + | { | ||
| + | uint8_t x; | ||
| + | uint8_t y; | ||
| + | uint16_t atlas; | ||
| + | uint8_t flipX; | ||
| + | uint8_t xSize; | ||
| + | uint8_t flipY; | ||
| + | uint8_t ySize; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ==== Animation range ==== | ||
| + | |||
| + | <code cpp> | ||
| + | struct PRJ_AnimText // 12 bytes | ||
| + | { | ||
| + | uint32_t defined; | ||
| + | uint32_t firstAtlas; | ||
| + | uint32_t lastAtlas; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== 32-bit color ==== | ||
| + | |||
| + | <code cpp> | ||
| + | struct PRJ_Color4 // 4 bytes | ||
| + | { | ||
| + | uint32_t red; | ||
| + | uint32_t green; | ||
| + | uint32_t blue; | ||
| + | uint32_t alpha; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Camera ==== | ||
| + | |||
| + | <code cpp> | ||
| + | struct PRJ_Camera // 40 bytes | ||
| + | { | ||
| + | uint16_t xPos; | ||
| + | uint16_t zPos; | ||
| + | int32_t unknown1; | ||
| + | int32_t yPos; | ||
| + | int8_t fov; | ||
| + | int8_t camID; | ||
| + | int32_t timer; | ||
| + | int32_t worldZpos; | ||
| + | int32_t worldYpos; | ||
| + | int32_t worldXpos; | ||
| + | int16_t xRot; | ||
| + | int16_t yRot; | ||
| + | int16_t zRot; // roll | ||
| + | int16_t speed; | ||
| + | int16_t flags; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Sink ==== | ||
| + | |||
| + | <code cpp> | ||
| + | struct PRJ_Sink | ||
| + | { | ||
| + | int16_t xPos; | ||
| + | int16_t zPos; | ||
| + | int16_t xSize; | ||
| + | int16_t zSize; | ||
| + | uint16_t yPos; | ||
| + | uint16_t room; | ||
| + | uint16_t slot; | ||
| + | uint16_t timer; | ||
| + | PRJObjectOrientation orientation; | ||
| + | int32_t worldZpos; | ||
| + | int32_t worldYpos; | ||
| + | int32_t worldXpos; | ||
| + | } | ||
| + | </ | ||
