X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmaptest.c;h=243eab0b3f23a2bb7cbb4d2b321a2e1d58c2d8ff;hb=0de956727ac86a5ed1f561fe22759bb871582994;hp=7649898eb94910c7ad7377811bdab33ecef51f68;hpb=17ec26395419ff775f29661e50265dfbccfda3b0;p=16.git diff --git a/src/maptest.c b/src/maptest.c index 7649898e..243eab0b 100755 --- a/src/maptest.c +++ b/src/maptest.c @@ -19,7 +19,6 @@ * Fifth Floor, Boston, MA 02110-1301 USA. * */ -//TODO: ADD MEMORY MANAGER! WWWW #include "src/lib/16_map.h" #define DUMP @@ -28,36 +27,67 @@ void main(int argc, char *argv[]) { - map_t map; + static global_game_variables_t gvar; + static map_t map; +#ifdef DUMP +#ifdef DUMP_MAP short i; + word k; +#endif +#endif char *fmt = "Memory available = %u\n"; char *fmt0 = "Largest Contiguous Block of Memory available = %u\n"; + MM_Startup(&gvar); + PM_Startup(&gvar); + //printf("pmstarted ok\n"); + //PM_CheckMainMem(&gvar); + PM_UnlockMainMem(&gvar); + CA_Startup(&gvar); + fprintf(stderr, fmt, _memavl()); fprintf(stderr, fmt0, _memmax()); - fprintf(stderr, "Size of map var = %u\n", _msize(&map)); + fprintf(stderr, "Size of map var = %u\n", _msize(&(gvar.ca.camap.mapsegs))); //fprintf(stderr, "program always crashes for some reason....\n"); - getch(); + //getch(); - loadmap("data/test.map", &map); - #ifdef DUMP + //loadmap("data/test.map", &map); + //newloadmap("data/test.map", &map); + CA_loadmap("data/test.map", &map, &gvar); +#ifdef DUMP fprintf(stdout, "map.width= %d\n", map.width); fprintf(stdout, "map.height= %d\n", map.height); - #ifdef DUMP_MAP - if(map.width*map.height != 1200) exit(-3); - for(i=0; i<(map.width*map.height); i++) + getch(); +#ifdef DUMP_MAP + //if(map.width*map.height != 1200) + for(k=0;k