]> 4ch.mooo.com Git - 16.git/blob - src/maptest0.c
cleaned up the repo from debugging watcom2 ^^
[16.git] / src / maptest0.c
1 /* Project 16 Source Code~\r
2  * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123\r
3  *\r
4  * This file is part of Project 16.\r
5  *\r
6  * Project 16 is free software; you can redistribute it and/or modify\r
7  * it under the terms of the GNU General Public License as published by\r
8  * the Free Software Foundation; either version 3 of the License, or\r
9  * (at your option) any later version.\r
10  *\r
11  * Project 16 is distributed in the hope that it will be useful,\r
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14  * GNU General Public License for more details.\r
15  *\r
16  * You should have received a copy of the GNU General Public License\r
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
18  * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
19  * Fifth Floor, Boston, MA 02110-1301 USA.\r
20  *\r
21  */\r
22 \r
23 #include <conio.h>\r
24 #include "src/lib/fmapread.h"\r
25 \r
26 #define DUMP\r
27 //#define DUMP_MAP\r
28 \r
29 void\r
30 main(int argc, char *argv[])\r
31 {\r
32         map_t map;\r
33         short i;\r
34         char *fmt = "Memory available = %u\n";\r
35         char *fmt0 = "Largest Contiguous Block of Memory available = %u\n";\r
36 \r
37         fprintf(stderr, fmt, _memavl());\r
38         fprintf(stderr, fmt0, _memmax());\r
39         fprintf(stderr, "Size of map var = %u\n", _msize(&map));\r
40         fprintf(stderr, "program always crashes for some reason....");\r
41         getch();\r
42 \r
43         fprintf(stderr, "loading~\n\n");\r
44         loadmap("data/tes0.map", &map);\r
45         fprintf(stderr, "\nokies~\n");\r
46         #ifdef DUMP\r
47         fprintf(stdout, "map.width=     %d\n", map.width);\r
48         fprintf(stdout, "map.height=    %d\n", map.height);\r
49         #ifdef DUMP_MAP\r
50         for(i=0; i<(map.width*map.height); i++)\r
51         {\r
52                 fprintf(stdout, "%04d[%02d]", i, map.data[i]);\r
53                 if(i && !(i%map.width)) fprintf(stdout, "\n");\r
54         }\r
55         fprintf(stdout, "\n");\r
56         #endif\r
57         fprintf(stdout, "&main()=%Fp\n", *argv[0]);\r
58         fprintf(stdout, "&map==%Fp\n", &map);\r
59         fprintf(stdout, "&map.tiles==%Fp\n", map.tiles);\r
60         fprintf(stdout, "&map.width==%Fp\n", map.width);\r
61         fprintf(stdout, "&map.height==%Fp\n", map.height);\r
62         fprintf(stdout, "&map.data==%Fp\n", map.data);\r
63         #endif\r
64         fprintf(stdout, "okies~\n");\r
65 }\r