]> 4ch.mooo.com Git - 16.git/blob - src/lib/mapread.h
polished the map reading system~ i made it ... more robust.... now onwards to far...
[16.git] / src / lib / mapread.h
1 #ifndef _LIBMAPREAD_H_
2 #define _LIBMAPREAD_H_
3 //#include <stdlib.h>
4 //#include <stdio.h>
5 #include <string.h>
6 #include <errno.h>
7 #include <alloc.h>
8
9 #include "src/lib/jsmn/jsmn.h"
10 #include "src/lib/modex16.h"
11 #include "src/lib/lib_head.h"
12
13 //#define DEBUG_MAPDATA
14 #define DEBUG_MAPVAR
15 //#define DEBUG_DUMPVARS
16 #define DEBUG_JS
17
18 typedef struct {\r
19         bitmap_t *data;
20         word tileHeight;\r
21         word tileWidth;\r
22         unsigned int rows;\r
23         unsigned int cols;\r
24 } tiles_t;\r
25 \r
26 typedef struct {\r
27         byte *data;\r
28         tiles_t *tiles;\r
29         unsigned int width;\r
30         unsigned int height;\r
31 } map_t;
32
33 int jsoneq(const char /*far*/ *json, jsmntok_t /*far*/ *tok, const char *s);
34 int dump(const char /*far*/ *js, jsmntok_t /*far*/ *t, size_t count, int indent, char *js_sv, map_t *map, int q);
35 int loadmap(char *mn, map_t *map);
36
37 #endif/*_LIBMAPREAD_H_*/