#ifndef BR_TYPES_H
#define BR_TYPES_H
#include "br_defs.h"
#include <setjmp.h>
#include <stddef.h>
#include <stdint.h>// size: 20
br_uint_32 reserved; // @0
char* identifier; // @4
br_uint_8 res_class; // @8
br_resourcefree_cbfn* free_cb; // @12
br_uint_32 alignment; // @16
} br_resource_class;
typedef struct br_filesystem {
char* identifier;
brfile_attributes_cbfn* attributes;
brfile_open_read_cbfn* open_read;
brfile_open_write_cbfn* open_write;
brfile_close_cbfn* close;
brfile_eof_cbfn* eof;
brfile_getchr_cbfn* getchr;
brfile_putchr_cbfn* putchr;
brfile_read_cbfn* read;
brfile_write_cbfn* write;
brfile_getline_cbfn* getline;
brfile_putline_cbfn* putline;
brfile_advance_cbfn* advance;
} br_filesystem;
typedef struct br_allocator {
char* identifier;
brmem_allocate_cbfn* allocate;
brmem_free_cbfn* free;
brmem_inquire_cbfn* inquire;
brmem_align_cbfn* align;
} br_allocator;
typedef struct br_diaghandler {
char* identifier;
br_diag_warning_cbfn* warning;
br_diag_failure_cbfn* failure;
} br_diaghandler;
typedef struct br_errorhandler {
char* identifier;
br_diag_warning_cbfn* message;
br_diag_failure_cbfn* error;
} br_errorhandler;
typedef struct br_colour_range {
br_colour low;
br_colour high;
} br_colour_range;
typedef struct br_matrix23 {
br_scalar m[3][2];
} br_matrix23;
typedef struct br_matrix23_f {
br_float m[3][2];
} br_matrix23_f;
typedef struct br_matrix23_x {
br_fixed_ls m[3][2];
} br_matrix23_x;
typedef struct br_matrix34 {
br_scalar m[4][3];
} br_matrix34;
typedef struct br_matrix34_f {
br_float m[4][3];
} br_matrix34_f;
typedef struct br_matrix34_x {
br_fixed_ls m[4][3];
} br_matrix34_x;
typedef struct br_matrix4 {
br_scalar m[4][4];
} br_matrix4;
typedef struct br_matrix4_f {
br_float m[4][4];
} br_matrix4_f;
typedef struct br_matrix4_x {
br_fixed_ls m[4][4];
} br_matrix4_x;
typedef struct br_vector2 {
br_scalar v[2];
} br_vector2;
typedef struct br_vector3 {
br_scalar v[3];
} br_vector3;
typedef struct br_vector4 {
br_scalar v[4];
} br_vector4;
typedef struct br_vector2_x {
br_fixed_ls v[2];
} br_vector2_x;
typedef struct br_vector3_x {
br_fixed_ls v[3];
} br_vector3_x;
typedef struct br_vector4_x {
br_fixed_ls v[4];
} br_vector4_x;
typedef struct br_vector2_f {
br_float v[2];
} br_vector2_f;
typedef struct br_vector3_f {
br_float v[3];
} br_vector3_f;
typedef struct br_vector4_f {
br_float v[4];
} br_vector4_f;
typedef struct br_vector2_i {
br_int_32 v[2];
} br_vector2_i;
typedef struct br_vector3_i {
br_int_32 v[3];
} br_vector3_i;
typedef struct br_vector4_i {
br_int_32 v[4];
} br_vector4_i;
typedef struct br_fvector2 {
br_fraction v[2];
} br_fvector2;
typedef struct br_fvector3 {
br_fraction v[3];
} br_fvector3;
typedef struct br_fvector4 {
br_fraction v[4];
} br_fvector4;
typedef struct br_fvector2_f {
br_fraction_f v[2];
} br_fvector2_f;
typedef struct br_fvector3_f {
br_fraction_f v[3];
} br_fvector3_f;
typedef struct br_fvector4_f {
br_fraction v[4];
} br_fvector4_f;
typedef struct br_fvector2_x {
br_fraction_x v[2];
} br_fvector2_x;
typedef struct br_fvector3_x {
br_fraction_x v[3];
} br_fvector3_x;
typedef struct br_fvector4_x {
br_fraction_x v[4];
} br_fvector4_x;
typedef struct br_bounds2 {
br_vector2 min;
br_vector2 max;
} br_bounds2;
typedef struct br_bounds3 {
br_vector3 min;
br_vector3 max;
} br_bounds3;
typedef struct br_bounds4 {
br_vector4 min;
br_vector4 max;
} br_bounds4;
typedef struct br_bounds2_f {
br_vector2_f min;
br_vector2_f max;
} br_bounds2_f;
typedef struct br_bounds3_f {
br_vector3_f min;
br_vector3_f max;
} br_bounds3_f;
typedef struct br_bounds4_f {
br_vector4_f min;
br_vector4_f max;
} br_bounds4_f;
typedef struct br_bounds2_x {
br_vector2_x min;
br_vector2_x max;
} br_bounds2_x;
typedef struct br_bounds3_x {
br_vector3_x min;
br_vector3_x max;
} br_bounds3_x;
typedef struct br_bounds4_x {
br_vector4_x min;
br_vector4_x max;
} br_bounds4_x;
typedef struct br_bounds2_i {
br_vector2_i min;
br_vector2_i max;
} br_bounds2_i;
typedef struct br_bounds3_i {
br_vector3_i min;
br_vector3_i max;
} br_bounds3_i;
typedef struct br_bounds4_i {
br_vector4_i min;
br_vector4_i max;
} br_bounds4_i;
typedef struct br_euler {
br_angle a;
br_angle b;
br_angle c;
br_uint_8 order;
} br_euler;
typedef struct br_quat {
br_scalar x;
br_scalar y;
br_scalar z;
br_scalar w;
} br_quat;
typedef struct br_transform { // size: 0x34
br_uint_16 type; // @0x0
union { // size: 0x30
br_matrix34 mat; // @0x0
struct { // size: 0x30
br_euler e; // @0x0
br_scalar _pad[7]; // @0x8
br_vector3 t; // @0x24
} euler; // @0x0
struct { // size: 0x30
br_quat q; // @0x0
br_scalar _pad[5]; // @0x10
br_vector3 t; // @0x24
} quat; // @0x0
struct { // size: 0x30
br_vector3 look; // @0x0
br_vector3 up; // @0xc
br_scalar _pad[3]; // @0x18
br_vector3 t; // @0x24
} look_up; // @0x0
struct { // size: 0x30
br_scalar _pad[9]; // @0x0
br_vector3 t; // @0x24
} translate; // @0x0
} t; // @0x4
} br_transform;
typedef struct br_pixelmap {
br_uint_32 _reserved;
char* identifier;
void* pixels;
br_uint_32 pixels_qualifier;
br_pixelmap* map;
br_colour_range src_key;
br_colour_range dst_key;
br_uint_32 key;
br_int_16 row_bytes;
br_int_16 mip_offset;
br_uint_8 type;
br_uint_8 flags;
br_uint_16 copy_function;
br_uint_16 base_x;
br_uint_16 base_y;
br_uint_16 width;
br_uint_16 height;
br_int_16 origin_x;
br_int_16 origin_y;
void* user;
void* stored;
} br_pixelmap;
typedef struct br_point {
br_int_32 x;
br_int_32 y;
} br_point;
typedef struct br_rectangle {
br_int_32 x;
br_int_32 y;
br_int_32 w;
br_int_32 h;
} br_rectangle;
#pragma pack(push, 1)
typedef struct br_font {
br_uint_32 flags;
br_uint_16 glyph_x;
br_uint_16 glyph_y;
br_int_16 spacing_x;
br_int_16 spacing_y;
br_int_8* width;
br_uint_16* encoding;
br_uint_8* glyphs;
} br_font;
#pragma pack(pop)
typedef struct br_object_dispatch br_object_dispatch;
typedef struct br_object {
br_object_dispatch* dispatch;
} br_object;
typedef struct br_token_value br_token_value;
typedef union br_value_tag {
br_uint_32 u32;
br_boolean b;
void* p;
br_token t;
br_int_8 i8;
br_uint_8 u8;
br_int_16 i16;
br_uint_16 u16;
br_int_32 i32;
br_fixed_ls x;
br_float f;
br_scalar s;
br_angle a;
br_colour rgb;
br_object* o;
br_vector2_i* v2_i;
br_vector3_i* v3_i;
br_vector4_i* v4_i;
br_vector2_x* v2_x;
br_vector3_x* v3_x;
br_vector4_x* v4_x;
br_vector2_f* v2_f;
br_vector3_f* v3_f;
br_vector4_f* v4_f;
br_matrix23_x* m23_x;
br_matrix34_x* m34_x;
br_matrix4_x* m4_x;
br_matrix23_f* m23_f;
br_matrix34_f* m34_f;
br_matrix4_f* m4_f;
char* str;
char* cstr;
br_object** hl;
br_token* tl;
void** pl;
br_token_value* tvl;
} br_value;
typedef struct br_token_value {
br_token t;
br_value v;
} br_token_value;
typedef struct br_pool_block br_pool_block;
typedef struct br_pool_block {
br_pool_block* next;
} br_pool_block;
typedef struct br_pool {
br_pool_block* free;
br_uint_32 block_size;
br_uint_32 chunk_size;
int mem_type;
} br_pool;
typedef struct br_primitive {
br_primitive* next;
br_uint_32 type;
void* stored;
void* v[3];
} br_primitive;
typedef struct br_order_table {
br_primitive** table;
br_uint_16 size;
br_order_table* next;
br_scalar min_z;
br_scalar max_z;
br_scalar sort_z;
br_scalar scale;
br_uint_32 flags;
br_uint_16 type;
br_uint_16 visits;
} br_order_table;
typedef struct br_primitive_heap {
br_uint_8* base;
br_size_t size;
br_uint_8* current;
} br_primitive_heap;
typedef struct br_associative_array_tag {
br_token_value* tv;
br_uint_16 num_elements;
br_uint_16 max_elements;
} br_associative_array;
typedef struct br_device { // size: 68
br_uint_32 magic; // @0
char* identifier; // @4
br_font* default_font; // @8
br_uint_32 qualifier; // @12
dev_fill_cbfn* fill; // @16
dev_rectangle_copy_cbfn* rectangle_copy; // @20
dev_rectangle_fill_cbfn* rectangle_fill; // @24
dev_dirty_rectangle_copy_cbfn* dirty_rectangle_copy; // @28
dev_dirty_rectangle_fill_cbfn* dirty_rectangle_fill; // @32
dev_plot_cbfn* plot; // @36
dev_copy_cbfn* copy; // @40
dev_line_cbfn* line; // @44
dev_copy_bits_cbfn* copy_bits; // @48
dev_double_buffer_cbfn* double_buffer; // @52
dev_match_cbfn* match; // @56
dev_clone_cbfn* clone; // @60
dev_free_cbfn* free; // @64
} br_device;
typedef struct br_outfcty_desc {
br_int_32 width;
br_int_32 width_min;
br_int_32 width_max;
br_int_32 height;
br_int_32 height_min;
br_int_32 height_max;
br_uint_8 pmtype;
br_int_32 pmbits;
br_boolean indexed;
br_boolean fullscreen;
} br_outfcty_desc;
typedef struct br_renderer_facility br_renderer_facility;
typedef struct br_device_pixelmap_dispatch br_device_pixelmap_dispatch;
typedef struct br_device_pixelmap { // size: 0x44
br_device_pixelmap_dispatch* dispatch; // @0x0
char* pm_identifier; // @0x4
void* pm_pixels; // @0x8
br_uint_32 pm_pixels_qualifier; // @0xc
br_pixelmap* pm_map; // @0x10
br_colour_range pm_src_key; // @0x14
br_colour_range pm_dst_key; // @0x1c
br_uint_32 pm_key; // @0x24
br_int_16 pm_row_bytes; // @0x28
br_int_16 pm_mip_offset; // @0x2a
br_uint_8 pm_type; // @0x2c
br_uint_8 pm_flags; // @0x2d
br_uint_16 pm_copy_function; // @0x2e
br_uint_16 pm_base_x; // @0x30
br_uint_16 pm_base_y; // @0x32
br_uint_16 pm_width; // @0x34
br_uint_16 pm_height; // @0x36
br_int_16 pm_origin_x; // @0x38
br_int_16 pm_origin_y; // @0x3a
void* pm_user; // @0x3c
void* pm_stored; // @0x40
} br_device_pixelmap;
typedef struct br_primitive_library br_primitive_library;
typedef struct br_geometry br_geometry;
typedef struct br_renderer_dispatch br_renderer_dispatch;
typedef struct br_renderer {
br_renderer_dispatch* dispatch;
} br_renderer;
typedef struct br_material { // size: 0x74
br_uint_32 _reserved; // @0x0
char* identifier; // @0x4
br_colour colour; // @0x8
br_uint_8 opacity; // @0xc
br_ufraction ka; // @0x10
br_ufraction kd; // @0x14
br_ufraction ks; // @0x18
br_scalar power; // @0x1c
br_uint_32 flags; // @0x20
br_matrix23 map_transform; // @0x24
br_uint_8 index_base; // @0x3c
br_uint_8 index_range; // @0x3d
br_pixelmap* colour_map; // @0x40
br_pixelmap* screendoor; // @0x44
br_pixelmap* index_shade; // @0x48
br_pixelmap* index_blend; // @0x4c
br_pixelmap* index_fog; // @0x50
br_token_value* extra_surf; // @0x54
br_token_value* extra_prim; // @0x58
br_scalar fog_min; // @0x5c
br_scalar fog_max; // @0x60
br_colour fog_colour; // @0x64
br_int_32 subdivide_tolerance; // @0x68
void* user; // @0x6c
void* stored; // @0x70
} br_material;
typedef struct br_vertex {
br_vector3 p;
br_vector2 map;
br_uint_8 index;
br_uint_8 red;
br_uint_8 grn;
br_uint_8 blu;
br_uint_16 _pad0;
br_fvector3 n;
} br_vertex;
typedef struct br_face {
br_uint_16 vertices[3];
br_uint_16 smoothing;
br_material* material;
br_uint_8 index;
br_uint_8 red;
br_uint_8 grn;
br_uint_8 blu;
br_uint_8 flags;
br_uint_8 _pad0;
br_uint_32 _pad1;
br_fvector3 n;
br_scalar d;
} br_face;
typedef struct br_primitive_list br_primitive_list;
typedef struct br_primitive_list {
br_primitive_list* next;
br_uint_32 prim_type;
br_uint_16 nprims;
br_uint_16 nspares;
void* prim;
void* spare;
} br_primitive_list;
typedef struct br_vertex_single {
br_vector3 p;
br_vector2 map;
br_uint_8 alpha;
br_uint_8 red;
br_uint_8 grn;
br_uint_8 blu;
br_uint_16 _pad0;
br_fvector3 n;
} br_vertex_single;
typedef struct br_vertex_double {
br_vector3 p;
br_vector2 map0;
br_uint_8 alpha0;
br_uint_8 red0;
br_uint_8 grn0;
br_uint_8 blu0;
br_vector2 map1;
br_uint_8 alpha1;
br_uint_8 red1;
br_uint_8 grn1;
br_uint_8 blu1;
br_fvector3 n;
} br_vertex_double;
typedef struct br_point_prim {
br_uint_16 vertices[1];
br_material* material;
} br_point_prim;
typedef struct br_line {
br_uint_16 vertices[2];
br_material* material;
br_uint_8 alpha0;
br_uint_8 red0;
br_uint_8 grn0;
br_uint_8 blu0;
br_uint_8 alpha1;
br_uint_8 red1;
br_uint_8 grn1;
br_uint_8 blu1;
} br_line;
typedef struct br_triangle {
br_uint_16 vertices[3];
br_uint_16 smoothing;
br_material* material;
br_uint_8 alpha0;
br_uint_8 red0;
br_uint_8 grn0;
br_uint_8 blu0;
br_uint_8 alpha1;
br_uint_8 red1;
br_uint_8 grn1;
br_uint_8 blu1;
br_uint_8 flags;
br_fvector3 n;
br_scalar d;
} br_triangle;
typedef struct br_quad {
br_uint_16 vertices[4];
br_uint_16 smoothing;
br_material* material;
br_uint_8 alpha0;
br_uint_8 red0;
br_uint_8 grn0;
br_uint_8 blu0;
br_uint_8 alpha1;
br_uint_8 red1;
br_uint_8 grn1;
br_uint_8 blu1;
br_uint_8 flags;
br_fvector3 n;
br_scalar d;
} br_quad;
typedef struct br_strip_face_data {
br_uint_16 smoothing;
br_uint_8 alpha0;
br_uint_8 red0;
br_uint_8 grn0;
br_uint_8 blu0;
br_uint_8 alpha1;
br_uint_8 red1;
br_uint_8 grn1;
br_uint_8 blu1;
br_uint_8 flags;
br_fvector3 n;
br_scalar d;
} br_strip_face_data;
typedef struct br_tri_strip {
br_uint_16 nvertices;
br_uint_16* vertices;
br_material* material;
br_strip_face_data* face_data;
} br_tri_strip;
typedef struct br_actor { // size: 0x64
br_actor* next; // @0x0
br_actor** prev; // @0x4
br_actor* children; // @0x8
br_actor* parent; // @0xc
br_uint_16 depth; // @0x10
br_uint_8 type; // @0x12
char* identifier; // @0x14
br_model* model; // @0x18
br_material* material; // @0x1c
br_uint_8 render_style; // @0x20
void* render_data; // @0x24
br_transform t; // @0x28
void* type_data; // @0x5c
void* user; // @0x60
} br_actor;
typedef struct br_model { // size: 0x54
br_uint_32 _reserved; // @0x0
char* identifier; // @0x4
br_vertex* vertices; // @0x8
br_face* faces; // @0xc
br_uint_16 nvertices; // @0x10
br_uint_16 nfaces; // @0x12
br_vector3 pivot; // @0x14
br_uint_16 flags; // @0x20
br_model_custom_cbfn* custom; // @0x24
void* user; // @0x28
br_angle crease_angle; // @0x2c
br_scalar radius; // @0x30
br_bounds bounds; // @0x34
void* prepared; // @0x4c
void* stored; // @0x50
} br_model;
typedef struct br_camera {
char* identifier;
br_uint_8 type;
br_angle field_of_view;
br_scalar hither_z;
br_scalar yon_z;
br_scalar aspect;
br_scalar width;
br_scalar height;
br_scalar distance;
void* user;
} br_camera;
typedef struct br_light {
char* identifier;
br_uint_8 type;
br_colour colour;
br_scalar attenuation_c;
br_scalar attenuation_l;
br_scalar attenuation_q;
br_angle cone_outer;
br_angle cone_inner;
void* user;
} br_light;
typedef struct br_fmt_results {
br_actor** actors;
br_model** models;
br_light** lights;
br_camera** cameras;
br_vector4** clip_planes;
br_bounds3** bounds;
br_bounds3** bounds_correct;
br_material** materials;
br_pixelmap** pixelmaps;
br_uint_32 nactors;
br_uint_32 nmodels;
br_uint_32 nlights;
br_uint_32 ncameras;
br_uint_32 nclip_planes;
br_uint_32 nbounds;
br_uint_32 nbounds_correct;
br_uint_32 nmaterials;
br_uint_32 npixelmaps;
} br_fmt_results;
typedef struct br_fmt_options {
br_uint_32 convert_flags;
} br_fmt_options;
typedef struct br_3ds_options {
br_uint_32 flags;
br_scalar hither;
br_scalar yon;
br_scalar scale;
br_fmt_report_cbfn* report;
} br_3ds_options;
typedef struct br_registery br_registry;
typedef void* br_find_failed_cbfn(char*);
typedef br_uint_32 br_enum_cbfn(void*, void*);
typedef void br_surface_fn(br_vertex*, br_fvector3*, br_scalar*);
typedef br_uint_32 br_face_surface_fn(br_vertex*, br_face*, int);
typedef struct br_active_light br_active_light;
typedef void br_light_sub_fn(br_vector3*, br_fvector3*, br_active_light*, br_scalar*);
typedef void br_model_update_cbfn(br_model*, br_uint_16);
typedef void br_material_update_cbfn(br_material*, br_uint_16);
typedef void br_table_update_cbfn(br_pixelmap*, br_uint_16);
typedef void br_map_update_cbfn(br_pixelmap*, br_uint_16);
typedef struct br_node br_node;
typedef struct br_node {
br_node* next;
br_node* prev;
} br_node;
typedef struct br_list {
br_node* head;
br_node* _null;
br_node* tail;
} br_list;
typedef struct br_simple_node br_simple_node;
typedef struct br_simple_node {
br_simple_node* next;
br_simple_node** prev;
} br_simple_node;
typedef struct br_simple_list {
br_simple_node* head;
} br_simple_list;
typedef struct br_registry_entry { // size: 12
br_node node; // @0
char** item; // @8
} br_registry_entry;
typedef struct br_registery { // size: 20
br_list list; // @0
int count; // @12
br_find_failed_cbfn* find_failed_hook; // @16
} br_registry;
typedef struct br_active_light {
br_scalar intensity;
br_vector3 view_position;
br_vector3 view_direction;
br_vector3 position;
br_vector3 direction;
br_vector3 half;
br_scalar spot_cosine_outer;
br_scalar spot_cosine_inner;
void (*light_sub_function)(br_vector3*, br_fvector3*, br_active_light*, br_scalar*);
int type;
br_light* light;
} br_active_light;
typedef struct br_active_clip_plane {
br_vector4 screen_plane;
} br_active_clip_plane;
typedef struct fw_fn_table {
br_surface_fn* light;
br_surface_fn* light_material;
br_surface_fn* light_vertex;
br_surface_fn* light_texture;
br_face_surface_fn* face_light;
br_light_sub_fn* direct;
br_light_sub_fn* point;
br_light_sub_fn* point_attn;
br_light_sub_fn* spot;
br_light_sub_fn* spot_attn;
} fw_fn_table;
typedef struct br_image_section {
char* name;
void* base;
br_size_t mem_offset;
br_size_t mem_size;
br_uint_32 data_offset;
br_uint_32 data_size;
} br_image_section;
typedef struct br_image br_image;
typedef struct br_image {
br_node node;
char* identifier;
br_int_32 type;
br_int_32 ref_count;
br_uint_32 ordinal_base;
br_uint_32 n_functions;
void** functions;
br_uint_32 n_names;
char** names;
br_uint_16* name_ordinals;
br_uint_16 n_imports;
br_image** imports;
br_uint_16 n_sections;
br_image_section* sections;
void* type_pointer;
} br_image;
typedef struct br_open_device {
br_device* dev;
br_image* image;
} br_open_device;
typedef struct br_framework_state { // size: 1136
br_boolean active; // @0
br_registry reg_resource_classes; // @4
br_resource_class* resource_class_index[256]; // @24
br_list tokens; // @1048
br_token next_free_token; // @1060
br_filesystem* fsys; // @1064
br_allocator* mem; // @1068
br_diaghandler* diag; // @1072
int open_mode; // @1076
void* res; // @1080
void* scratch_ptr; // @1084
br_size_t scratch_size; // @1088
br_size_t scratch_last; // @1092
int scratch_inuse; // @1096
br_error last_error_type; // @1100
void** last_error_value; // @1104
br_list images; // @1108
br_open_device* dev_slots; // @1120
br_int_32 ndev_slots; // @1124
br_associative_array* sys_config; // @1128
br_boolean bAlreadyLoadedDrivers; // @1132
} br_framework_state;
// br_framework_state defined by "C:\DETHRACE\source\common\finteray.c" module
typedef struct br_framework_state2 { // size: 0x14d4
br_surface_fn* surface_fn; // @0x0
br_surface_fn* surface_fn_after_map; // @0x4
br_surface_fn* surface_fn_after_copy; // @0x8
br_face_surface_fn* face_surface_fn; // @0xc
br_matrix23 map_transform; // @0x10
br_scalar index_base; // @0x28
br_scalar index_range; // @0x2c
br_matrix4 model_to_screen; // @0x30
br_matrix4 view_to_screen; // @0x70
br_matrix34 model_to_view; // @0xb0
br_matrix34 view_to_model; // @0xe0
br_matrix34 model_to_environment; // @0x110
struct { // size: 0x34
br_matrix34 m; // @0x0
br_actor* a; // @0x30
} camera_path[16]; // @0x140
int vtos_type; // @0x480
br_vector3 eye_m; // @0x484
br_vector3 eye_m_normalised; // @0x490
br_material* material; // @0x49c
br_active_light active_lights_model[16]; // @0x4a0
br_active_light active_lights_view[16]; // @0x9e0
br_uint_16 nactive_lights_model; // @0xf20
br_uint_16 nactive_lights_view; // @0xf22
int light_is_1md; // @0xf24
br_vector3 eye_l; // @0xf28
br_active_clip_plane active_clip_planes[6]; // @0xf34
br_uint_16 nactive_clip_planes; // @0xf94
br_actor* enabled_lights[16]; // @0xf98
br_actor* enabled_clip_planes[6]; // @0xfd8
br_actor* enabled_environment; // @0xff0
br_pixelmap* output; // @0xff4
br_scalar vp_width; // @0xff8
br_scalar vp_height; // @0xffc
br_scalar vp_ox; // @0x1000
br_scalar vp_oy; // @0x1004
int rendering; // @0x1008
br_registry reg_models; // @0x100c
br_registry reg_materials; // @0x1020
br_registry reg_textures; // @0x1034
br_registry reg_tables; // @0x1048
br_registry reg_resource_classes; // @0x105c
br_resource_class* resource_class_index[256]; // @0x1070
br_model_update_cbfn* model_update; // @0x1470
br_material_update_cbfn* material_update; // @0x1474
br_table_update_cbfn* table_update; // @0x1478
br_map_update_cbfn* map_update; // @0x147c
br_filesystem* fsys; // @0x1480
br_allocator* mem; // @0x1484
br_errorhandler* err; // @0x1488
int open_mode; // @0x148c
void* res; // @0x1490
br_model* default_model; // @0x1494
br_material* default_material; // @0x1498
fw_fn_table fn_table; // @0x149c
void* scratch_ptr; // @0x14c4
br_size_t scratch_size; // @0x14c8
br_size_t scratch_last; // @0x14cc
int scratch_inuse; // @0x14d0
} br_framework_state2;
typedef br_error br_exception;
typedef void br_resident_fn(void);
typedef struct br_tv_template_entry {
br_token token;
char* name;
br_int_32 offset;
br_int_16 flags;
br_int_16 conv;
br_int_32 conv_arg;
br_int_32 mask;
} br_tv_template_entry;
typedef struct br_tv_template {
int n_entries;
br_tv_template_entry* entries;
br_int_32 map_base;
br_int_32 n_map_entries;
br_tv_template_entry** map_query_entry;
br_tv_template_entry** map_set_entry;
br_boolean names_resolved;
void* res;
} br_tv_template;
typedef struct br_object_container_dispatch br_object_container_dispatch;
typedef struct br_object_container {
br_object_container_dispatch* dispatch;
} br_object_container;
typedef struct br_object_container_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
void* (*_listQuery)(br_object_container*);
void* (*_tokensMatchBegin)(br_object_container*, br_token, br_token_value*);
br_boolean (*_tokensMatch)(br_object_container*, br_object*, void*);
void (*_tokensMatchEnd)(br_object_container*, void*);
br_error (*_addFront)(br_object_container*, br_object*);
br_error (*_removeFront)(br_object_container*, br_object**);
br_error (*_remove)(br_object_container*, br_object*);
br_error (*_find)(br_object_container*, br_object**, br_token, char*, br_token_value*);
br_error (*_findMany)(br_object_container*, br_object**, br_int_32, br_int_32*, br_token, char*, br_token_value*);
br_error (*_count)(br_object_container*, br_int_32*, br_token, char*, br_token_value*);
} br_object_container_dispatch;
typedef struct br_device_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
void* (*_listQuery)(br_object_container*);
void* (*_tokensMatchBegin)(br_object_container*, br_token, br_token_value*);
br_boolean (*_tokensMatch)(br_object_container*, br_object*, void*);
void (*_tokensMatchEnd)(br_object_container*, void*);
br_error (*_addFront)(br_object_container*, br_object*);
br_error (*_removeFront)(br_object_container*, br_object**);
br_error (*_remove)(br_object_container*, br_object*);
br_error (*_find)(br_object_container*, br_object**, br_token, char*, br_token_value*);
br_error (*_findMany)(br_object_container*, br_object**, br_int_32, br_int_32*, br_token, char*, br_token_value*);
br_error (*_count)(br_object_container*, br_int_32*, br_token, char*, br_token_value*);
} br_device_dispatch;
// br_device. Not sure when this is used
typedef struct br_device_2 {
br_device_dispatch* dispatch;
} br_device_2;
typedef struct br_object_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
} br_object_dispatch;
typedef struct br_geometry_stored_dispatch br_geometry_stored_dispatch;
typedef struct br_geometry_stored {
br_geometry_stored_dispatch* dispatch;
} br_geometry_stored;
typedef struct br_renderer_state_stored_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
} br_renderer_state_stored_dispatch;
typedef struct br_renderer_state_stored {
br_renderer_state_stored_dispatch* dispatch;
} br_renderer_state_stored;
typedef struct br_buffer_stored_dispatch br_buffer_stored_dispatch;
typedef struct br_buffer_stored {
br_buffer_stored_dispatch* dispatch;
} br_buffer_stored;
typedef struct br_device_pixelmap_dispatch { // size: 0xe0
void (*__reserved0)(br_object*); // @0x0
void (*__reserved1)(br_object*); // @0x4
void (*__reserved2)(br_object*); // @0x8
void (*__reserved3)(br_object*); // @0xc
void (*_free)(br_object*); // @0x10
char* (*_identifier)(br_object*); // @0x14
br_token (*_type)(br_object*); // @0x18
br_boolean (*_isType)(br_object*, br_token); // @0x1c
br_device* (*_device)(br_object*); // @0x20
br_int_32 (*_space)(br_object*); // @0x24
br_tv_template* (*_templateQuery)(br_object*); // @0x28
br_error (*_query)(br_object*, br_uint_32*, br_token); // @0x2c
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token); // @0x30
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*); // @0x34
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*); // @0x38
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t); // @0x3c
br_error (*_queryAllSize)(br_object*, br_size_t*); // @0x40
br_error (*_validSource)(br_device_pixelmap*, br_boolean*, br_object*); // @0x44
br_error (*_resize)(br_device_pixelmap*, br_int_32, br_int_32); // @0x48
br_error (*_match)(br_device_pixelmap*, br_device_pixelmap**, br_token_value*); // @0x4c
br_error (*_allocateSub)(br_device_pixelmap*, br_device_pixelmap**, br_rectangle*); // @0x50
br_error (*_copy)(br_device_pixelmap*, br_device_pixelmap*); // @0x54
br_error (*_copyTo)(br_device_pixelmap*, br_device_pixelmap*); // @0x58
br_error (*_copyFrom)(br_device_pixelmap*, br_device_pixelmap*); // @0x5c
br_error (*_fill)(br_device_pixelmap*, br_uint_32); // @0x60
br_error (*_doubleBuffer)(br_device_pixelmap*, br_device_pixelmap*); // @0x64
br_error (*_copyDirty)(br_device_pixelmap*, br_device_pixelmap*, br_rectangle*, br_int_32); // @0x68
br_error (*_copyToDirty)(br_device_pixelmap*, br_device_pixelmap*, br_rectangle*, br_int_32); // @0x6c
br_error (*_copyFromDirty)(br_device_pixelmap*, br_device_pixelmap*, br_rectangle*, br_int_32); // @0x70
br_error (*_fillDirty)(br_device_pixelmap*, br_uint_32, br_rectangle*, br_int_32); // @0x74
br_error (*_doubleBufferDirty)(br_device_pixelmap*, br_device_pixelmap*, br_rectangle*, br_int_32); // @0x78
br_error (*_rectangle)(br_device_pixelmap*, br_rectangle*, br_uint_32); // @0x7c
br_error (*_rectangle2)(br_device_pixelmap*, br_rectangle*, br_uint_32, br_uint_32); // @0x80
br_error (*_rectangleCopy)(br_device_pixelmap*, br_point*, br_device_pixelmap*, br_rectangle*); // @0x84
br_error (*_rectangleCopyTo)(br_device_pixelmap*, br_point*, br_device_pixelmap*, br_rectangle*); // @0x88
br_error (*_rectangleCopyFrom)(br_device_pixelmap*, br_point*, br_device_pixelmap*, br_rectangle*); // @0x8c
br_error (*_rectangleStretchCopy)(br_device_pixelmap*, br_rectangle*, br_device_pixelmap*, br_rectangle*); // @0x90
br_error (*_rectangleStretchCopyTo)(br_device_pixelmap*, br_rectangle*, br_device_pixelmap*, br_rectangle*); // @0x94
br_error (*_rectangleStretchCopyFrom)(br_device_pixelmap*, br_rectangle*, br_device_pixelmap*, br_rectangle*); // @0x98
br_error (*_rectangleFill)(br_device_pixelmap*, br_rectangle*, br_uint_32); // @0x9c
br_error (*_pixelSet)(br_device_pixelmap*, br_point*, br_uint_32); // @0xa0
br_error (*_line)(br_device_pixelmap*, br_point*, br_point*, br_uint_32); // @0xa4
br_error (*_copyBits)(br_device_pixelmap*, br_point*, br_uint_8*, br_uint_16, br_rectangle*, br_uint_32); // @0xa8
br_error (*_text)(br_device_pixelmap*, br_point*, br_font*, char*, br_uint_32); // @0xac
br_error (*_textBounds)(br_device_pixelmap*, br_rectangle*, br_font*, char*); // @0xb0
br_error (*_rowSize)(br_device_pixelmap*, br_size_t*); // @0xb4
br_error (*_rowSet)(br_device_pixelmap*, void*, br_size_t, br_uint_32); // @0xb8
br_error (*_rowQuery)(br_device_pixelmap*, void*, br_size_t, br_uint_32); // @0xbc
br_error (*_pixelQuery)(br_device_pixelmap*, br_uint_32*, br_point*); // @0xc0
br_error (*_pixelAddressQuery)(br_device_pixelmap*, void**, br_uint_32*, br_point*); // @0xc4
br_error (*_pixelAddressSet)(br_device_pixelmap*, void*, br_uint_32*); // @0xc8
br_error (*_originSet)(br_device_pixelmap*, br_point*); // @0xcc
br_error (*_flush)(br_device_pixelmap*); // @0xd0
br_error (*_synchronise)(br_device_pixelmap*, br_token, br_boolean); // @0xd4
br_error (*_directLock)(br_device_pixelmap*, br_boolean); // @0xd8
br_error (*_directUnlock)(br_device_pixelmap*); // @0xdc
} br_device_pixelmap_dispatch;
typedef struct br_buffer_stored_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
br_error (*_update)(br_buffer_stored*, br_device_pixelmap*, br_token_value*);
} br_buffer_stored_dispatch;
typedef struct brp_vertex brp_vertex;
typedef struct br_renderer_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
void* (*_listQuery)(br_object_container*);
void* (*_tokensMatchBegin)(br_object_container*, br_token, br_token_value*);
br_boolean (*_tokensMatch)(br_object_container*, br_object*, void*);
void (*_tokensMatchEnd)(br_object_container*, void*);
br_error (*_addFront)(br_object_container*, br_object*);
br_error (*_removeFront)(br_object_container*, br_object**);
br_error (*_remove)(br_object_container*, br_object*);
br_error (*_find)(br_object_container*, br_object**, br_token, char*, br_token_value*);
br_error (*_findMany)(br_object_container*, br_object**, br_int_32, br_int_32*, br_token, char*, br_token_value*);
br_error (*_count)(br_object_container*, br_int_32*, br_token, char*, br_token_value*);
br_error (*_validDestination)(br_renderer*, br_boolean*, br_object*);
br_error (*_stateStoredNew)(br_renderer*, br_renderer_state_stored**, br_uint_32, br_token_value*);
br_error (*_stateStoredAvail)(br_renderer*, br_int_32*, br_uint_32, br_token_value*);
br_error (*_bufferStoredNew)(br_renderer*, br_buffer_stored**, br_token, br_device_pixelmap*, br_token_value*);
br_error (*_bufferStoredAvail)(br_renderer*, br_int_32*, br_token, br_token_value*);
br_error (*_partSet)(br_renderer*, br_token, br_int_32, br_token, uintptr_t);
br_error (*_partSetMany)(br_renderer*, br_token, br_int_32, br_token_value*, br_int_32*);
br_error (*_partQuery)(br_renderer*, br_token, br_int_32, br_uint_32*, br_token);
br_error (*_partQueryBuffer)(br_renderer*, br_token, br_int_32, br_uint_32*, br_uint_32*, br_size_t, br_token);
br_error (*_partQueryMany)(br_renderer*, br_token, br_int_32, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_partQueryManySize)(br_renderer*, br_token, br_int_32, br_size_t*, br_token_value*);
br_error (*_partQueryAll)(br_renderer*, br_token, br_int_32, br_token_value*, br_size_t);
br_error (*_partQueryAllSize)(br_renderer*, br_token, br_int_32, br_size_t*);
br_error (*_partIndexQuery)(br_renderer*, br_token, br_int_32*);
br_error (*_modelMulF)(br_renderer*, br_matrix34_f*);
br_error (*_modelMulX)(br_renderer*, br_matrix34_x*);
br_error (*_modelPopPushMulF)(br_renderer*, br_matrix34_f*);
br_error (*_modelPopPushMulX)(br_renderer*, br_matrix34_x*);
br_error (*_modelInvert)(br_renderer*);
br_error (*_statePush)(br_renderer*, br_uint_32);
br_error (*_statePop)(br_renderer*, br_uint_32);
br_error (*_stateSave)(br_renderer*, br_renderer_state_stored*, br_uint_32);
br_error (*_stateRestore)(br_renderer*, br_renderer_state_stored*, br_uint_32);
br_error (*_stateMask)(br_renderer*, br_uint_32*, br_token*, int);
br_error (*_stateDefault)(br_renderer*, br_uint_32);
br_error (*_boundsTestF)(br_renderer*, br_token*, br_bounds3_f*);
br_error (*_boundsTestX)(br_renderer*, br_token*, br_bounds3_x*);
br_error (*_coverageTestF)(br_renderer*, br_float*, br_bounds3_f*);
br_error (*_coverageTestX)(br_renderer*, br_fixed_ls*, br_bounds3_x*);
br_error (*_viewDistanceF)(br_renderer*, br_float*);
br_error (*_viewDistanceX)(br_renderer*, br_fixed_ls*);
br_error (*_commandModeSet)(br_renderer*, br_token);
br_error (*_commandModeQuery)(br_renderer*, br_token*);
br_error (*_commandModeDefault)(br_renderer*);
br_error (*_commandModePush)(br_renderer*);
br_error (*_commandModePop)(br_renderer*);
br_error (*_flush)(br_renderer*, br_boolean);
br_error (*_synchronise)(br_renderer*, br_token, br_boolean);
br_error (*_testRender)(br_renderer*, br_token, brp_vertex*, brp_vertex*, brp_vertex*);
br_error (*_partQueryCapability)(br_renderer*, br_token, br_int_32, br_token_value*, br_size_t);
br_error (*_stateQueryPerformance)(br_renderer*, br_fixed_lu*);
} br_renderer_dispatch;
typedef struct br_geometry_stored_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
br_error (*_render)(br_geometry_stored*, br_renderer*);
br_error (*_renderOnScreen)(br_geometry_stored*, br_renderer*);
} br_geometry_stored_dispatch;
typedef struct br_file_struct_member {
br_uint_16 type;
br_uint_32 offset;
char* name;
void* extra;
} br_file_struct_member;
typedef struct br_file_struct {
char* name;
br_uint_32 nmembers;
br_file_struct_member* members;
int mem_size;
} br_file_struct;
typedef struct br_file_primitives br_file_primitives;
typedef struct br_datafile { // size: 0x10
void* h; // @0x0
br_file_primitives* prims; // @0x4
br_token scalar_type; // @0x8
void* res; // @0xc
} br_datafile;
typedef struct br_file_primitives {
char* identifier;
int (*skip)(br_datafile*, br_uint_32);
int (*chunk_write)(br_datafile*, br_uint_32, br_uint_32);
int (*chunk_read)(br_datafile*, br_uint_32*);
void (*count_write)(br_datafile*, br_uint_32);
br_uint_32 (*count_read)(br_datafile*);
int (*count_size)(br_datafile*);
br_uint_32 (*struct_write)(br_datafile*, br_file_struct*, void*);
br_uint_32 (*struct_read)(br_datafile*, br_file_struct*, void*);
int (*struct_size)(br_datafile*, br_file_struct*, void*);
int (*block_write)(br_datafile*, void*, int, int, int, int);
void* (*block_read)(br_datafile*, void*, int*, int, int);
int (*block_size)(br_datafile*, void*, int, int, int, int);
int (*name_write)(br_datafile*, char*);
char* (*name_read)(br_datafile*, char*);
int (*name_size)(br_datafile*, char*);
} br_file_primitives;
typedef struct br_chunks_table_entry {
br_uint_32 id;
br_uint_8 has_count;
int (*handler)(br_datafile*, br_uint_32, br_uint_32, br_uint_32);
} br_chunks_table_entry;
typedef struct br_chunks_table {
int nentries;
br_chunks_table_entry* entries;
} br_chunks_table;
typedef struct br_file_enum_member {
int value;
char* name;
} br_file_enum_member;
typedef struct br_file_enum {
br_uint_32 nmembers;
br_file_enum_member* members;
} br_file_enum;
typedef struct br_device_clut_dispatch br_device_clut_dispatch;
typedef struct br_device_clut {
br_device_clut_dispatch* dispatch;
} br_device_clut;
typedef struct br_device_clut_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
br_error (*_entrySet)(br_device_clut*, br_int_32, br_colour);
br_error (*_entryQuery)(br_device_clut*, br_colour*, br_int_32);
br_error (*_entrySetMany)(br_device_clut*, br_int_32, br_int_32, br_colour*);
br_error (*_entryQueryMany)(br_device_clut*, br_colour*, br_int_32, br_int_32);
} br_device_clut_dispatch;
typedef struct br_geometry_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
} br_geometry_dispatch;
typedef struct br_geometry_lighting_dispatch br_geometry_lighting_dispatch;
typedef struct br_geometry_lighting {
br_geometry_lighting_dispatch* dispatch;
} br_geometry_lighting;
typedef struct br_geometry_lighting_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
br_error (*_renderF)(br_geometry_lighting*, br_renderer*, br_vector3_f*, br_vector3_f*, br_colour*, br_colour*, br_uint_16*, int, int, int, int, int);
br_error (*_renderX)(br_geometry_lighting*, br_renderer*, br_vector3_x*, br_vector3_x*, br_colour*, br_colour*, br_uint_16*, int, int, int, int, int);
} br_geometry_lighting_dispatch;
typedef struct br_v1db_enable {
br_int_32 max;
br_int_32 count;
br_int_32 type;
char* name;
br_actor** enabled;
} br_v1db_enable;
typedef struct br_v1db_state { // size: 0x504
br_boolean active; // @0x0
br_boolean zs_active; // @0x4
br_boolean zb_active; // @0x8
br_int_32 rendering; // @0xc
br_renderer* renderer; // @0x10
br_renderer* query_renderer; // @0x14
br_geometry* format_model; // @0x18
br_geometry* format_buckets; // @0x1c
br_geometry_lighting* format_lighting; // @0x20
br_matrix4 model_to_screen; // @0x24
br_matrix34 model_to_view; // @0x64
br_boolean model_to_screen_valid; // @0x94
br_uint_32 ttype; // @0x98
br_actor* render_root; // @0x9c
struct { // size: 0x38
br_matrix34 m; // @0x0
br_actor* a; // @0x30
br_uint_8 transform_type; // @0x34
} camera_path[16]; // @0xa0
br_v1db_enable enabled_lights; // @0x420
br_v1db_enable enabled_clip_planes; // @0x434
br_v1db_enable enabled_horizon_planes; // @0x448
br_int_32 max_light; // @0x45c
br_int_32 max_clip; // @0x460
br_actor* enabled_environment; // @0x464
br_registry reg_models; // @0x468
br_registry reg_materials; // @0x47c
br_registry reg_textures; // @0x490
br_registry reg_tables; // @0x4a4
void* res; // @0x4b8
br_model* default_model; // @0x4bc
br_material* default_material; // @0x4c0
void* default_render_data; // @0x4c4
br_order_table* default_order_table; // @0x4c8
br_order_table* primary_order_table; // @0x4cc
br_order_table* order_table_list; // @0x4d0
br_primitive_heap heap; // @0x4d4
br_primitive_cbfn* primitive_call; // @0x4e0
br_renderbounds_cbfn* bounds_call; // @0x4e4
br_vector2 origin; // @0x4e8
br_scalar vp_ox; // @0x4f0
br_scalar vp_oy; // @0x4f4
br_scalar vp_width; // @0x4f8
br_scalar vp_height; // @0x4fc
br_pixelmap* colour_buffer; // @0x500
} br_v1db_state;
typedef struct br_renderer_facility_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
void* (*_listQuery)(br_object_container*);
void* (*_tokensMatchBegin)(br_object_container*, br_token, br_token_value*);
br_boolean (*_tokensMatch)(br_object_container*, br_object*, void*);
void (*_tokensMatchEnd)(br_object_container*, void*);
br_error (*_addFront)(br_object_container*, br_object*);
br_error (*_removeFront)(br_object_container*, br_object**);
br_error (*_remove)(br_object_container*, br_object*);
br_error (*_find)(br_object_container*, br_object**, br_token, char*, br_token_value*);
br_error (*_findMany)(br_object_container*, br_object**, br_int_32, br_int_32*, br_token, char*, br_token_value*);
br_error (*_count)(br_object_container*, br_int_32*, br_token, char*, br_token_value*);
br_error (*_validDestination)(br_renderer_facility*, br_boolean*, br_object*);
br_error (*_rendererNew)(br_renderer_facility*, br_renderer**, br_token_value*);
} br_renderer_facility_dispatch;
typedef struct br_output_facility_dispatch br_output_facility_dispatch;
typedef struct br_output_facility {
br_output_facility_dispatch* dispatch;
} br_output_facility;
typedef struct br_output_facility_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
void* (*_listQuery)(br_object_container*);
void* (*_tokensMatchBegin)(br_object_container*, br_token, br_token_value*);
br_boolean (*_tokensMatch)(br_object_container*, br_object*, void*);
void (*_tokensMatchEnd)(br_object_container*, void*);
br_error (*_addFront)(br_object_container*, br_object*);
br_error (*_removeFront)(br_object_container*, br_object**);
br_error (*_remove)(br_object_container*, br_object*);
br_error (*_find)(br_object_container*, br_object**, br_token, char*, br_token_value*);
br_error (*_findMany)(br_object_container*, br_object**, br_int_32, br_int_32*, br_token, char*, br_token_value*);
br_error (*_count)(br_object_container*, br_int_32*, br_token, char*, br_token_value*);
br_error (*_validSource)(br_output_facility*, br_boolean*, br_object*);
br_error (*_pixelmapNew)(br_output_facility*, br_device_pixelmap**, br_token_value*);
br_error (*_clutNew)(br_output_facility*, br_device_clut**, br_token_value*);
br_error (*_queryCapability)(br_output_facility*, br_token_value*, br_token_value*, br_size_t);
} br_output_facility_dispatch;
typedef struct br_primitive_state_dispatch br_primitive_state_dispatch;
typedef struct br_primitive_state {
br_primitive_state_dispatch* dispatch;
} br_primitive_state;
typedef struct brp_block brp_block;
typedef struct br_primitive_state_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
br_error (*_partSet)(br_primitive_state*, br_token, br_int_32, br_token, uintptr_t);
br_error (*_partSetMany)(br_primitive_state*, br_token, br_int_32, br_token_value*, br_int_32*);
br_error (*_partQuery)(br_primitive_state*, br_token, br_int_32, br_uint_32*, br_token);
br_error (*_partQueryBuffer)(br_primitive_state*, br_token, br_int_32, br_uint_32*, br_uint_32*, br_size_t, br_token);
br_error (*_partQueryMany)(br_primitive_state*, br_token, br_int_32, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_partQueryManySize)(br_primitive_state*, br_token, br_int_32, br_size_t*, br_token_value*);
br_error (*_partQueryAll)(br_primitive_state*, br_token, br_int_32, br_token_value*, br_size_t);
br_error (*_partQueryAllSize)(br_primitive_state*, br_token, br_int_32, br_size_t*);
br_error (*_partIndexQuery)(br_primitive_state*, br_token, br_int_32*);
br_error (*_stateDefault)(br_primitive_state*, br_uint_32);
br_error (*_stateCopy)(br_primitive_state*, br_primitive_state*, br_uint_32);
br_error (*_renderBegin)(br_primitive_state*, brp_block**, br_boolean*, br_boolean*, br_boolean, br_int_32);
br_error (*_renderEnd)(br_primitive_state*, brp_block*);
br_error (*_rangesQueryF)(br_primitive_state*, br_float*, br_float*, br_int_32);
br_error (*_rangesQueryX)(br_primitive_state*, br_fixed_ls*, br_fixed_ls*, br_int_32);
br_error (*_partQueryCapability)(br_primitive_state*, br_token, br_int_32, br_token_value*, br_size_t);
br_error (*_stateQueryPerformance)(br_primitive_state*, br_fixed_lu*);
} br_primitive_state_dispatch;
typedef struct br_primitive_library_dispatch {
void (*__reserved0)(br_object*);
void (*__reserved1)(br_object*);
void (*__reserved2)(br_object*);
void (*__reserved3)(br_object*);
void (*_free)(br_object*);
char* (*_identifier)(br_object*);
br_token (*_type)(br_object*);
br_boolean (*_isType)(br_object*, br_token);
br_device* (*_device)(br_object*);
br_int_32 (*_space)(br_object*);
br_tv_template* (*_templateQuery)(br_object*);
br_error (*_query)(br_object*, br_uint_32*, br_token);
br_error (*_queryBuffer)(br_object*, br_uint_32*, void*, br_size_t, br_token);
br_error (*_queryMany)(br_object*, br_token_value*, void*, br_size_t, br_int_32*);
br_error (*_queryManySize)(br_object*, br_size_t*, br_token_value*);
br_error (*_queryAll)(br_object*, br_token_value*, br_size_t);
br_error (*_queryAllSize)(br_object*, br_size_t*);
void* (*_listQuery)(br_object_container*);
void* (*_tokensMatchBegin)(br_object_container*, br_token, br_token_value*);
br_boolean (*_tokensMatch)(br_object_container*, br_object*, void*);
void (*_tokensMatchEnd)(br_object_container*, void*);
br_error (*_addFront)(br_object_container*, br_object*);
br_error (*_removeFront)(br_object_container*, br_object**);
br_error (*_remove)(br_object_container*, br_object*);
br_error (*_find)(br_object_container*, br_object**, br_token, char*, br_token_value*);
br_error (*_findMany)(br_object_container*, br_object**, br_int_32, br_int_32*, br_token, char*, br_token_value*);
br_error (*_count)(br_object_container*, br_int_32*, br_token, char*, br_token_value*);
br_error (*_stateNew)(br_primitive_library*, br_primitive_state**);
br_error (*_bufferStoredNew)(br_primitive_library*, br_buffer_stored**, br_token, br_device_pixelmap*, br_token_value*);
br_error (*_bufferStoredAvail)(br_primitive_library*, br_int_32*, br_token, br_token_value*);
br_error (*_flush)(br_primitive_library*, br_boolean);
br_error (*_synchronise)(br_primitive_library*, br_token, br_boolean);
br_error (*_mask)(br_primitive_library*, br_uint_32*, br_token*, int);
} br_primitive_library_dispatch;
typedef struct br_file {
void* raw_file;
br_boolean writing;
int mode;
char name[4];
} br_file;
typedef enum br_lexer_token_id {
T_EOF = 0,
T_ERROR = 1,
T_IDENT = 2,
T_STRING = 3,
T_INTEGER = 4,
T_REAL = 5,
T_EXCLAM = 33,
T_DQUOTE = 34,
T_HASH = 35,
T_DOLLAR = 36,
T_PERCENT = 37,
T_AMPERSAND = 38,
T_RQUOTE = 39,
T_LPAREN = 40,
T_RPAREN = 41,
T_ASTERISK = 42,
T_PLUS = 43,
T_COMMA = 44,
T_DASH = 45,
T_PERIOD = 46,
T_SLASH = 47,
T_COLON = 58,
T_SEMICOLON = 59,
T_LANGLE = 60,
T_EQUAL = 61,
T_RANGLE = 62,
T_QUERY = 63,
T_COMAT = 64,
T_LSQUARE = 91,
T_BSLASH = 92,
T_RSQUARE = 93,
T_CARET = 94,
T_UNDERBAR = 95,
T_LQUOTE = 96,
T_LBRACE = 123,
T_VBAR = 124,
T_RBRACE = 125,
T_TILDE = 126,
T_KEYWORD = 128
} br_lexer_token_id;
typedef struct br_lexer_source br_lexer_source;
typedef void br_lexer_getchar_cbfn(br_lexer_source*);
typedef struct br_lexer br_lexer;
typedef void br_lexer_error_cbfn(br_lexer*, char*);
typedef struct br_lexer_source {
br_lexer_source* prev;
char* name;
br_int_32 line;
br_int_32 next;
br_lexer_getchar_cbfn* getchar;
void* ptr;
} br_lexer_source;
typedef struct br_lexer_token {
br_lexer_token_id id;
union {
br_int_32 integer;
float real;
char* string;
} v;
} br_lexer_token;
typedef struct br_lexer_keyword {
char* name;
br_int_32 id;
} br_lexer_keyword;
typedef struct br_lexer {
br_lexer_source* source;
br_lexer_token current;
br_lexer_keyword* keywords;
br_int_32 nkeywords;
char eol_comment;
void (*advance)(br_lexer*);
br_putline_cbfn* putline;
void* putline_arg;
char* string_buffer;
br_int_32 string_buffer_size;
br_lexer_error_cbfn* error;
} br_lexer;
typedef br_error br_tv_custom_query_cbfn(br_uint_32*, void**, br_size_t*, void*, br_tv_template_entry*);
typedef br_error br_tv_custom_set_cbfn(void*, br_uint_32*, br_tv_template_entry*);
typedef br_size_t br_tv_custom_extra_size_cbfn(void*, br_tv_template_entry*);
typedef struct br_tv_custom {
br_tv_custom_query_cbfn* query;
br_tv_custom_set_cbfn* set;
br_tv_custom_extra_size_cbfn* extra_size;
} br_tv_custom;
typedef struct br_token_entry { // size: 24
br_node node; // @0
char* identifier; // @8
br_int_32 type; // @12
br_token token; // @16
br_int_32 base_length; // @20
} br_token_entry;
typedef struct br_exception_handler br_exception_handler;
typedef struct br_exception_handler {
br_exception_handler* prev;
jmp_buf context;
} br_exception_handler;
typedef struct br_pixelmap_state {
void* res;
br_tv_template* device_pixelmap_template;
br_tv_template* pixelmap_match_template;
} br_pixelmap_state;
typedef struct pm_type_info {
br_uint_16 bits;
br_uint_16 file_size;
br_uint_16 align;
br_uint_16 channels;
} pm_type_info;
typedef struct match_tokens {
br_token use;
br_uint_8 pixel_type;
br_int_32 pixel_bits;
br_int_32 width;
br_int_32 height;
br_object* renderer;
} match_tokens;
typedef struct host_info {
br_uint_32 size;
char identifier[40];
br_uint_32 capabilities;
br_token processor_family;
br_token processor_type;
} host_info;
typedef struct host_interrupt_hook {
br_uint_8 vector;
br_boolean active;
br_uint_32 old_offset;
br_uint_16 old_sel;
} host_interrupt_hook;
typedef struct host_exception_hook {
br_uint_8 exception;
br_boolean active;
br_uint_32 old_offset;
br_uint_16 old_sel;
br_uint_8 scratch[256];
} host_exception_hook;
typedef struct host_regs {
struct {
br_uint_32 edi;
br_uint_32 esi;
br_uint_32 ebp;
br_uint_32 _res;
br_uint_32 ebx;
br_uint_32 edx;
br_uint_32 ecx;
br_uint_32 eax;
br_uint_16 flags;
br_uint_16 es;
br_uint_16 ds;
br_uint_16 fs;
br_uint_16 gs;
br_uint_16 ip;
br_uint_16 cs;
br_uint_16 sp;
br_uint_16 ss;
} a;
struct {
br_uint_16 di;
br_uint_16 _pad0;
br_uint_16 si;
br_uint_16 _pad1;
br_uint_16 bp;
br_uint_16 _pad2;
br_uint_16 _res;
br_uint_16 _pad3;
br_uint_16 bx;
br_uint_16 _pad4;
br_uint_16 dx;
br_uint_16 _pad5;
br_uint_16 cx;
br_uint_16 _pad6;
br_uint_16 ax;
br_uint_16 _pad7;
br_uint_16 flags;
br_uint_16 es;
br_uint_16 ds;
br_uint_16 fs;
br_uint_16 gs;
br_uint_16 ip;
br_uint_16 cs;
br_uint_16 sp;
br_uint_16 ss;
} b;
struct {
br_uint_32 _pad0[4];
br_uint_8 bl;
br_uint_8 bh;
br_uint_8 _pad1;
br_uint_8 _pad2;
br_uint_8 dl;
br_uint_8 dh;
br_uint_8 _pad3;
br_uint_8 _pad4;
br_uint_8 cl;
br_uint_8 ch;
br_uint_8 _pad5;
br_uint_8 _pad6;
br_uint_8 al;
br_uint_8 ah;
br_uint_8 _pad7;
br_uint_8 _pad8;
} c;
} host_regs;
typedef struct ldt {
unsigned long limit_0 : 10;
unsigned long base_0 : 10;
unsigned long base_1 : 8;
unsigned long type : 4;
unsigned long application : 1;
unsigned long dpl : 2;
unsigned long present : 1;
unsigned long limit_1 : 4;
unsigned long system : 1;
unsigned long reserved : 1;
unsigned long use32 : 1;
unsigned long granularity : 1;
unsigned long base_2 : 8;
} ldt;
typedef struct msdos_header {
br_uint_16 magic;
br_uint_16 last_page_bytes;
br_uint_16 pages;
br_uint_16 n_relocations;
br_uint_16 header_size;
br_uint_16 minalloc;
br_uint_16 maxalloc;
br_uint_16 start_ss;
br_uint_16 start_sp;
br_uint_16 checksum;
br_uint_16 start_ip;
br_uint_16 start_cs;
br_uint_16 reloc_offset;
br_uint_16 overlay_number;
br_uint_16 _reserved0[4];
br_uint_16 oem_id;
br_uint_16 oem_info;
br_uint_16 _reserved1[10];
br_uint_32 new_header_offset;
} msdos_header;
typedef struct coff_header {
br_uint_16 machine;
br_uint_16 n_sections;
br_uint_32 time_date;
br_uint_32 symbols_offset;
br_uint_32 n_symbols;
br_uint_16 opt_header_size;
br_uint_16 flags;
} coff_header;
typedef struct nt_optional_header {
br_uint_16 magic;
br_uint_8 l_major;
br_uint_8 l_minor;
br_uint_32 code_size;
br_uint_32 data_size;
br_uint_32 bss_size;
br_uint_32 entry_point;
br_uint_32 code_base;
br_uint_32 data_base;
br_uint_32 image_base;
br_uint_32 section_alignment;
br_uint_32 file_alignment;
br_uint_16 os_major;
br_uint_16 os_minor;
br_uint_16 user_major;
br_uint_16 user_minor;
br_uint_16 subsys_major;
br_uint_16 subsys_minor;
br_uint_32 _reserved;
br_uint_32 image_size;
br_uint_32 header_size;
br_uint_32 file_checksum;
br_uint_16 subsystem;
br_uint_16 dll_flags;
br_uint_32 stack_reserve_size;
br_uint_32 stack_commit_size;
br_uint_32 heap_reserve_size;
br_uint_32 heap_commit_size;
br_uint_32 loader_flags;
br_uint_32 n_data_directories;
struct {
br_uint_32 rva;
br_uint_32 size;
} directories[16];
} nt_optional_header;
typedef struct section_header {
br_uint_8 section_name[8];
br_uint_32 virtual_size;
br_uint_32 rva;
br_uint_32 data_size;
br_uint_32 data_offset;
br_uint_32 relocs_offset;
br_uint_32 linenums_offset;
br_uint_16 n_relocs;
br_uint_16 n_linenums;
br_uint_32 flags;
} section_header;
#pragma pack(push, 1)
typedef struct resource_header { // size: 24
br_simple_node node; // @0
br_simple_list children; // @8
#if BR_ENDIAN_BIG
br_uint_8 size_h;
br_uint_8 size_m;
br_uint_8 size_l;
#else
br_uint_8 size_l; // @12
br_uint_8 size_m; // @13
br_uint_8 size_h; // @14
#endif
br_uint_8 class; // @15
void* magic_ptr; // @16
br_uint_32 magic_num; // @20
} resource_header;
#pragma pack(pop)
typedef struct host_real_memory {
br_uint_32 pm_off;
br_uint_16 pm_seg;
br_uint_16 _reserved;
br_uint_16 rm_off;
br_uint_16 rm_seg;
} host_real_memory;
typedef struct file_info {
br_uint_32 type;
br_uint_32 version;
} file_info;
typedef struct object_list {
br_simple_list l;
} object_list;
typedef struct object_list_entry {
br_simple_node n;
br_object* h;
} object_list_entry;
typedef struct token_match {
br_token_value* original;
br_token_value* query;
br_int_32 n;
void* extra;
br_size_t extra_size;
} token_match;
typedef struct token_type {
char* identifier;
br_token type;
int length;
} token_type;
typedef struct export_directory {
br_uint_32 flags;
br_uint_32 timestamp;
br_uint_16 major_version;
br_uint_16 minor_version;
br_uint_32 name;
br_uint_32 ordinal_base;
br_uint_32 n_entries;
br_uint_32 n_names;
br_uint_32 export_table;
br_uint_32 name_table;
br_uint_32 ordinal_table;
} export_directory;
typedef struct import_directory {
br_uint_32 lookup_table;
br_uint_32 timestamp;
br_uint_32 forwarder;
br_uint_32 name;
br_uint_32 address_table;
} import_directory;
typedef struct basereloc_header {
br_uint_32 rva;
br_uint_32 size;
} basereloc_header;
typedef struct order_info {
br_uint_8 a0;
br_uint_8 a1;
br_uint_8 a2;
br_uint_8 _pad[1];
} order_info;
typedef struct transform_type {
br_uint_32 id;
br_file_struct* fs;
} transform_type;
typedef enum dosio_event_type {
DOSIO_EVENT_KEY_DOWN = 0,
DOSIO_EVENT_KEY_UP = 1,
DOSIO_EVENT_POINTER1_DOWN = 2,
DOSIO_EVENT_POINTER1_UP = 3,
DOSIO_EVENT_POINTER2_DOWN = 4,
DOSIO_EVENT_POINTER2_UP = 5,
DOSIO_EVENT_POINTER3_DOWN = 6,
DOSIO_EVENT_POINTER3_UP = 7,
DOSIO_EVENT_POINTER_MOVE = 8,
DOSIO_EVENT_MAX = 9
} dosio_event_type;
typedef enum dosio_event_qual {
DOSIO_QUAL_SHIFT = 1,
DOSIO_QUAL_CONTROL = 2,
DOSIO_QUAL_ALT = 4
} dosio_event_qual;
typedef struct dosio_event {
br_uint_16 type;
br_uint_16 qualifiers;
br_uint_32 value_1;
br_uint_32 value_2;
} dosio_event;
typedef struct dosio_event_queue {
br_uint_16 total;
br_uint_16 count;
br_uint_16 head;
br_uint_16 tail;
dosio_event slots[1];
} dosio_event_queue;
typedef struct pm_temp_edge {
struct pm_temp_edge* next;
br_uint_16 first;
br_uint_16 last;
char other;
} pm_temp_edge;
typedef struct prep_vertex {
br_vector3 n;
br_uint_16 v;
br_uint_16 f;
} prep_vertex;
typedef struct fmt_vertex {
br_vector3 p;
br_vector2 map;
br_vector3 n;
} DR_VERTEX, fmt_vertex;
typedef struct v11face {
br_uint_16 vertices[3];
br_uint_16 edges[3];
br_vector4 eqn;
} DR_FACE, v11face;
typedef struct v11group {
void* stored;
v11face* faces;
br_colour* face_colours;
br_uint_16* face_user;
fmt_vertex* vertices;
br_colour* vertex_colours;
br_uint_16* vertex_user;
br_uint_16 nfaces;
br_uint_16 nvertices;
br_uint_16 nedges;
br_material* face_colours_material; // Added to avoid 64 bit issues trying to pack br_material* into br_colour. eek ;)
} v11group;
typedef struct v11model {
br_size_t size;
br_uint_32 flags;
br_uint_16 ngroups;
br_vector3 pivot;
v11group* groups;
} v11model;
// From BRender SDK v1.2
/*
* Type of actor position
*/
enum {
BR_TRANSFORM_MATRIX34,
BR_TRANSFORM_MATRIX34_LP,
BR_TRANSFORM_QUAT,
BR_TRANSFORM_EULER,
BR_TRANSFORM_LOOK_UP,
BR_TRANSFORM_TRANSLATION,
BR_TRANSFORM_IDENTITY,
BR_TRANSFORM_MAX
};
/*
* Basic types of actor
*/
enum {
BR_ACTOR_NONE,
BR_ACTOR_MODEL,
BR_ACTOR_LIGHT,
BR_ACTOR_CAMERA,
_BR_ACTOR_RESERVED,
BR_ACTOR_BOUNDS,
BR_ACTOR_BOUNDS_CORRECT,
BR_ACTOR_CLIP_PLANE,
BR_ACTOR_HORIZONTAL_PLANE,
};
/*
* Render styles - an actor inherits it's style from the most _distant_
* ancestor included in this traversal that does not have default set
* (unlike model & material which are inherited from the nearest ancestor)
*/
enum {
BR_RSTYLE_DEFAULT,
BR_RSTYLE_NONE,
BR_RSTYLE_POINTS,
BR_RSTYLE_EDGES,
BR_RSTYLE_FACES,
BR_RSTYLE_BOUNDING_POINTS,
BR_RSTYLE_BOUNDING_EDGES,
BR_RSTYLE_BOUNDING_FACES,
BR_RSTYLE_MAX
};
enum {
BR_LIGHT_POINT = 0x0000,
BR_LIGHT_DIRECT = 0x0001,
BR_LIGHT_SPOT = 0x0002,
BR_LIGHT_TYPE = 0x0003,
/*
* Flag idicating that caluculations are done in view space
*/
BR_LIGHT_VIEW = 0x0004
};
enum {
BR_CAMERA_PARALLEL,
BR_CAMERA_PERSPECTIVE_FOV,
BR_CAMERA_PERSPECTIVE_WHD
};
/*
* Various types of pixel
*/
enum {
/*
* Each pixel is an index into a colour map
*/
BR_PMT_INDEX_1,
BR_PMT_INDEX_2,
BR_PMT_INDEX_4,
BR_PMT_INDEX_8,
/*
* True colour RGB
*/
BR_PMT_RGB_555, /* 16 bits per pixel */
BR_PMT_RGB_565, /* 16 bits per pixel */
BR_PMT_RGB_888, /* 24 bits per pixel */
BR_PMT_RGBX_888, /* 32 bits per pixel */
BR_PMT_RGBA_8888, /* 32 bits per pixel */
/*
* YUV
*/
BR_PMT_YUYV_8888, /* YU YV YU YV ... */
BR_PMT_YUV_888,
/*
* Depth
*/
BR_PMT_DEPTH_16,
BR_PMT_DEPTH_32,
/*
* Opacity
*/
BR_PMT_ALPHA_8,
/*
* Opacity + Index
*/
BR_PMT_INDEXA_88
};
/*
* Bits for br_material->flags
*/
enum {
BR_MATF_LIGHT = 0x00000001,
BR_MATF_PRELIT = 0x00000002,
BR_MATF_SMOOTH = 0x00000004,
BR_MATF_ENVIRONMENT_I = 0x00000008,
BR_MATF_ENVIRONMENT_L = 0x00000010,
BR_MATF_PERSPECTIVE = 0x00000020,
BR_MATF_DECAL = 0x00000040,
BR_MATF_I_FROM_U = 0x00000080,
BR_MATF_I_FROM_V = 0x00000100,
BR_MATF_U_FROM_I = 0x00000200,
BR_MATF_V_FROM_I = 0x00000400,
BR_MATF_ALWAYS_VISIBLE = 0x00000800,
BR_MATF_TWO_SIDED = 0x00001000,
BR_MATF_FORCE_Z_0 = 0x00002000,
BR_MATF_DITHER = 0x00004000,
BR_MATF_CUSTOM = 0x00008000
};
/*
* Flags to BrModelUpdate()
*/
enum {
BR_MODU_VERTEX_POSITIONS = 0x0001,
BR_MODU_VERTEX_COLOURS = 0x0002,
BR_MODU_VERTEX_MAPPING = 0x0004,
BR_MODU_VERTEX_NORMALS = 0x0008,
BR_MODU_PRIMITIVE_MATERIALS = 0x0010,
BR_MODU_PRIMITIVE_COLOURS = 0x0020,
BR_MODU_VERTICES = 0x0040,
BR_MODU_FACES = 0x0080,
BR_MODU_PIVOT = 0x0100,
BR_MODU_PREPARED = 0x0200,
BR_MODU_PRIMITIVE_EQUATIONS = 0x0400,
BR_MODU_ALL = 0x7FFF,
_BR_MODU_RESERVED = 0x8000
};
/*
* Flags to BrMaterialUpdate()
*/
enum {
BR_MATU_MAP_TRANSFORM = 0x0001,
BR_MATU_RENDERING = 0x0002,
BR_MATU_LIGHTING = 0x0004,
BR_MATU_COLOURMAP = 0x0008,
BR_MATU_ALL = 0x7fff
};
/*
* Flags to BrMapUpdate()
*/
enum {
BR_MAPU_ALL = 0x7fff
};
/*
* Flags to BrTableUpdate()
*/
enum {
BR_TABU_ALL = 0x7fff
};
/*
* Bits for br_model->flags
*/
enum {
BR_MODF_DONT_WELD = 0x0001, /* Vertices with same x,y,z cannot be merged */
BR_MODF_KEEP_ORIGINAL = 0x0002, /* Don't release model->faces/vertices during ModelUpdate() */
BR_MODF_GENERATE_TAGS = 0x0004, /* Allocate and fill in the face and vertex tag structures */
BR_MODF_QUICK_UPDATE = 0x0010, /* ModelUpdate is fast - but may produce slower models */
BR_MODF_CUSTOM = 0x0020, /* Invoke custom callback for this model */
BR_MODF_PREPREPARED = 0x0040, /* Model structure is pre-prepared - update performs no work */
BR_MODF_UPDATEABLE = 0x0080, /* Added by Jeff from Errols code */
BR_MODF_CREASE = 0x0100, /* Create creases in smoothing along edges if face<->face angle is g.t model->crease */
BR_MODF_CUSTOM_NORMALS = 0x0200, /* Uses vertex normals from br_vertex structure */
BR_MODF_CUSTOM_BOUNDS = 0x0400, /* Bounding box is already set up */
BR_MODF_FACES_ONLY = 0x0800, /* Model will only be used to render faces (not edges or points) */
BR_MODF_USED_PREPARED_USER = 0x1000, /* User fields in prepared data used */
BR_MODF_CUSTOM_EQUATIONS = 0x2000, /* Uses face equations from br_face structure */
_BR_MODF_RESERVED = 0x8000,
// Added by dethrace to force the vertex data to be reuploaded to GPU
BR_MODF_DETHRACE_FORCE_BUFFER_UPDATE = 0x4000
};
enum {
BR_STATE_SURFACE = 0x00000001,
BR_STATE_MATRIX = 0x00000002,
BR_STATE_ENABLE = 0x00000004,
BR_STATE_LIGHT = 0x00000008,
BR_STATE_CLIP = 0x00000010,
BR_STATE_BOUNDS = 0x00000020,
BR_STATE_CULL = 0x00000040,
BR_STATE_STATS = 0x00000080,
BR_STATE_CACHE = 0x00000100,
BR_STATE_OUTPUT = 0x40000000,
BR_STATE_PRIMITIVE = 0x80000000,
BR_STATE_ALL = 0xFFFFFFFF
};
#endif /* BR_TYPES_H */