Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
trs:file_formats [2017/11/17 12:20]
stohrendorf
trs:file_formats [2019/08/30 08:41] (current)
popov72 Moved the Separator[6] bytes inside the geometry section for TR4 format
Line 14: Line 14:
 <code cpp> <code cpp>
 uint32_t Version; // version (4 bytes) uint32_t Version; // version (4 bytes)
-uint32_t ​NumTextiles; // number of texture ​tiles (4 bytes) +uint32_t ​NumImages; // number of texture ​images ​(4 bytes) 
-tr_textile8 Textile8[NumTextiles]; // 8-bit (palettized) ​textiles ​(NumTextiles ​* 65536 bytes)+tr_image8 Images8[NumImages]; // 8-bit (palettized) ​images ​(NumImages ​* 65536 bytes)
 uint32_t Unused; // 32-bit unused value (4 bytes) uint32_t Unused; // 32-bit unused value (4 bytes)
 uint16_t NumRooms; // number of rooms (2 bytes) uint16_t NumRooms; // number of rooms (2 bytes)
Line 92: Line 92:
 tr_colour Palette[256];​ // 8-bit palette (768 bytes) tr_colour Palette[256];​ // 8-bit palette (768 bytes)
 tr_colour4 Palette16[256];​ //  (1024 bytes) tr_colour4 Palette16[256];​ //  (1024 bytes)
-uint32_t ​NumTextiles; // number of texture ​tiles (4 bytes) +uint32_t ​NumImages; // number of texture ​images ​(4 bytes) 
-tr_textile8 Textile8[NumTextiles]; // 8-bit (palettized) ​textiles ​(NumTextiles ​* 65536 bytes) +tr_teximage8 Images8[NumImages]; // 8-bit (palettized) ​images ​(NumImages ​* 65536 bytes) 
-tr_textile16 Textile16[NumTextiles]; // 16-bit (ARGB) ​textiles ​(NumTextiles ​* 131072 bytes)+tr_teximage16 Images16[NumImages]; // 16-bit (ARGB) ​images ​(NumImages ​* 131072 bytes)
 uint32_t Unused; // 32-bit unused value (4 bytes) uint32_t Unused; // 32-bit unused value (4 bytes)
 uint16_t NumRooms; // number of rooms (2 bytes) uint16_t NumRooms; // number of rooms (2 bytes)
Line 163: Line 163:
 tr_colour Palette[256];​ // 8-bit palette (768 bytes) tr_colour Palette[256];​ // 8-bit palette (768 bytes)
 tr_colour4 Palette16[256];​ //  (1024 bytes) tr_colour4 Palette16[256];​ //  (1024 bytes)
-uint32_t ​NumTextiles; // number of texture ​tiles (4 bytes) +uint32_t ​NumImages; // number of texture ​images ​(4 bytes) 
-tr_textile8 Textile8[NumTextiles]; // 8-bit (palettized) ​textiles ​(NumTextiles ​* 65536 bytes) +tr_image8 Images8[NumImages]; // 8-bit (palettized) ​images ​(NumImages ​* 65536 bytes) 
-tr_textile16 Textile16[NumTextiles]; // 16-bit (ARGB) ​textiles ​(NumTextiles ​* 131072 bytes) (absent from TR1)+tr_image16 Images16[NumImages]; // 16-bit (ARGB) ​images ​(NumImages ​* 131072 bytes) (absent from TR1)
 // "​VICT.TR2"​ stops here, nothing after // "​VICT.TR2"​ stops here, nothing after
 uint32_t Unused; // 32-bit unused value (4 bytes) uint32_t Unused; // 32-bit unused value (4 bytes)
Line 233: Line 233:
 <code cpp> <code cpp>
 uint32_t Version; // version (4 bytes) uint32_t Version; // version (4 bytes)
-uint16_t ​NumRoomTextiles; // number of non bumped ​room tiles (2 bytes) +uint16_t ​NumRoomImages; // number of non.bumpmapped ​room images ​(2 bytes) 
-uint16_t ​NumObjTextiles; // number of object ​tiles (2 bytes) +uint16_t ​NumObjImages; // number of object ​images ​(2 bytes) 
-uint16_t ​NumBumpTextiles; // number of bumped ​room tiles (2 bytes) +uint16_t ​NumBumpmaps; // number of bump-mapped ​room images ​(2 bytes) 
-uint32_t ​Textile32_UncompSize; // uncompressed size (in bytes) of the 32-bit textures chunk (4 bytes) +uint32_t ​Image32_UncompSize; // uncompressed size (in bytes) of the 32-bit textures chunk (4 bytes) 
-uint32_t ​Textile32_CompSize; // compressed size (in bytes) of the 32-bit textures chunk (4 bytes) +uint32_t ​Image32_CompSize; // compressed size (in bytes) of the 32-bit textures chunk (4 bytes) 
-uint8_t ​Textile32_Compressed[Textile32_CompSize]; // zlib-compressed 32-bit textures chunk (Textile32_CompSize ​bytes)+uint8_t ​Image32_Compressed[Image32_CompSize]; // zlib-compressed 32-bit textures chunk (Image32_CompSize ​bytes)
 { {
-    ​tr4_textile32 Textile32[NumRoomTextiles ​NumObjTextiles ​NumBumpTextiles];+    ​tr4_image32 Image32[NumRoomImages ​NumObjImages ​NumBumpmaps];
 } }
