Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TR5-Format.txt 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. TR4:
  2. * amount_cinematic_frames is bitu32, not bitu16
  3. * object_texture last 2 longs are xsize and ysize of texture
  4. * object_texture::
  5. I gess that in TR4 files the object textures Id used for the movables are the same used in the WAD file.
  6. The object texture is interpreted some different,
  7. First word in the texture ID:
  8. for rectangles in model:
  9. Bits 0-11 texture Id (signed) if negative the texture is fliped.
  10. Bits 12-15 unused, (0000 if Id is positive, 1111 if negative)
  11. for Triangles in model:
  12. Bits 0-11 texture Id (always positive)
  13. Bits 12-14 Triangle kind.
  14. Bits 15 normal/flip
  15. for secound word:
  16. 0= texture opaque
  17. 1=texture semi-transparent
  18. 2=transparent.
  19. TR5:
  20. * object_textures are now 40 bytes
  21. * after "SPR" is an unknown byte
  22. * before "TEX" is an unknown byte
  23. * moveable after each is unknown int
  24. * object_texture last 2 longs are xsize and ysize of texture
  25. /////////////////////////////////////
  26. // TR5 Format
  27. /////////////////////////////////////
  28. unsigned long Version
  29. unsigned char Unknown[6]
  30. // 32 bits textures
  31. unsigned long UCompSize
  32. unsigned long CompSize
  33. unsigned char *CompData
  34. // 16 bits textures
  35. unsigned long UCompSize
  36. unsigned long CompSize
  37. unsigned char *CompData
  38. // Sprite textures
  39. unsigned long UCompSize
  40. unsigned long CompSize
  41. unsigned char *CompData
  42. unsigned char Unknown[44]
  43. unsigned int NumRooms
  44. // Rooms
  45. // All rooms start with the following header:
  46. unsigned int Unknown
  47. unsigned long RoomCode (0x0414C4558)
  48. unsigned char Unknowm[24]
  49. // After the header comes the following format:
  50. unsigned long RoomX
  51. unsigned long Unknown (Maybe RoomY?)
  52. unsigned long RoomZ
  53. unsigned long Unknown[2]
  54. unsigned int XSize
  55. unsigned int ZSize
  56. // The room color. It uses 4 bytes and it's in RGB format (I don't know what byte 4 is)
  57. TR_Color4 RoomColor
  58. // After here comes a unknown format that contains the number of static meshes, vertices,
  59. // rectangles and more. They uses 30 bytes, but 28 are unknown for me. There is maybe a
  60. // pointer to the 'real' structure, or maybe a special code like the RoomCode. (It looks
  61. // like TR5 uses come sort of chunks)
  62. // Static Meshes
  63. unsigned int Unknown
  64. unsigned int NumStaticMeshes
  65. unsigned char Unknown[26]
  66. // Vertices
  67. unsigned int Unknown
  68. unsigned int NumVertices
  69. unsigned char Unknown[26]
  70. // Unknown, but format looks the same. Sometimes 0 and sometimes very large (Maybe the
  71. // value is signed?).
  72. unsigned int Unknown
  73. unsigned int Unknown
  74. unsigned char Unknown[26]
  75. // Rectangles
  76. unsigned int Unknown
  77. unsigned int NumVertices
  78. unsigned char Unknown[26]
  79. // This is all I know! I can see the sectors, but there are many unknown before it. A way
  80. // to search for the sectors is searching for a value of 129 (A wall). The sectors uses
  81. // 8 bytes for each sector. Use XSize and ZSize to read it and remember that the four
  82. // corners must be a wall (129, 5th byte). If you search for the 4 corners with a value of
  83. // 129 (byte 7 is 129 too), the change that you find it is very large.