diff options
-rw-r--r-- | src/map.c | 18 | ||||
-rw-r--r-- | src/map.h | 4 |
2 files changed, 22 insertions, 0 deletions
@@ -988,3 +988,21 @@ struct db_ball *db_map_get_balls(struct db_map *map) { return map->ball_head; } + +int +db_map_tile_player_collides(struct db_map *map, int x, int y) +{ + int i; + + i = y * map->w + x; + return (map->p_col[i / 8] & (1 << (i % 8))) != 0; +} + +int +db_map_tile_ball_collides(struct db_map *map, int x, int y) +{ + int i; + + i = y * map->w + x; + return (map->b_col[i / 8] & (1 << (i % 8))) != 0; +} @@ -34,5 +34,9 @@ void db_map_get_player(struct db_map *map, int *x, int *y, int *r, int *gid); void db_map_get_target(struct db_map *map, int *x, int *y, int *r, int *gid); struct db_ball *db_map_get_balls(struct db_map *map) __attribute__((__pure__)); +int db_map_tile_player_collides(struct db_map *map, int x, int y) + __attribute__((__pure__)); +int db_map_tile_ball_collides(struct db_map *map, int x, int y) + __attribute__((__pure__)); #endif /* DB_MAP_H_ */ |