-uint32_t ​Textile16_UncompSize; // uncompressed size (in bytes) of the 16-bit textures chunk (4 bytes) +uint32_t ​Image16_UncompSize; // uncompressed size (in bytes) of the 16-bit textures chunk (4 bytes) 
-uint32_t ​Textile16_CompSize; // compressed size (in bytes) of the 16-bit textures chunk (4 bytes) +uint32_t ​Image16_CompSize; // compressed size (in bytes) of the 16-bit textures chunk (4 bytes) 
-uint8_t ​Textile16_Compressed[Textile32_CompSize]; // zlib-compressed 16-bit textures chunk (Textile16_CompSize ​bytes)+uint8_t ​Image16_Compressed[Image32_CompSize]; // zlib-compressed 16-bit textures chunk (Image16_CompSize ​bytes)
 { {
-    ​tr_textile16 Textile16[NumRoomTextiles ​NumObjTextiles ​NumBumpTextiles];+    ​tr_image16 Image16[NumRoomImages ​NumObjImages ​NumBumpmaps];
 } }
-uint32_t ​Textile32Misc_UncompSize; // uncompressed size (in bytes) of the 32-bit misc textures chunk (4 bytes), should always be 524288 +uint32_t ​Image32Misc_UncompSize; // uncompressed size (in bytes) of the 32-bit misc textures chunk (4 bytes), should always be 524288 
-uint32_t ​Textile32Misc_CompSize; // compressed size (in bytes) of the 32-bit misc textures chunk (4 bytes) +uint32_t ​Image32Misc_CompSize; // compressed size (in bytes) of the 32-bit misc textures chunk (4 bytes) 
-uint8_t ​Textile32Misc_Compressed[Textile32Misc_CompSize]; // zlib-compressed 32-bit misc textures chunk (Textile32Misc_CompSize ​bytes)+uint8_t ​Image32Misc_Compressed[Image32Misc_CompSize]; // zlib-compressed 32-bit misc textures chunk (Image32Misc_CompSize ​bytes)
 { {
-    ​tr4_textile32 Textile32Misc[2];+    ​tr4_image32 Image32Misc[2];
 } }
 uint32_t LevelData_UncompSize;​ // uncompressed size (in bytes) of the level data chunk (4 bytes) uint32_t LevelData_UncompSize;​ // uncompressed size (in bytes) of the level data chunk (4 bytes)
Line 302: Line 302:
     uint16_t AnimatedTextures[NumAnimatedTextures];​ // animated texture data (NumAnimatedTextures * 2 bytes)     uint16_t AnimatedTextures[NumAnimatedTextures];​ // animated texture data (NumAnimatedTextures * 2 bytes)
     uint8_t AnimatedTexturesUVCount;​     uint8_t AnimatedTexturesUVCount;​
 +    uint8_t TEX[3]; // T E X (0x54, 0x45, 0x58)
     uint32_t NumObjectTextures;​ // number of object textures to follow (4 bytes) (after AnimatedTextures in TR3)     uint32_t NumObjectTextures;​ // number of object textures to follow (4 bytes) (after AnimatedTextures in TR3)
     tr4_object_texture ObjectTextures[NumObjectTextures];​ // object texture list (NumObjectTextures * 38 bytes)     tr4_object_texture ObjectTextures[NumObjectTextures];​ // object texture list (NumObjectTextures * 38 bytes)
Line 315: Line 316:
     uint32_t NumSampleIndices;​ // number of sample indices to follow (4 bytes) ​ +     uint32_t NumSampleIndices;​ // number of sample indices to follow (4 bytes) ​ +
     uint32_t SampleIndices[NumSampleIndices];​ // sample indices (NumSampleIndices * 4 bytes)     uint32_t SampleIndices[NumSampleIndices];​ // sample indices (NumSampleIndices * 4 bytes)
 +    uint8_t Separator[6];​ // 6 0x00 bytes
 } }
 uint32_t NumSamples; // number of sound samples (4 bytes) uint32_t NumSamples; // number of sound samples (4 bytes)
Line 330: Line 332:
 <code cpp> <code cpp>
 uint32_t Version; // version (4 bytes) uint32_t Version; // version (4 bytes)
