]> 4ch.mooo.com Git - 16.git/blob - src/maptest0.c
reading huge map files....
[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         fprintf(stderr, fmt, _memavl());
15         fprintf(stderr, fmt0, _memmax());
16         while(!kbhit());
17         fprintf(stderr, "loading~\n");
18         loadmap("data/tes0.map", &map);
19         fprintf(stderr, "okies~\n");
20         #ifdef DUMP
21         fprintf(stdout, "map.width=     %d\n", map.width);
22         fprintf(stdout, "map.height=    %d\n", map.height);
23         #ifdef DUMP_MAP
24         for(i=0; i<(map.width*map.height); i++)
25         {
26                 fprintf(stdout, "%04d[%02d]", i, map.data[i]);
27                 if(i && !(i%map.width)) fprintf(stdout, "\n");
28         }
29         fprintf(stdout, "\n");
30         #endif
31         fprintf(stdout, "&map==%Fp\n", &map);
32         fprintf(stdout, "&map.tiles==%Fp\n", map.tiles);
33         fprintf(stdout, "&map.width==%Fp\n", map.width);
34         fprintf(stdout, "&map.height==%Fp\n", map.height);\r
35         fprintf(stdout, "&map.data==%Fp\n", map.data);
36         #endif
37         fprintf(stdout, "okies~\n");
38 }\r