rogged/libs/map/map.h
NotAShelf 514a9560a2
various: add admin build; various layout improvements
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ieaa99fa0a32b42b1e97aada611d809b96a6a6964
2026-06-11 10:39:28 +03:00

33 lines
1.2 KiB
C

#ifndef MAP_H
#define MAP_H
#include "common.h"
// Check if a tile is walkable floor
int is_floor(const Map *map, int x, int y);
// Get room center coordinates
void get_room_center(Room *room, int *cx, int *cy);
// Generate a new dungeon floor
void dungeon_generate(Dungeon *d, Map *map, int floor_num);
// Initialize map to all walls
void map_init(Map *map);
// Get a random floor tile position
void get_random_floor_tile(Map *map, int *x, int *y, int attempts);
int get_room_floor_tile(const Map *map, const Room *room, int *x, int *y);
int get_random_floor_tile_excluding_room(Map *map, const Room *excluded, int *x, int *y, int attempts);
Room *map_room_at(Map *map, int x, int y);
int map_validate_layout(const Map *map);
// Visibility / Fog of War
int is_in_view_range(int x, int y, int view_x, int view_y, int range);
int has_line_of_sight(const Map *map, int x1, int y1, int x2, int y2);
void compute_lighting(Map *map, const LightSource *sources, int num_sources);
int tile_brightness(const Map *map, int tx, int ty);
int is_tile_revealed(const Map *map, int tx, int ty);
int can_see_entity(const Map *map, int from_x, int from_y, int to_x, int to_y, int range);
#endif // MAP_H