]> 4ch.mooo.com Git - 16.git/blob - src/maptest0.c
6c3cb5190549232305da7b3e683383d5b97f1931
[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         fprintf(stderr, "program always crashes for some reason....");
19         getch();
20
21         fprintf(stderr, "loading~\n\n");
22         loadmap("data/tes0.map", &map);
23         fprintf(stderr, "\nokies~\n");
24         #ifdef DUMP
25         fprintf(stdout, "map.width=     %d\n", map.width);
26         fprintf(stdout, "map.height=    %d\n", map.height);
27         #ifdef DUMP_MAP
28         for(i=0; i<(map.width*map.height); i++)
29         {
30                 fprintf(stdout, "%04d[%02d]", i, map.data[i]);
31                 if(i && !(i%map.width)) fprintf(stdout, "\n");
32         }
33         fprintf(stdout, "\n");
34         #endif
35         fprintf(stdout, "&map==%Fp\n", &map);
36         fprintf(stdout, "&map.tiles==%Fp\n", map.tiles);
37         fprintf(stdout, "&map.width==%Fp\n", map.width);
38         fprintf(stdout, "&map.height==%Fp\n", map.height);\r
39         fprintf(stdout, "&map.data==%Fp\n", map.data);
40         #endif
41         fprintf(stdout, "okies~\n");
42 }\r