#include "map.h" #include "cfg.h" #include "../map/maps.h" #include static unsigned int map_id = 0; void map_next(void) { if (tmj2c_maps[map_id + 1] != NULL) map_id += 1; } void map_previous(void) { if (map_id > 0) map_id -= 1; } int map_width(void) { return tmj2c_maps[map_id]->width; } int map_height(void) { return tmj2c_maps[map_id]->height; } int map_get(int x, int y) { if (x < 0 || y < 0 || x >= map_width() || y >= map_height()) return 1; if (tmj2c_maps[map_id]->numlayers < 1) return 1; return tmj2c_maps[map_id]->layers[0].data[x + y * map_width()]; } int map_get_px(int x, int y) { if (x < 0 || y < 0) return 1; return map_get(x / TSIZE, y / TSIZE); } void map_draw(void) { } const Tmj2cObject * map_objects(unsigned int *size) { if (size != NULL) *size = tmj2c_maps[map_id]->numobjects; return tmj2c_maps[map_id]->objects; }