SHARE
TWEET

flam.h initial peer comment submission

liquidspark Apr 27th, 2019 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  includes
  3.  */
  4.  
  5. /*
  6.  size_t
  7.  int8_t
  8.  int16_t
  9.  int32_t
  10.  uint8_t
  11.  uint16_t
  12.  uint32_t
  13.  */
  14. #include <stdint.h>
  15.  
  16. /*
  17.  float_t
  18.  */
  19. #include <math.h>
  20.  
  21. /*
  22.  types
  23.  */
  24.  
  25.     //typedef int8_t char_integer;
  26.     //typedef int16_t short_integer;
  27.     //typedef int32_t long_integer;
  28.     //typedef uint32_t tag; // Tag is a FourCC literal.
  29.     //typedef uint8_t byte_flags;
  30.     //typedef uint16_t word_flags;
  31.     //typedef uint32_t long_flags;
  32.     //typedef int16_t short_block_index;
  33.     //typedef int32_t long_block_index;
  34.     //typedef float_t real;
  35.     //typedef float_t real_fraction;
  36.     //typedef float_t angle;
  37.     //struct fraction_bounds { // Duplicate of real_bounds.
  38.     //  float_t from;
  39.     //  float_t to;
  40.     //};
  41.     //struct string { // Duplicate of data.
  42.     //  size_t length;
  43.     //  void* text;
  44.     //};
  45.  
  46. struct data {
  47.     size_t size;
  48.     void* contents;
  49. };
  50. struct point_2d {
  51.     int16_t x;
  52.     int16_t y;
  53. };
  54. struct rectangle_2d {
  55.     int16_t top;
  56.     int16_t left;
  57.     int16_t bottom;
  58.     int16_t right;
  59. };
  60. struct rgb_color {
  61.     uint8_t red;
  62.     uint8_t green;
  63.     uint8_t blue;
  64. };
  65. struct argb_color {
  66.     uint8_t alpha;
  67.     uint8_t red;
  68.     uint8_t green;
  69.     uint8_t blue;
  70. };
  71. struct real_point_2d {
  72.     float_t x;
  73.     float_t y;
  74. };
  75. struct real_point_3d {
  76.     float_t x;
  77.     float_t y;
  78.     float_t z;
  79. };
  80. struct real_vector_2d {
  81.     float_t i;
  82.     float_t j;
  83. };
  84. struct real_vector_3d {
  85.     float_t i;
  86.     float_t j;
  87.     float_t k;
  88. };
  89. struct real_quaternion {
  90.     float_t i;
  91.     float_t j;
  92.     float_t k;
  93.     float_t w;
  94. };
  95. struct real_euler_angles_2d {
  96.     float_t yaw;
  97.     float_t pitch;
  98. };
  99. struct real_euler_angles_3d {
  100.     float_t yaw;
  101.     float_t pitch;
  102.     float_t roll;
  103. };
  104. struct real_plane_2d {
  105.     float_t i;
  106.     float_t j;
  107.     float_t d;
  108. };
  109. struct real_plane_3d {
  110.     float_t i;
  111.     float_t j;
  112.     float_t k;
  113.     float_t d;
  114. };
  115. struct real_rgb_color {
  116.     float_t red;
  117.     float_t green;
  118.     float_t blue;
  119. };
  120. struct real_argb_color {
  121.     float_t alpha;
  122.     float_t red;
  123.     float_t green;
  124.     float_t blue;
  125. };
  126. struct real_hsv_color {
  127.     float_t hue;
  128.     float_t saturation;
  129.     float_t value;
  130. };
  131. struct real_ahsv_color {
  132.     float_t alpha;
  133.     float_t hue;
  134.     float_t saturation;
  135.     float_t value;
  136. };
  137. struct short_integer_bounds {
  138.     int16_t from;
  139.     int16_t to;
  140. };
  141. struct real_bounds {
  142.     float_t from;
  143.     float_t to;
  144. };
  145. struct angle_bounds {
  146.     float_t left;
  147.     float_t right;
  148. };
  149. struct tag_reference {
  150.     uint32_t type;
  151.     struct data filepath;
  152. };
  153. struct tag_header {
  154.     uint32_t type;
  155.     uint32_t crc32;
  156. };
  157. struct model_marker_instance_block {
  158.     int8_t region_index;
  159.     int8_t permutation_index;
  160.     int8_t node_index;
  161.     struct real_point_3d translation;
  162.     struct real_quaternion rotation;
  163. };
  164. struct model_markers_block {
  165.     struct data name;
  166.     int16_t magic_identifier;
  167.     struct {
  168.         size_t count;
  169.         struct model_marker_instance_block* elements;
  170.     } instances;
  171. };
  172. struct model_node_block {
  173.     struct data name;
  174.     int16_t node_index;
  175.     int16_t first_child_node_index;
  176.     int16_t parent_node_index;
  177.     struct real_point_3d default_translation;
  178.     struct real_quaternion default_rotation;
  179.     float_t node_distance_from_parent;
  180. };
  181. struct model_region_permutation_marker_block {
  182.     struct data name;
  183.     int16_t node_index;
  184.     struct real_quaternion rotation;
  185.     struct real_point_3d translation;
  186. };
  187. struct model_region_permutation_block {
  188.     struct data name;
  189.     uint32_t flags;
  190.     int16_t super_low;
  191.     int16_t low;
  192.     int16_t medium;
  193.     int16_t high;
  194.     int16_t super_high;
  195.     struct {
  196.         size_t count;
  197.         struct model_region_permutation_marker_block* elements;
  198.     } markers;
  199. };
  200. struct model_region_block {
  201.     struct data name;
  202.     struct {
  203.         size_t count;
  204.         struct model_region_permutation_block* elements;
  205.     } permutations;
  206. };
  207. struct model_vertex_uncompressed_block {
  208.     struct real_point_3d position;
  209.     struct real_vector_3d normal;
  210.     struct real_vector_3d binormal;
  211.     struct real_vector_3d tangent;
  212.     struct real_point_2d texture_coords;
  213.     int16_t node0_index;
  214.     int16_t node1_index;
  215.     float_t node0_weight;
  216.     float_t node1_weight;
  217. };
  218. struct model_vertex_compressed_block {
  219.     struct real_point_3d position;
  220.     int32_t normal;
  221.     int32_t binormal;
  222.     int32_t tangent;
  223.     int16_t texture_coordinate_u;
  224.     int16_t texture_coordinate_v;
  225.     int8_t node0_index;
  226.     int8_t node1_index;
  227.     int16_t node0_weight;
  228. };
  229. struct model_triangle_block {
  230.     int16_t vertex0_index;
  231.     int16_t vertex1_index;
  232.     int16_t vertex2_index;
  233. };
  234. struct model_geometry_part_block {
  235.     uint32_t flags;
  236.     int16_t shader_index;
  237.     int8_t previous_filthy_part_index;
  238.     int8_t next_filthy_part_index;
  239.     int16_t centroid_primary_node;
  240.     int16_t centroid_secondary_node;
  241.     float_t centroid_primary_weight;
  242.     float_t centroid_secondary_weight;
  243.     struct real_point_3d centroid;
  244.     struct {
  245.         size_t count;
  246.         struct model_vertex_uncompressed_block* elements;
  247.     } uncompressed_vertices;
  248.     struct {
  249.         size_t count;
  250.         struct model_vertex_compressed_block* elements;
  251.     } compressed_vertices;
  252.     struct {
  253.         size_t count;
  254.         struct model_triangle_block* elements;
  255.     } triangles;
  256. };
  257. struct model_geometry_block {
  258.     uint32_t flags;
  259.     struct {
  260.         size_t count;
  261.         struct model_geometry_part_block* elements;
  262.     } parts;
  263. };
  264. struct model_shader_reference_block {
  265.     struct tag_reference shader;
  266.     int16_t permutation;
  267. };
  268. struct model {
  269.     uint32_t flags;
  270.     uint32_t node_list_checksum;
  271.     float_t super_high_detail_cutoff;
  272.     float_t high_detail_cutoff;
  273.     float_t medium_detail_cutoff;
  274.     float_t low_detail_cutoff;
  275.     float_t super_low_detail_cutoff;
  276.     int16_t super_high_detail_node_count;
  277.     int16_t high_detail_node_count;
  278.     int16_t medium_detail_node_count;
  279.     int16_t low_detail_node_count;
  280.     int16_t super_low_detail_node_count;
  281.     float_t base_map_u_scale;
  282.     float_t base_map_v_scale;
  283.     struct {
  284.         size_t count;
  285.         struct model_markers_block* elements;
  286.     } markers;
  287.     struct {
  288.         size_t count;
  289.         struct model_node_block* elements;
  290.     } nodes;
  291.     struct {
  292.         size_t count;
  293.         struct model_region_block* elements;
  294.     } regions;
  295.     struct {
  296.         size_t count;
  297.         struct model_geometry_block* elements;
  298.     } geometries;
  299.     struct {
  300.         size_t count;
  301.         struct model_shader_reference_block* elements;
  302.     } shaders;
  303. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top