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

Last change on this file since 6894 was 6894, checked in by jonb, 12 years ago

mod_tile: Update to a new meta tile scheme which stores all sub-tiles in a single .meta file. The PNG files are extracted from this on the fly by mod_tile. This is more efficient in disk space and inode usage

File size: 840 bytes
Line 
1#ifndef STORE_H
2#define STORE_H
3
4#ifdef __cplusplus
5extern "C" {
6#endif
7
8#include <stdlib.h>
9
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);
31int read_from_meta(int x, int y, int z, char *buf, size_t sz);
32
33void process_meta(int x, int y, int z);
34void process_pack(const char *name);
35void process_unpack(const char *name);
36
37
38
39#ifdef __cplusplus
40}
41#endif
42#endif
Note: See TracBrowser for help on using the repository browser.