-uint16_t ​NumRoomTextiles; // number of non bumped ​room tiles (2 bytes) +uint16_t ​NumRoomImages; // number of non-bumpmapped ​room images ​(2 bytes) 
-uint16_t ​NumObjTextiles; // number of object ​tiles (2 bytes) +uint16_t ​NumObjImages; // number of object ​images ​(2 bytes) 
-uint16_t ​NumBumpTextiles; // number of bumped room tiles (2 bytes) +uint16_t ​NumBumpmaps; // number of bumpmaps ​(2 bytes) 
-uint32_t ​Textile32_UncompSize; // uncompressed size (in bytes) of the 32-bit textures chunk (4 bytes) +uint32_t ​Image32_UncompSize; // uncompressed size (in bytes) of the 32-bit textures chunk (4 bytes) 
-uint32_t ​Textile32_CompSize; // compressed size (in bytes) of the 32-bit textures chunk (4 bytes) +uint32_t ​Image32_CompSize; // compressed size (in bytes) of the 32-bit textures chunk (4 bytes) 
-uint8_t ​Textile32_Compressed[Textile32_CompSize]; // zlib-compressed 32-bit textures chunk (Textile32_CompSize ​bytes)+uint8_t ​Image32_Compressed[Image32_CompSize]; // zlib-compressed 32-bit textures chunk (Image32_CompSize ​bytes)
 { {
-    ​tr4_textile32 Textile32[NumRoomTextiles ​NumObjTextiles ​NumBumpTextiles];+    ​tr4_image32 Image32[NumRoomImages ​NumObjImages ​NumBumpmaps];
 } }
-uint32_t ​Textile16_UncompSize; // uncompressed size (in bytes) of the 16-bit textures chunk (4 bytes) +uint32_t ​Image16_UncompSize; // uncompressed size (in bytes) of the 16-bit textures chunk (4 bytes) 
-uint32_t ​Textile16_CompSize; // compressed size (in bytes) of the 16-bit textures chunk (4 bytes) +uint32_t ​Image16_CompSize; // compressed size (in bytes) of the 16-bit textures chunk (4 bytes) 
-uint8_t ​Textile16_Compressed[Textile32_CompSize]; // zlib-compressed 16-bit textures chunk (Textile16_CompSize ​bytes)+uint8_t ​Image16_Compressed[Image32_CompSize]; // zlib-compressed 16-bit textures chunk (Image16_CompSize ​bytes)
 { {
-    ​tr_textile16 Textile16[NumRoomTextiles ​NumObjTextiles ​NumBumpTextiles];+    ​tr_image16 Image16[NumRoomImages ​NumObjImages ​NumBumpmaps];
 } }
-uint32_t ​Textile32Misc_UncompSize; // uncompressed size (in bytes) of the 32-bit misc textures chunk (4 bytes), should always be 786432 +uint32_t ​Image32Misc_UncompSize; // uncompressed size (in bytes) of the 32-bit misc textures chunk (4 bytes), should always be 786432 
-uint32_t ​Textile32Misc_CompSize; // compressed size (in bytes) of the 32-bit misc textures chunk (4 bytes) +uint32_t ​Image32Misc_CompSize; // compressed size (in bytes) of the 32-bit misc textures chunk (4 bytes) 
-uint8_t ​Textile32Misc_Compressed[Textile32Misc_CompSize]; // zlib-compressed 32-bit misc textures chunk (Textile32Misc_CompSize ​bytes)+uint8_t ​Image32Misc_Compressed[Image32Misc_CompSize]; // zlib-compressed 32-bit misc textures chunk (Image32Misc_CompSize ​bytes)
 { {
-    ​tr4_textile32 Textile32Misc[3];+    ​tr4_image32 Image32Misc[3];
 } }
 uint16_t LaraType; uint16_t LaraType;
Line 461: Line 463:
   * There are no more 8-bit textures.   * There are no more 8-bit textures.
   * There are now 32-bit textures.   * There are now 32-bit textures.
-  * Texture ​tiles are now divided into three parts: //non-bumped ​room texture ​tiles//, //model texture ​tiles// and //bumped ​room texture ​tiles//.+  * Texture ​atlases ​are now divided into three parts: //non-bumpmapped ​room texture ​atlases//, //model texture ​atlases// and //bumpmapped ​room texture ​atlases//.
   * Level file divided in several chunks, with each chunk compressed using //zlib//:   * Level file divided in several chunks, with each chunk compressed using //zlib//:
-    * Chunk 1: 32-bit texture ​tiles+    * Chunk 1: 32-bit texture ​atlases
-    * Chunk 2: 16-bit texture ​tiles.+    * Chunk 2: 16-bit texture ​atlases.
     * Chunk 3: 32-bit //sky and font graphics//.     * Chunk 3: 32-bit //sky and font graphics//.
     * Chunk 4: Level data.     * Chunk 4: Level data.
Line 499: Line 501:
 ===== Changes in TR4 vs. TR5 ===== ===== Changes in TR4 vs. TR5 =====
  
-  * There is no more //bumped ​room texture ​tiles// block.+  * There is no more //bump-mapped ​room texture ​atlases// block.
   * There are now two extra ''​%%uint16_t%%''​ values after last texture block specifying [[trs:​file_formats#​LaraType|Lara type]] and [[trs:​file_formats#​WeatherType|weather type]].   * There are now two extra ''​%%uint16_t%%''​ values after last texture block specifying [[trs:​file_formats#​LaraType|Lara type]] and [[trs:​file_formats#​WeatherType|weather type]].
   * Also, it is followed by 28 bytes zero padding.   * Also, it is followed by 28 bytes zero padding.
trs/file_formats.1510917622.txt.gz · Last modified: 2017/11/17 12:20 by stohrendorf
Back to top
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0