X-Git-Url: https://www.kengrimes.com/gitweb/?p=henge%2Fwebcc.git;a=blobdiff_plain;f=src%2Fapc%2Fir.h;fp=src%2Fapc%2Fir.h;h=d4ab90bac9dc0a3f804fa6e75e3bdf1d1826b25d;hp=0000000000000000000000000000000000000000;hb=6d5141829211936ecaed3d9d13a239a75ecae712;hpb=6e128138a1c6963b03f1dacb1657485a2a6aed04 diff --git a/src/apc/ir.h b/src/apc/ir.h new file mode 100644 index 0000000..d4ab90b --- /dev/null +++ b/src/apc/ir.h @@ -0,0 +1,72 @@ +/* Structures allocated for and updated during parse time that + are the IR before writing to the output file */ + +#define BUFF_SIZE 256 +#define MAX_SUBCLASSES 16 +#define MAX_SETS 256 +#define MAX_ELES 256 +#define MAX_REFS 256 +#define MAX_MODELS 256 + +//These IR buffers will be condensed into their respective output files. +//parse_init() all to zero. +struct cdat CB[BUFF_SIZE]; +struct vdat VB[BUFF_SIZE]; +struct odat OB[BUFF_SIZE]; + +//indexes for buffers +int cbi = 0; +int vbi = 0; +int obi = 0; + +struct cdat { + char label[32]; + int num_subclasses; + int num_sets; + int subclass_index; + int set_index; + struct cdat subclass_list[MAX_SUBCLASSES]; + struct set set_list[MAX_SETS]; +}; + +//Element or a set +struct odat { + char label[32]; + int vdat_id; + int class_id; + int num_ref; + int ref_index; + struct ref ref_list[MAX_REFS]; +}; + +struct ref { + int x, y, z, objref; +}; + +struct set { + int odat_id; + int parent_id;//offset into CB + int num_ele; + int ele_index; //same as num_ele? + struct ele ele_list[MAX_ELES]; +}; + +struct ele { + int odat_id; + int parent_id;//offset into class set_stack +}; + +//TODO: Do vdats need labels? +struct vdat { + int num_models; + int msi; //model_stack_index + struct model model_list[MAX_MODELS]; +}; + +//8 ids for each direction +//fdat_id ordered by alphabetical direction +struct model { + char label[32]; + int fdat_id[8]; +}; +