curr_odat(void);\r
\r
extern\r
-struct variant*\r
-curr_variant(void);\r
+struct map*\r
+curr_map(void);\r
\r
extern\r
-struct variant*\r
-alloc_variant(void);\r
+struct map*\r
+alloc_map(void);\r
\r
extern\r
struct vdat*\r
cdat_stackp--;\r
}\r
\r
+\r
+/* Every odat has a single map variant. We track the odats that have related map variants\r
+ by adding the name of the map to the end of the odat name. E.g. for an odat with name\r
+ A and map variants a,b,c we get A_a, A_b, A_c. We create new odats for each map variant*/\r
+void\r
+insert_map\r
+( uint8_t* name,\r
+ int height,\r
+ int width,\r
+ uint8_t* filepath\r
+)\r
+{\r
+ struct odat* curr_odatp;\r
+ int curr_odat_vdatid;\r
+\r
+ curr_odatp = curr_odat();\r
+\r
+ curr_odat_vdatid = curr_odatp->vdat_id;\r
+ \r
+\r
+ \r
+ if(curr_odatp->map.name[0] != 0) //odat already has a map so make a new odat\r
+ { curr_odatp = alloc_odat();\r
+ curr_odatp->vdat_id = curr_odat_vdatid;\r
+ }\r
+ /* Add a delimiter '_' in between odat name and map variant name */\r
+ u8_strcat(curr_odatp->map.name, (uint8_t*) '_'); \r
+ u8_strcat(curr_odatp->map.name, name);\r
+ \r
+ u8_strcpy(curr_odatp->map.filepath, filepath);\r
+ curr_odatp->map.height = height;\r
+ curr_odatp->map.width = width;\r
+ \r
+}\r
+ \r
+\r
+\r
+\r
+\r
/* Called in the reduction of a set. While both odats (eles and sets)\r
have identical label terminals, we are unable to give a single grammatical rule\r
for both due to how we allocate odats in the odat buf. Due to the\r
u8_cpy(curr_set_odatp->name, name, 32);\r
u8_cpy(curr_setp->name, name, 32);\r
curr_set_odatp->parent_odatp = NULL;\r
+ curr_set_odatp->map.name[0] = 0;\r
\r
if(ref_id != -1)\r
{ curr_set_odatp->ref_id = ref_id;\r
struct ref* curr_refp;\r
struct vdat* curr_vdatp;\r
\r
- curr_odatp = curr_set_odatp; //allocated at insert_set_label, preserved in global space\r
+ curr_odatp = curr_set_odatp; //allocated at insert_set_label\r
curr_cdatp = curr_cdat();\r
curr_setp = curr_set();\r
prev_refp = curr_ref();\r
curr_odatp = alloc_odat();\r
\r
u8_cpy(curr_odatp->name, name, 32);\r
+ curr_odatp->map.name[0] = 0;\r
\r
if(ref_id != -1)\r
curr_odatp->ref_id = ref_id;\r
}\r
\r
\r
-void\r
-insert_variant\r
-(uint8_t* filename, int height, int width, uint8_t* filepath)\r
-{ struct variant* curr_variantp;\r
- int x, y, pixel, num_frames, n;\r
- int* pixel_buf;\r
- \r
- /* Allocate the mdat */\r
- curr_variantp = alloc_variant();\r
-\r
- u8_strcpy(curr_variantp->filename, filename);\r
- u8_strcpy(curr_variantp->filepath, filepath);\r
- curr_variantp->height = height;\r
- curr_variantp->width = width;\r
-\r
- //curr_mdatp->quad_list[num_quads].x/.y/.z/ref_id */\r
-\r
-\r
- curr_set_odatp->variant_list[curr_set_odatp->vli++] = curr_variantp;\r
-}\r
\r
\r
/* void */\r