1 | #ifndef STORE_H |
---|
2 | #define STORE_H |
---|
3 | |
---|
4 | #ifdef __cplusplus |
---|
5 | extern "C" { |
---|
6 | #endif |
---|
7 | |
---|
8 | #include <stdlib.h> |
---|
9 | #include "render_config.h" |
---|
10 | int tile_read(const char *xmlconfig, int x, int y, int z, unsigned char *buf, int sz); |
---|
11 | |
---|
12 | #define META_MAGIC "META" |
---|
13 | //static const char meta_magic[4] = { 'M', 'E', 'T', 'A' }; |
---|
14 | |
---|
15 | struct entry { |
---|
16 | int offset; |
---|
17 | int size; |
---|
18 | }; |
---|
19 | |
---|
20 | struct meta_layout { |
---|
21 | char magic[4]; |
---|
22 | int count; // METATILE ^ 2 |
---|
23 | int x, y, z; // lowest x,y of this metatile, plus z |
---|
24 | struct entry index[]; // count entries |
---|
25 | // Followed by the tile data |
---|
26 | // The index offsets are measured from the start of the file |
---|
27 | }; |
---|
28 | |
---|
29 | |
---|
30 | int read_from_file(const char *xmlconfig, int x, int y, int z, unsigned char *buf, size_t sz); |
---|
31 | |
---|
32 | #ifdef METATILE |
---|
33 | int read_from_meta(const char *xmlconfig, int x, int y, int z, unsigned char *buf, size_t sz); |
---|
34 | void process_meta(const char *xmlconfig, int x, int y, int z); |
---|
35 | void process_pack(const char *name); |
---|
36 | void process_unpack(const char *name); |
---|
37 | #endif |
---|
38 | |
---|
39 | #ifdef __cplusplus |
---|
40 | } |
---|
41 | #endif |
---|
42 | #endif |
---|