Guest User

Untitled

a guest
Oct 20th, 2024
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. meta:
  2. id: images
  3. endian: le
  4. file-extension: i2d
  5.  
  6. seq:
  7. - id: magic
  8. contents: [0x43, 0x47, 0x53, 0x52]
  9.  
  10. - id: file_header
  11. type: file_header_block
  12. - id: imagery_header
  13. type: imagery_header_block
  14. - id: imagery_header_meta
  15. type: imagery_header_meta
  16. repeat: expr
  17. repeat-expr: imagery_header.numstates
  18. - id: unknown_data
  19. size: imagery_header.headerize - 12 - 72 * imagery_header.numstates
  20. - id: offsets
  21. type: offset
  22. repeat: expr
  23. repeat-expr: file_header.top_bitmap_index
  24. - id: padding
  25. size: offsets[0].offset
  26.  
  27. - id: bitmapdata
  28. type: bitmapdata
  29.  
  30. # repeat: expr
  31. ## repeat-expr: file_header.top_bitmap_index
  32. ##- id: numbers
  33. #size: 6829
  34.  
  35. types:
  36. rgba_color:
  37. seq:
  38. - id: red
  39. type: u1
  40. - id: green
  41. type: u1
  42. - id: blue
  43. type: u1
  44. - id: alpha
  45. type: u1
  46. rgb_8_bit_color:
  47.  
  48.  
  49. seq:
  50. - id: color_data
  51. type: u2
  52. instances:
  53. red:
  54. value: (color_data & 0xF800) >> 11 # Extracts the top 5 bits
  55. green:
  56. value: (color_data & 0x07E0) >> 5 # Extracts the middle 6 bits
  57. blue:
  58. value: (color_data & 0x001F) # Extracts the last 5 bits
  59. red_8_bit:
  60. value: (red * 255) / 31
  61. blue_8_bit:
  62. value: (blue * 255) / 31
  63.  
  64. green_8_bit:
  65. value: (green * 255) / 63
  66.  
  67.  
  68.  
  69.  
  70. file_header_block:
  71. seq:
  72. - id: top_bitmap_index
  73. type: u2
  74.  
  75. - id: compression_type
  76. type: u1
  77. - id: version
  78. type: u1
  79.  
  80. - id: data_size
  81. type: u4
  82. - id: object_size
  83. type: u4
  84. imagery_header_block:
  85. seq:
  86. - id: headerize
  87. type: u4
  88. - id: imageryid
  89. type: u4
  90. - id: numstates
  91. type: u4
  92. imagery_header_meta:
  93. seq:
  94. - id: ascii
  95. type: u1
  96. repeat: expr # Repeat for a fixed number of times
  97. repeat-expr: 32
  98. - id: walkmap
  99. type: u4
  100. - id: imageryflags
  101. type: u4
  102. - id: aniflags
  103. type: u2
  104. - id: frames
  105. type: u2
  106. - id: widthmax
  107. type: s2 # Graphics maximum width (for IsOnScreen and refresh rects)
  108.  
  109. - id: heightmax
  110. type: u2 # Graphics maximum height (for IsOnScreen and refresh rects)
  111.  
  112. - id: regx
  113. type: s2 # Registration point x for graphics
  114.  
  115. - id: regy
  116. type: u2 # Registration point y for graphics
  117.  
  118. - id: regz
  119. type: u2 # Registration point z for graphics
  120.  
  121. - id: animregx
  122. type: u2 # Registration point x of animation
  123.  
  124. - id: animregy
  125. type: u2 # Registration point y of animation
  126.  
  127. - id: animregz
  128. type: u2 # Registration point z of animation
  129.  
  130. - id: wregx
  131. type: u2 # World registration x of walk and bounding box info
  132.  
  133. - id: wregy
  134. type: u2 # World registration y of walk and bounding box info
  135.  
  136. - id: wregz
  137. type: u2 # World registration z of walk and bounding box info
  138.  
  139. - id: wwidth
  140. type: u2 # Object's world width for walk map and bound box
  141.  
  142. - id: wlength
  143. type: u2 # Object's world length for walk map and bound box
  144.  
  145. - id: wheight
  146. type: u2 # Object's world height for walk map and bound box
  147.  
  148. - id: invaniflags
  149. type: u2 # Animation flags for inventory animation
  150.  
  151. - id: invframes
  152. type: u2 # Numbera of frames of inventory animation
  153. offset:
  154. seq:
  155. - id: offset
  156. type: u4
  157.  
  158. bitmapdata:
  159. seq:
  160. - id: width
  161. type: u4
  162.  
  163. - id: height
  164. type: u4
  165.  
  166. - id: regopointx
  167. type: u4
  168. - id: regopointy
  169. type: u4
  170. - id: flags
  171. type: u4
  172. - id: drawingmode
  173. type: u4
  174. - id: keycolor
  175. type: u4
  176. - id: aliassize
  177. type: u4
  178. - id: aliasoffset
  179. type: u4
  180. - id: alphasize
  181. type: u4
  182.  
  183. - id: alpha
  184. type: u4
  185.  
  186. - id: zbuffersize
  187. type: u4
  188. - id: zbuffer
  189. type: u4
  190. - id: normalsize
  191. type: u4
  192. - id: normal
  193. type: u4
  194. - id: paletsize
  195. type: u4
  196.  
  197. - id: pallete
  198. type: u4
  199.  
  200. - id: datasize
  201. type: u4
  202. - id: chunk_decomp_flag
  203. type: u4
  204. - id: chunks_width
  205. type: u4
  206. - id: chunk_height
  207. type: u4
  208. - id: chunkoffsets
  209. type: u4
  210. repeat: expr # Repeat for a fixed number of times
  211. repeat-expr: chunks_width*chunk_height # Repeat until end of stream
  212. - id: bimtap_data
  213. size: datasize
  214.  
  215. - id: colors
  216. type: rgb_8_bit_color
  217. repeat: expr # Repeat for a fixed number of times
  218. repeat-expr: 256 # Repeat until end of stream
  219. - id: colors2
  220. type: rgba_color
  221. repeat: expr # Repeat for a fixed number of times
  222. repeat-expr: 256 # Repeat until end of strea
  223.  
  224.  
Advertisement
Add Comment
Please, Sign In to add comment