source: subversion/applications/utils/mod_tile/store.h @ 8961

Last change on this file since 8961 was 8425, checked in by jonb, 11 years ago

mod_tile: Move map style & font location into render_config.h. Fix up operation with non-metatile rendering. Several utilities are not implemented for non-metatile (render_list, render_old, speedtest).

File size: 887 bytes
Line 
1#ifndef STORE_H
2#define STORE_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stdlib.h>
9#include "render_config.h"
10int tile_read(int x, int y, int z, char *buf, int sz);
11
12#define META_MAGIC "META"
13//static const char meta_magic[4] = { 'M', 'E', 'T', 'A' };
14
15struct entry {
16    int offset;
17    int size;
18};
19
20struct 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
30int read_from_file(int x, int y, int z, char *buf, size_t sz);
31
32#ifdef METATILE
33int read_from_meta(int x, int y, int z, char *buf, size_t sz);
34void process_meta(int x, int y, int z);
35void process_pack(const char *name);
36void process_unpack(const char *name);
37#endif
38
39#ifdef __cplusplus
40}
41#endif
42#endif
Note: See TracBrowser for help on using the repository browser.