|
437 | 437 | int TCOD_random_dice_roll_s (TCOD_random_t mersenne, const char * s); |
438 | 438 |
|
439 | 439 |
|
| 440 | +// FOV |
| 441 | +
|
| 442 | +typedef enum { |
| 443 | + FOV_BASIC, |
| 444 | + FOV_DIAMOND, |
| 445 | + FOV_SHADOW, |
| 446 | + FOV_PERMISSIVE_0, |
| 447 | + FOV_PERMISSIVE_1, |
| 448 | + FOV_PERMISSIVE_2, |
| 449 | + FOV_PERMISSIVE_3, |
| 450 | + FOV_PERMISSIVE_4, |
| 451 | + FOV_PERMISSIVE_5, |
| 452 | + FOV_PERMISSIVE_6, |
| 453 | + FOV_PERMISSIVE_7, |
| 454 | + FOV_PERMISSIVE_8, |
| 455 | + FOV_RESTRICTIVE, |
| 456 | + NB_FOV_ALGORITHMS }TCOD_fov_algorithm_t; |
| 457 | +
|
| 458 | +typedef void *TCOD_map_t; |
| 459 | +
|
| 460 | +/* allocate a new map */ |
| 461 | +TCOD_map_t TCOD_map_new(int width, int height); |
| 462 | +/* set all cells as solid rock (cannot see through nor walk) */ |
| 463 | +void TCOD_map_clear(TCOD_map_t map, bool transparent, bool walkable); |
| 464 | +/* copy a map to another, reallocating it when needed */ |
| 465 | +void TCOD_map_copy(TCOD_map_t source, TCOD_map_t dest); |
| 466 | +/* change a cell properties */ |
| 467 | +void TCOD_map_set_properties(TCOD_map_t map, int x, int y, bool is_transparent, bool is_walkable); |
| 468 | +/* destroy a map */ |
| 469 | +void TCOD_map_delete(TCOD_map_t map); |
| 470 | +
|
| 471 | +/* calculate the field of view (potentially visible cells from player_x,player_y) */ |
| 472 | +void TCOD_map_compute_fov(TCOD_map_t map, int player_x, int player_y, int max_radius, bool light_walls, TCOD_fov_algorithm_t algo); |
| 473 | +/* check if a cell is in the last computed field of view */ |
| 474 | +bool TCOD_map_is_in_fov(TCOD_map_t map, int x, int y); |
| 475 | +void TCOD_map_set_in_fov(TCOD_map_t map, int x, int y, bool fov); |
| 476 | +
|
| 477 | +/* retrieve properties from the map */ |
| 478 | +bool TCOD_map_is_transparent(TCOD_map_t map, int x, int y); |
| 479 | +bool TCOD_map_is_walkable(TCOD_map_t map, int x, int y); |
| 480 | +int TCOD_map_get_width(TCOD_map_t map); |
| 481 | +int TCOD_map_get_height(TCOD_map_t map); |
| 482 | +int TCOD_map_get_nb_cells(TCOD_map_t map); |
| 483 | +
|
440 | 484 |
|
441 | 485 | // NOISE |
442 | 486 |
|
|
0 commit comments