Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- includes
- */
- /*
- size_t
- int8_t
- int16_t
- int32_t
- uint8_t
- uint16_t
- uint32_t
- */
- #include <stdint.h>
- /*
- float_t
- */
- #include <math.h>
- /*
- types
- */
- //typedef int8_t char_integer;
- //typedef int16_t short_integer;
- //typedef int32_t long_integer;
- //typedef uint32_t tag; // Tag is a FourCC literal.
- //typedef uint8_t byte_flags;
- //typedef uint16_t word_flags;
- //typedef uint32_t long_flags;
- //typedef int16_t short_block_index;
- //typedef int32_t long_block_index;
- //typedef float_t real;
- //typedef float_t real_fraction;
- //typedef float_t angle;
- //struct fraction_bounds { // Duplicate of real_bounds.
- // float_t from;
- // float_t to;
- //};
- //struct string { // Duplicate of data.
- // size_t length;
- // void* text;
- //};
- struct data {
- size_t size;
- void* contents;
- };
- struct point_2d {
- int16_t x;
- int16_t y;
- };
- struct rectangle_2d {
- int16_t top;
- int16_t left;
- int16_t bottom;
- int16_t right;
- };
- struct rgb_color {
- uint8_t red;
- uint8_t green;
- uint8_t blue;
- };
- struct argb_color {
- uint8_t alpha;
- uint8_t red;
- uint8_t green;
- uint8_t blue;
- };
- struct real_point_2d {
- float_t x;
- float_t y;
- };
- struct real_point_3d {
- float_t x;
- float_t y;
- float_t z;
- };
- struct real_vector_2d {
- float_t i;
- float_t j;
- };
- struct real_vector_3d {
- float_t i;
- float_t j;
- float_t k;
- };
- struct real_quaternion {
- float_t i;
- float_t j;
- float_t k;
- float_t w;
- };
- struct real_euler_angles_2d {
- float_t yaw;
- float_t pitch;
- };
- struct real_euler_angles_3d {
- float_t yaw;
- float_t pitch;
- float_t roll;
- };
- struct real_plane_2d {
- float_t i;
- float_t j;
- float_t d;
- };
- struct real_plane_3d {
- float_t i;
- float_t j;
- float_t k;
- float_t d;
- };
- struct real_rgb_color {
- float_t red;
- float_t green;
- float_t blue;
- };
- struct real_argb_color {
- float_t alpha;
- float_t red;
- float_t green;
- float_t blue;
- };
- struct real_hsv_color {
- float_t hue;
- float_t saturation;
- float_t value;
- };
- struct real_ahsv_color {
- float_t alpha;
- float_t hue;
- float_t saturation;
- float_t value;
- };
- struct short_integer_bounds {
- int16_t from;
- int16_t to;
- };
- struct real_bounds {
- float_t from;
- float_t to;
- };
- struct angle_bounds {
- float_t left;
- float_t right;
- };
- struct tag_reference {
- uint32_t type;
- struct data filepath;
- };
- struct tag_header {
- uint32_t type;
- uint32_t crc32;
- };
- struct model_marker_instance_block {
- int8_t region_index;
- int8_t permutation_index;
- int8_t node_index;
- struct real_point_3d translation;
- struct real_quaternion rotation;
- };
- struct model_markers_block {
- struct data name;
- int16_t magic_identifier;
- struct {
- size_t count;
- struct model_marker_instance_block* elements;
- } instances;
- };
- struct model_node_block {
- struct data name;
- int16_t node_index;
- int16_t first_child_node_index;
- int16_t parent_node_index;
- struct real_point_3d default_translation;
- struct real_quaternion default_rotation;
- float_t node_distance_from_parent;
- };
- struct model_region_permutation_marker_block {
- struct data name;
- int16_t node_index;
- struct real_quaternion rotation;
- struct real_point_3d translation;
- };
- struct model_region_permutation_block {
- struct data name;
- uint32_t flags;
- int16_t super_low;
- int16_t low;
- int16_t medium;
- int16_t high;
- int16_t super_high;
- struct {
- size_t count;
- struct model_region_permutation_marker_block* elements;
- } markers;
- };
- struct model_region_block {
- struct data name;
- struct {
- size_t count;
- struct model_region_permutation_block* elements;
- } permutations;
- };
- struct model_vertex_uncompressed_block {
- struct real_point_3d position;
- struct real_vector_3d normal;
- struct real_vector_3d binormal;
- struct real_vector_3d tangent;
- struct real_point_2d texture_coords;
- int16_t node0_index;
- int16_t node1_index;
- float_t node0_weight;
- float_t node1_weight;
- };
- struct model_vertex_compressed_block {
- struct real_point_3d position;
- int32_t normal;
- int32_t binormal;
- int32_t tangent;
- int16_t texture_coordinate_u;
- int16_t texture_coordinate_v;
- int8_t node0_index;
- int8_t node1_index;
- int16_t node0_weight;
- };
- struct model_triangle_block {
- int16_t vertex0_index;
- int16_t vertex1_index;
- int16_t vertex2_index;
- };
- struct model_geometry_part_block {
- uint32_t flags;
- int16_t shader_index;
- int8_t previous_filthy_part_index;
- int8_t next_filthy_part_index;
- int16_t centroid_primary_node;
- int16_t centroid_secondary_node;
- float_t centroid_primary_weight;
- float_t centroid_secondary_weight;
- struct real_point_3d centroid;
- struct {
- size_t count;
- struct model_vertex_uncompressed_block* elements;
- } uncompressed_vertices;
- struct {
- size_t count;
- struct model_vertex_compressed_block* elements;
- } compressed_vertices;
- struct {
- size_t count;
- struct model_triangle_block* elements;
- } triangles;
- };
- struct model_geometry_block {
- uint32_t flags;
- struct {
- size_t count;
- struct model_geometry_part_block* elements;
- } parts;
- };
- struct model_shader_reference_block {
- struct tag_reference shader;
- int16_t permutation;
- };
- struct model {
- uint32_t flags;
- uint32_t node_list_checksum;
- float_t super_high_detail_cutoff;
- float_t high_detail_cutoff;
- float_t medium_detail_cutoff;
- float_t low_detail_cutoff;
- float_t super_low_detail_cutoff;
- int16_t super_high_detail_node_count;
- int16_t high_detail_node_count;
- int16_t medium_detail_node_count;
- int16_t low_detail_node_count;
- int16_t super_low_detail_node_count;
- float_t base_map_u_scale;
- float_t base_map_v_scale;
- struct {
- size_t count;
- struct model_markers_block* elements;
- } markers;
- struct {
- size_t count;
- struct model_node_block* elements;
- } nodes;
- struct {
- size_t count;
- struct model_region_block* elements;
- } regions;
- struct {
- size_t count;
- struct model_geometry_block* elements;
- } geometries;
- struct {
- size_t count;
- struct model_shader_reference_block* elements;
- } shaders;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement