X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fmaptest.c;h=deef4c7c5ac6bda9d6d9a778b62034d299dc8cc9;hb=0d7ae2e7d572e68cae33bc9fc76e0fbbae176379;hp=972d7db6c7b3424182d5f3448f55e2b05db70a46;hpb=535f618e80aa6546e61907026b2451e123655a5b;p=16.git diff --git a/src/maptest.c b/src/maptest.c index 972d7db6..deef4c7c 100755 --- a/src/maptest.c +++ b/src/maptest.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 + * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -19,35 +19,79 @@ * Fifth Floor, Boston, MA 02110-1301 USA. * */ - -#include "src/lib/mapread.h" +#include "src/lib/16_map.h" #define DUMP -//#define DUMP_MAP +#define DUMP_MAP void main(int argc, char *argv[]) { + static global_game_variables_t gvar; map_t map; +#ifdef DUMP +#ifdef DUMP_MAP short i; - loadmap("data/test.map", &map); +#ifdef __NEWMAPTILEDATAVARS__ + word k; +#endif +#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(&(gvar.ca.camap.mapsegs))); + //fprintf(stderr, "program always crashes for some reason....\n"); + getch(); + + //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 - for(i=0; i<(map.width*map.height); i++) + //if(map.width*map.height != 1200) +#ifdef __NEWMAPTILEDATAVARS__ + for(k=0;k