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