Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "stdint.h"
- typedef struct
- {
- uint8_t val[32];
- } string;
- typedef int8_t char_integer;
- typedef int16_t short_integer;
- typedef int32_t long_integer;
- typedef float angle;
- typedef uint32_t tag;
- //typedef enum enum;
- typedef uint32_t long_flags;
- typedef uint16_t word_flags;
- typedef uint8_t byte_flags;
- typedef struct
- {
- int16_t x, y;
- } point_2d;
- typedef struct
- {
- int16_t top, left, bottom, right;
- } rectangle_2d;
- typedef struct
- {
- uint8_t red, green, blue;
- } rgb_color;
- typedef struct
- {
- uint8_t alpha, red, green, blue;
- } argb_color;
- typedef float real;
- typedef float real_fraction;
- typedef struct
- {
- float x, y;
- } real_point_2d;
- typedef struct
- {
- float x, y, z;
- } real_point_3d;
- typedef struct
- {
- float i, j;
- } real_vector_2d;
- typedef struct
- {
- float i, j, k;
- } real_vector_3d;
- typedef struct
- {
- float i, j, k, w;
- } real_quaternion;
- typedef struct
- {
- float yaw, pitch;
- } real_euler_angles_2d;
- typedef struct
- {
- float yaw, pitch, roll;
- } real_euler_angles_3d;
- typedef struct
- {
- float i, j, d;
- } real_plane_2d;
- typedef struct
- {
- float i, j, k, d;
- } real_plane_3d;
- typedef struct
- {
- float red, green, blue;
- } real_rgb_color;
- typedef struct
- {
- float alpha, red, green, blue;
- } real_argb_color;
- typedef struct
- {
- float hue, saturation, value;
- } real_hsv_color;
- typedef struct
- {
- float alpha, hue, saturation, value;
- } real_ahsv_color;
- typedef struct
- {
- int16_t from, to;
- } short_integer_bounds;
- typedef struct
- {
- float left, right;
- } angle_bounds;
- typedef struct
- {
- float from, to;
- } real_bounds;
- typedef struct
- {
- float from, to;
- } fraction_bounds;
- typedef struct
- {
- tag tag_class;
- uint32_t path_address;
- uint32_t path_length;
- struct id { int16_t pos, neg; };
- char* path;
- } tag_reference;
- typedef struct
- {
- //const char* name;
- //const uint32_t max_chunks;
- //const uint32_t chunk_size;
- uint32_t chunk_count;
- uint32_t address;
- uint32_t definition_address; // little endian
- } block; // this approach is silly
- typedef int16_t short_block_index;
- typedef int32_t long_block_index;
- typedef struct
- {
- uint32_t length;
- uint8_t pad[4];
- uint32_t offset;
- uint32_t address; // pointer
- uint32_t definition_address;
- } data;
- // array_start
- // array_end
- typedef uint8_t pad;
- // skip
- // explanation
- // custom
- // terminator_X
- typedef struct
- {
- pad p1[36];
- tag tag_class;
- uint32_t crc32;
- int32_t header_length;
- pad p2[8];
- int16_t tag_version;
- int16_t engine_version;
- tag engine_class;
- } tag_header;
- typedef struct
- {
- char_integer region_index;
- char_integer permutation_index;
- char_integer node_index;
- pad p1[1];
- real_point_3d translation;
- real_quaternion rotation;
- } model_marker_instance_block;
- typedef struct
- {
- string name;
- short_integer magic_identifier;
- pad p1[2];
- pad p2[16];
- block instances;
- } model_markers_block;
- typedef struct
- {
- string name;
- short_block_index next_sibling_node_index;
- short_block_index first_child_node_index;
- short_block_index parent_node_index;
- pad p1[2];
- real_point_3d default_translation;
- real_quaternion default_rotation;
- real node_distance_from_parent;
- pad p2[32];
- pad p3[52];
- } model_node_block;
- typedef struct
- {
- string name;
- short_block_index node_index;
- pad p1[2];
- real_quaternion rotation;
- real_point_3d translation;
- pad p2[16];
- } model_region_permutation_marker_block;
- typedef struct
- {
- string name;
- long_flags flags;
- pad p1[28];
- short_block_index super_low;
- short_block_index low;
- short_block_index medium;
- short_block_index high;
- short_block_index super_high;
- pad p2[2];
- block markers;
- } model_region_permutation_block;
- typedef struct
- {
- string name;
- pad p1[32];
- block permutations;
- } model_region_block;
- typedef struct
- {
- real_point_3d position;
- real_vector_3d normal;
- real_vector_3d binormal;
- real_vector_3d tangent;
- real_point_2d texture_coords;
- short_integer node0_index;
- short_integer node1_index;
- real node0_weight;
- real node1_weight;
- } model_vertex_uncompressed_block;
- typedef struct
- {
- real_point_3d position;
- long_integer normal;
- long_integer binormal;
- long_integer tangent;
- short_integer texture_coordinate_u;
- short_integer texture_coordinate_v;
- char_integer node0_index;
- char_integer node1_index;
- short_integer node0_weight;
- } model_vertex_compressed_block;
- typedef struct
- {
- short_integer vertex0_index;
- short_integer vertex1_index;
- short_integer vertex2_index;
- } model_triangle_block;
- typedef struct
- {
- long_flags flags;
- short_block_index shader_index;
- char_integer prev_filthy_part_index;
- char_integer next_filthy_part_index;
- short_integer centroid_primary_node;
- short_integer centroid_secondary_node;
- real_fraction centroid_primary_weight;
- real_fraction centroid_secondary_weight;
- real_point_3d centroid;
- block uncompressed_vertices;
- block compressed_vertices;
- block triangles;
- pad p1[20];
- pad p2[16];
- } model_geometry_part_block;
- typedef struct
- {
- long_flags flags;
- pad p1[32];
- block parts;
- } model_geometry_block;
- typedef struct
- {
- tag_reference shader;
- short_integer permutation;
- pad p1[2];
- pad p2[12];
- } model_shader_reference_block;
- typedef struct
- {
- long_flags flags;
- long_integer node_list_checksum;
- real super_high_detail_cutoff;
- real high_detail_cutoff;
- real medium_detail_cutoff;
- real low_detail_cutoff;
- real super_low_detail_cutoff;
- short_integer super_high_detail_node_count;
- short_integer high_detail_node_count;
- short_integer medium_detail_node_count;
- short_integer low_detail_node_count;
- short_integer super_low_detail_node_count;
- pad p1[2];
- pad p2[8];
- real base_map_u_scale;
- real base_map_v_scale;
- pad p3[116];
- block markers;
- block nodes;
- block regions;
- block geometries;
- block shaders;
- } model;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement