helapordo 1.4.23
Loading...
Searching...
No Matches
floors.h File Reference
#include <math.h>
#include "../core/game_log.h"
#include "game_utils.h"
Include dependency graph for floors.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void init_floor_layout (Floor *floor)
 Takes a Floor pointer and initialises its floor_layout fields to empty.
float calc_distance (int x1, int y1, int x2, int y2)
 Function to calculate the distance between two points.
void init_floor_rooms (Floor *floor)
 Takes a Floor pointer and initialises its rooms_matrix and roomclass_matrix, using the values in floor_layout fields.
void floor_random_walk (Floor *floor, int x, int y, int steps, int do_layout_clean)
 Takes a Floor pointer and tries walking randomly to initialises its floor_layout field.
void floor_set_room_types (Floor *floor)
 Takes a Floor pointer and initialises its roomclass_layout, using the floor_layout fields.
void load_floor_explored (Floor *floor)
 Takes a Floor pointer and initialises its explored_matrix using the values in floor_layout fields.
void debug_print_roomclass_layout (Floor *floor, FILE *fp)
 Takes a Floor pointer and prints its roomClass layout to the passed FILE pointer.
void debug_print_floor_layout (Floor *floor, FILE *fp)
 Takes a Floor pointer and prints its floor layout to the passed FILE pointer.
void debug_print_floor_visible_layout (Floor *floor, FILE *fp)
int room_color (Floor *floor, int cell_x, int cell_y)
char room_char (Floor *floor, int cell_x, int cell_y)
bool blocks_vision (const Floor *floor, int x, int y)
void cast_light (Floor *floor, int cx, int cy, int row, float start_slope, float end_slope, int radius, int xx, int xy, int yx, int yy)
void floor_calculate_fov (Floor *floor, int player_x, int player_y, int radius)

Variables

char roomclass_chars [ROOM_CLASS_MAX+1]
int roomclass_colors [ROOM_CLASS_MAX+1]
int roomclass_colors_alt [ROOM_CLASS_MAX+1]

Function Documentation

◆ blocks_vision()

bool blocks_vision ( const Floor * floor,
int x,
int y )

◆ calc_distance()

float calc_distance ( int x1,
int y1,
int x2,
int y2 )

Function to calculate the distance between two points.

◆ cast_light()

void cast_light ( Floor * floor,
int cx,
int cy,
int row,
float start_slope,
float end_slope,
int radius,
int xx,
int xy,
int yx,
int yy )

◆ debug_print_floor_layout()

void debug_print_floor_layout ( Floor * floor,
FILE * fp )

Takes a Floor pointer and prints its floor layout to the passed FILE pointer.

See also
Floor
floorClass

◆ debug_print_floor_visible_layout()

void debug_print_floor_visible_layout ( Floor * floor,
FILE * fp )

◆ debug_print_roomclass_layout()

void debug_print_roomclass_layout ( Floor * floor,
FILE * fp )

Takes a Floor pointer and prints its roomClass layout to the passed FILE pointer.

See also
Floor
floorClass
roomClass

◆ floor_calculate_fov()

void floor_calculate_fov ( Floor * floor,
int player_x,
int player_y,
int radius )

◆ floor_random_walk()

void floor_random_walk ( Floor * floor,
int x,
int y,
int steps,
int do_layout_clean )

Takes a Floor pointer and tries walking randomly to initialises its floor_layout field.

If do_layout_clean is 1, it will reset floor layout when walked area ratio is below or above expectations.

See also
Floor
floorClass

◆ floor_set_room_types()

void floor_set_room_types ( Floor * floor)

Takes a Floor pointer and initialises its roomclass_layout, using the floor_layout fields.

See also
Floor
floorClass

◆ init_floor_layout()

void init_floor_layout ( Floor * floor)

Takes a Floor pointer and initialises its floor_layout fields to empty.

It also sets the area field to 0.

See also
Floor
floorClass

◆ init_floor_rooms()

void init_floor_rooms ( Floor * floor)

Takes a Floor pointer and initialises its rooms_matrix and roomclass_matrix, using the values in floor_layout fields.

See also
Floor
floorClass

◆ load_floor_explored()

void load_floor_explored ( Floor * floor)

Takes a Floor pointer and initialises its explored_matrix using the values in floor_layout fields.

See also
Floor
floorClass

◆ room_char()

char room_char ( Floor * floor,
int cell_x,
int cell_y )

◆ room_color()

int room_color ( Floor * floor,
int cell_x,
int cell_y )

Variable Documentation

◆ roomclass_chars

char roomclass_chars[ROOM_CLASS_MAX+1]
extern

◆ roomclass_colors

int roomclass_colors[ROOM_CLASS_MAX+1]
extern

◆ roomclass_colors_alt

int roomclass_colors_alt[ROOM_CLASS_MAX+1]
extern