From 706bd2e34ac15ffbc22579fde6289280347d5224 Mon Sep 17 00:00:00 2001 From: "jordan@hack_attack" Date: Sun, 2 Oct 2016 15:21:46 -0700 Subject: [PATCH] A quad is now a file --- src/apc/ir.c | 26 +++++++++++++------------- src/apc/ir.h | 5 ++--- src/apc/irmem.c | 11 +---------- src/apc/parser.y | 16 ++++++---------- 4 files changed, 22 insertions(+), 36 deletions(-) diff --git a/src/apc/ir.c b/src/apc/ir.c index de021cc..fe613ba 100644 --- a/src/apc/ir.c +++ b/src/apc/ir.c @@ -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 diff --git a/src/apc/ir.h b/src/apc/ir.h index cc0508f..ff4a4f1 100644 --- a/src/apc/ir.h +++ b/src/apc/ir.h @@ -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); diff --git a/src/apc/irmem.c b/src/apc/irmem.c index 1e0024f..958910d 100644 --- a/src/apc/irmem.c +++ b/src/apc/irmem.c @@ -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 () diff --git a/src/apc/parser.y b/src/apc/parser.y index 9a15851..2b17d83 100644 --- a/src/apc/parser.y +++ b/src/apc/parser.y @@ -53,6 +53,7 @@ %token REF %token SSD %token FPTR +%token 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 -- 2.18.0