]> 4ch.mooo.com Git - 16.git/blob - src/maptest0.c
e0ca320c77f7880c2cff579e4b6c6c5db9569d32
[16.git] / src / maptest0.c
1 #include <conio.h>
2 #include "src/lib/mapread.h"\r
3
4 //#define DUMP
5 //#define DUMP_MAP
6
7 void
8 main(int argc, char *argv[])\r
9 {\r
10         map_t map;
11         short i;
12         char *fmt = "Memory available = %u\n";
13         char *fmt0 = "Largest Contiguous Block of Memory available = %u\n";
14
15         fprintf(stderr, fmt, _memavl());
16         fprintf(stderr, fmt0, _memmax());
17         fprintf(stderr, "Size of map var = %u\n", _msize(&map));
18         getch();
19
20         fprintf(stderr, "loading~\n\n");
21         loadmap("data/tes0.map", &map);
22         fprintf(stderr, "\nokies~\n");
23         #ifdef DUMP
24         fprintf(stdout, "map.width=     %d\n", map.width);
25         fprintf(stdout, "map.height=    %d\n", map.height);
26         #ifdef DUMP_MAP
27         for(i=0; i<(map.width*map.height); i++)
28         {
29                 fprintf(stdout, "%04d[%02d]", i, map.data[i]);
30                 if(i && !(i%map.width)) fprintf(stdout, "\n");
31         }
32         fprintf(stdout, "\n");
33         #endif
34         fprintf(stdout, "&map==%Fp\n", &map);
35         fprintf(stdout, "&map.tiles==%Fp\n", map.tiles);
36         fprintf(stdout, "&map.width==%Fp\n", map.width);
37         fprintf(stdout, "&map.height==%Fp\n", map.height);\r
38         fprintf(stdout, "&map.data==%Fp\n", map.data);
39         #endif
40         fprintf(stdout, "okies~\n");
41 }\r