11 lines
311 B
C
11 lines
311 B
C
|
#include "../../../include/microfx/ext/gametools.h"
|
||
|
|
||
|
int vget_tile_at_point(MMap *map, int x, int y) {
|
||
|
/* tx and ty contain the tile position. */
|
||
|
int tx = x/map->tw, ty = y/map->th;
|
||
|
if(tx>=0 && tx < map->w && ty>=0 && ty < map->h){
|
||
|
return (int)map->map[ty*map->w+tx];
|
||
|
}
|
||
|
return -1;
|
||
|
}
|