A quad is now a file
authorjordan@hack_attack <jordanlavatai@gmail.com>
Sun, 2 Oct 2016 22:21:46 +0000 (15:21 -0700)
committerjordan@hack_attack <jordanlavatai@gmail.com>
Sun, 2 Oct 2016 22:21:46 +0000 (15:21 -0700)
src/apc/ir.c
src/apc/ir.h
src/apc/irmem.c
src/apc/parser.y

index de021cc..fe613ba 100644 (file)
@@ -414,24 +414,24 @@ insert_ele_vdatid
 
 void
 insert_quad
-( int x,
-  int y,
-  int z,
-  uint64_t ref_id
+( void* quad_filep
 )
 {
 
-  struct quad* curr_quadp;
-  struct odat* curr_odatp;
+  /* struct quad* curr_quadp; */
+  /* struct odat* curr_odatp; */
 
-  curr_quadp = curr_quad();
-  curr_odatp = curr_odat();
+  /* curr_quadp = curr_quad(); */
+  /* curr_odatp = curr_odat(); */
+
+  /* curr_quadp->x = x; */
+  /* curr_quadp->y = y; */
+  /* curr_quadp->z = z; */
+  /* curr_quadp->ref_id = ref_id; */
+  /* curr_odatp->num_quads++; */
+  struct odat* curr_odatp;
 
-  curr_quadp->x = x;
-  curr_quadp->y = y;
-  curr_quadp->z = z;
-  curr_quadp->ref_id = ref_id;
-  curr_odatp->num_quads++;
+  curr_odatp->quad_filep = quad_filep;
 }
 
 /* Inserting the hitbox into the set
index cc0508f..ff4a4f1 100644 (file)
@@ -211,8 +211,7 @@ struct odat {
   int hitbox;
   struct root root;
   struct ref* refp; /* pointer to it's ref on ref_list */
-  int num_quads;
-  struct quad quad_list[MAX_QUADS];
+  void* quad_filep;
 };
 
 struct odat* curr_set_odatp; //when a set has elements, insert_set() can no longer
@@ -323,7 +322,7 @@ insert_root(int, int, int);
 
 /* Inserts a quad into the CURR_ODAT */
 void
-insert_quad(int, int, int, uint64_t);
+insert_quad(void*);
 
 void
 insert_model(void);
index 1e0024f..958910d 100644 (file)
@@ -29,8 +29,6 @@ struct set*
 curr_set(void);
 struct ref*
 prev_ref(void);
-struct quad
-curr_quad(void);
 struct model
 curr_model(void);
 void
@@ -48,7 +46,7 @@ inc_posts(void);
 #define CURR_MODEL (CURR_VDAT->model_list[CURR_VDAT->num_models])
 #define CURR_LINK (link_buf[num_links])
 #define CURR_POST (post_buf[num_posts])
-#define CURR_QUAD (CURR_ODAT->quad_list[CURR_ODAT->num_quads])
+#define CURR_QUAD (CURR_ODAT->quad_file)
 
 
 int num_cdats = 0;
@@ -274,13 +272,6 @@ prev_ref
 {
   return PREV_REF;
 }
-
-struct quad
-curr_quad
-()
-{
-  return CURR_QUAD;
-}
 struct model
 curr_model
 ()
index 9a15851..2b17d83 100644 (file)
@@ -53,6 +53,7 @@
 %token <ref> REF
 %token <val> SSD
 %token <voidp> FPTR
+%token <voidp> QPTR
 // Change width, height, num_ptrs to NUM because
 // when scanning, we can't determine which NUM
 // is which. 
@@ -96,22 +97,17 @@ root:
 RT NUM NUM NUM                                                {insert_root($2, $3, $4);};
 ;
 
-quad_list:
-quad_list quad
-| quad
-;
-
-quad:
-QOPEN NUM NUM NUM REF QCLOSE                                  {insert_quad($2, $3, $4, $5);};
+quad_file:
+QOPEN QPTR  QCLOSE                                  {insert_quad($2);};
 
 hitbox:
 HB NUM                                                        {insert_hitbox($2);}
 ;
 
 set_map_data:
-quad_list
-| quad_list hitbox
-| quad_list hitbox root
+quad_file
+| quad_file hitbox
+| quad_file hitbox root
 | hitbox root
 | hitbox
 | root