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=8076514ed346043d69306fa529ededc0ca4f8726;hp=3b1d75cfdd2fe81f8b3b2c77cdf3af233c191356;hb=3d03d8941abeb2a78f3334098a7bd09285023da8;hpb=cc4724ed8e52fd6de475f869c5e65ba0d9c82f03 diff --git a/src/apc/ir.h b/src/apc/ir.h index 3b1d75c..8076514 100755 --- a/src/apc/ir.h +++ b/src/apc/ir.h @@ -14,12 +14,16 @@ #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_MODEL_LEN 256 +#define MAX_MAPS 8 #define MAX_POSTS 256 #define MAX_CLASS_DEPTH 256 #define MAX_CLASSES 256 @@ -32,8 +36,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 +53,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 +84,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 +104,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 +128,24 @@ struct link { int ele_idx; }; +struct root { + int x, y, z; +}; + +struct quad { + int x; + int y; + int z; + int ref_id; +}; + +/* maps: maps store the different map data for each archetype. */ +struct map { + uint8_t name[NAME_MAX];//TODO:Rename + uint8_t filepath[PATH_MAX];//TODO: Rename + int height; + int width; + }; /* Odats: Odats consist of the object data necessary for each object. Odats are sometimes referred to as archetypes @@ -131,21 +153,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 map map; + //int mli; //map list index }; struct odat* curr_set_odatp; //when a set has elements, insert_set() can no longer @@ -164,18 +183,23 @@ struct framesheet { direction (N,W,S,E,NW,NE,SW,SE)*/ /* NAMED spritesheet */ struct model { - char name[32]; + uint8_t name[MAX_MODEL_LEN]; + uint8_t filepath[PATH_MAX]; 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 map 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; + 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]; }; @@ -183,7 +207,7 @@ struct vdat { 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_map(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*); + +