-
Notifications
You must be signed in to change notification settings - Fork 3
darnit_map.h
slaeshjag edited this page Mar 27, 2013
·
16 revisions
This type points to an array of key-value propery pairs.
- const char *d_map_prop(DARNIT_MAP_REF, const char *key);
typedef struct {
unsigned int x;
unsigned int y;
unsigned int l;
DARNIT_MAP_REF *ref;
} DARNIT_MAP_OBJECT;- x - The X-coordinate for the object in tiles
- y - The Y-coordinate for the object in tiles
- l - Index of the layer to place the object on
- ref - The list of properties for the object (see DARNIT_MAP_REF).
typedef struct {
DARNIT_TILEMAP *tilemap;
DARNIT_TILESHEET *ts;
DARNIT_MAP_REF *ref;
unsigned int offset_x;
unsigned int offset_y;
unsigned int tile_w;
unsigned int tile_h;
} DARNIT_MAP_LAYER;- DARNIT_TILEMAP *tilemap - The tilemap for this layer
- DARNIT_TILESHEET *ts - The tilesheet used to draw the tilemap for this layer
- DARNIT_MAP_REF *ref - The list of properties for this layer
- offset_x - For othogonal maps, this is the amount to offset the rendering of the map with, on the X axis.
- offset_y - For orthogonal maps, this is the amount to offset the rendering of the map with, on the Y axis.
- tile_w - The width of a tile
- tile_h - The height of a tile
typedef struct {
DARNIT_MAP_LAYER *layer;
const unsigned int layers;
DARNIT_MAP_OBJECT *object;
const unsigned int objects;
DARNIT_MAP_REF *prop;
DARNIT_MAP_STRINGDATA *stringdata;
DARNIT_MAP_REF *stringrefs;
const int cam_x;
const int cam_y;
const unsigned int isometric;
} DARNIT_MAP;- DARNIT_MAP_LAYER *layer - Points to an array of DARNIT_MAP_LAYER containing per-layer information like tiledata, the tilemap for the layer etc.
- layers - The number of layers in the map
- DARNIT_MAP_OBJECT *object - Points to an array of DARNIT_MAP_OBJECT containing information about objects stored on the map (coordinates, key-value property information.)
- objects - Number of objects on the map
- DARNIT_MAP_REF - key-value properties for the map file
- stringdata - Internal, don't touch
- stringrefs - Internal, don't touch
- cam_x - X coordinate for the camera on the map
- cam_y - Y coordinate for the camera on the map
- isometric - Set to 1 if the map is isometric, 0 if not.