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=269eaf06b832376285d579e43db6d7f352ab41ba;hp=3b1d75cfdd2fe81f8b3b2c77cdf3af233c191356;hb=0f505368fa8abbc2e9ab0296b9a5e6bd4869345f;hpb=df52756177b6e4fd9465cbb1b17a35eb48bb67c9 diff --git a/src/apc/ir.h b/src/apc/ir.h index 3b1d75c..269eaf0 100755 --- a/src/apc/ir.h +++ b/src/apc/ir.h @@ -14,12 +14,15 @@ #include +#include +#include #define BUF_SIZE 256 #define MAX_SETS 256 #define MAX_ELES 256 #define MAX_QUADS 256 #define MAX_MODELS 256 +#define MAX_VARIANTS 8 #define MAX_POSTS 256 #define MAX_CLASS_DEPTH 256 #define MAX_CLASSES 256 @@ -32,8 +35,8 @@ elements are populated, due to the nature of bottom up parsing. */ struct set { - char name[32]; - uint64_t ref_id; + uint8_t name[32]; + int ref_id; int cdat_idx; }; @@ -49,7 +52,7 @@ struct set { /* TODO: Should classes point to their parent class? */ struct cdat { - char name[32]; + uint8_t name[32]; int idx; int num_classes; int num_sets; @@ -80,7 +83,7 @@ struct ref { struct ref* nextref; struct ref* lastref; struct odat* odatp; - uint64_t ref_id; //0xFFFFFF->digit + int ref_id; //0xFFFFFF->digit }; @@ -100,13 +103,13 @@ struct ref { differ from vlinks because they do not have a name */ struct svlink { - uint64_t ref_id; + int ref_id; }; /* A vlink is what it sounds like, a link to a vdat */ struct vlink { - uint64_t ref_id; - char anim_name[32]; + int ref_id; + uint8_t anim_name[32]; }; union link_t { @@ -124,6 +127,26 @@ struct link { int ele_idx; }; +struct root { + int x, y, z; +}; + +struct quad { + int x; + int y; + int z; + int ref_id; +}; + +/* variants: variants store the different map data for each archetype. */ +struct variant { + uint8_t filename[NAME_MAX/sizeof(ucs4_t)]; + uint8_t filepath[PATH_MAX/sizeof(ucs4_t)]; + int height; + int width; + // int num_quads; + //struct quad quad_list[MAX_QUADS]; +}; /* Odats: Odats consist of the object data necessary for each object. Odats are sometimes referred to as archetypes @@ -131,21 +154,18 @@ struct link { a runtime object and a compile-time object. TODO: Need more info about objects at runtime, to described the reasoning behind odat structure at compile-time*/ - -struct root { - int x, y, z; -}; - struct odat { - char name[32]; + uint8_t name[32]; struct vdat* vdatp; int vdat_id; // int cdat_idx; int hitbox; - uint64_t ref_id; + int ref_id; + struct odat* parent_odatp; // odat == set ? null : set ref_id struct root root; struct ref* refp; /* pointer to it's ref on ref_list */ - void* quad_filep; + struct variant* variant_list[MAX_VARIANTS]; + int vli; //variant list index }; struct odat* curr_set_odatp; //when a set has elements, insert_set() can no longer @@ -164,26 +184,30 @@ struct framesheet { direction (N,W,S,E,NW,NE,SW,SE)*/ /* NAMED spritesheet */ struct model { - char name[32]; + uint8_t name[32]; struct framesheet spritesheet[8]; //one for each }; /* Vdat: Vdats are the video data of each object. They can not be created as a stand alone object (because they consist solely - of animation information and not the skeleton on which the + of animation information and not the skeleton which the animation manipulates). Vdats have a list of models for every animation that the vdats odat can do for that vdat*/ struct vdat { struct odat* creator; //pointer to odat that made this vdat int num_models; - struct model model_list[MAX_MODELS]; + uint8_t filename[NAME_MAX/sizeof(ucs4_t)]; + int height; + int width; + uint8_t filepath[PATH_MAX/sizeof(ucs4_t)]; + //struct model model_list[MAX_MODELS]; }; /* Called after the cdat open operator has been recognized in grammar. Allocates the space for a cdat on the cdat_buf, pushes that pointer onto the cdat_stack */ void -push_cdat(char*); +push_cdat(uint8_t*); /* Called after a cdat end operator has been recognized in grammar. Sets top stack cdat ** to null and decrements stack pointer */ @@ -194,20 +218,20 @@ pop_cdat(void); the next odat. */ void -insert_set_label(char*, uint64_t); +insert_set_label(uint8_t*, int); /* Populate the sets representation in CURR_CDAT with a ref_id and insert a link into the link_buf that will resolve the ref_id to an actual odat after parse time. */ void -insert_set_olink(uint64_t); +insert_set_olink(int); /* Put the vlink in the link_buf to be processed after parsetime */ void -insert_set_vlink(uint64_t, char*); +insert_set_vlink(int, uint8_t*); /* Put svlink in the link_buf to be processed after parsetime */ void -insert_set_svlink(uint64_t); +insert_set_svlink(int); /* Called for every set reduction except for sets with olinks. Populates the set data structures in the CDAT and in the ODAT. Uses the name and ref_id @@ -225,19 +249,19 @@ void insert_set_vdatid(void); void -insert_ele_label(char*, uint64_t); +insert_ele_label(uint8_t*, int); /* Insert an ele olink into the CURR_ODAT */ void -insert_ele_olink(uint64_t); +insert_ele_olink(int); /* Insert a ele vlink into CURR_ODAT*/ void -insert_ele_vlink(uint64_t, char*); +insert_ele_vlink(int, uint8_t*); /* Inserts an ele short vlink into CURR_ODAT*/ void -insert_ele_svlink(uint64_t); +insert_ele_svlink(int); /* inserts ele into CURR_CLASS and CURR_ODAT */ void @@ -246,6 +270,8 @@ insert_ele(void); void insert_ele_vdatid(void); +void +insert_vdat(uint8_t*, int, int, uint8_t*); /* Inserts the hitbox into the CURR_ODAT */ void insert_hitbox(int); @@ -256,16 +282,18 @@ insert_root(int, int, int); /* Inserts a quad into the CURR_ODAT */ void -insert_quad(void*); +insert_quad(int, int, int, int); void -insert_model(void); +insert_variant(uint8_t*, int, int, uint8_t*); void -insert_framesheet(char, char*, uint64_t, int, int, int); +insert_model(void); void -insert_frame_pointer(char, void*); +insert_framesheet(uint8_t, uint8_t*, int, int, int, int); void -alloc_vdat(void); +insert_frame_pointer(uint8_t, void*); + +