X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fmaptest.c;h=86cda8db237ccb19b4f94e639b3f23d5d12a26f1;hb=312a36372b6826ad9c6296e17a2586d11355c6b3;hp=48c022d1c9b0c83d6fe9987925206709a73fa219;hpb=8b92f32b6e6a8ab7be52ced02208cc789364a014;p=16.git diff --git a/src/maptest.c b/src/maptest.c index 48c022d1..86cda8db 100644 --- a/src/maptest.c +++ b/src/maptest.c @@ -1,9 +1,29 @@ -#include "src/lib/mapread.c" - +#include "src/lib/mapread.h" + +#define DUMP +//#define DUMP_MAP + void main(int argc, char *argv[]) { map_t map; + short i; loadmap("data/test.map", &map); - fprintf(stderr, "%d\n", map.data[0]); + #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++) + { + fprintf(stdout, "%04d[%02d]", i, map.data[i]); + if(i && !(i%map.width)) fprintf(stdout, "\n"); + } + fprintf(stdout, "\n"); + #endif + fprintf(stdout, "&map==%Fp\n", &map); + fprintf(stdout, "&map.tiles==%Fp\n", map.tiles); + fprintf(stdout, "&map.width==%Fp\n", map.width); + fprintf(stdout, "&map.height==%Fp\n", map.height); + fprintf(stdout, "&map.data==%Fp\n", map.data); + #endif }