X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fmaptest.c;h=589d6d11d518a0ed343f3b00e4125eba6b04961e;hb=4182c851b3812d20f2464fd1f0b49cd5b676962c;hp=e25c9818eaab635dddc187cd23c9b0183eb2ad4f;hpb=cc622af140fa834978eb28b0ee94bb30d5e0e091;p=16.git diff --git a/src/maptest.c b/src/maptest.c index e25c9818..589d6d11 100644 --- a/src/maptest.c +++ b/src/maptest.c @@ -1,8 +1,30 @@ -#include "src/lib/mapread.c" - -int main() +#include "src/lib/mapread.h" + +#define DUMP +//#define DUMP_MAP + +void +main(int argc, char *argv[]) { - map_t map; - loadmap("data/test.map", &map); - return 0; + map_t map; + short i; + loadmap("data/test.map", &map); + #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 + fprintf(stdout, "okies~\n"); }