helapordo 1.4.12
Loading...
Searching...
No Matches
floors.h
Go to the documentation of this file.
1// jgabaut @ github.com/jgabaut
2// SPDX-License-Identifier: GPL-3.0-only
3/*
4 Copyright (C) 2022-2024 jgabaut
5
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, version 3 of the License.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>.
17*/
18
19#ifndef FLOORS_H
20#define FLOORS_H
21#include <math.h>
22#include "game_utils.h"
23
24void init_floor_layout(Floor * floor);
25float calc_distance(int x1, int y1, int x2, int y2);
26void init_floor_rooms(Floor * floor);
27void floor_random_walk(Floor * floor, int x, int y, int steps,
28 int do_layout_clean);
29void floor_set_room_types(Floor * floor);
30void load_floor_explored(Floor * floor);
31void debug_print_roomclass_layout(Floor * floor, FILE * fp);
32void debug_print_floor_layout(Floor * floor, FILE * fp);
33
34#ifdef HELAPORDO_CURSES_BUILD
36
37void display_roomclass_layout(Floor * floor, WINDOW * win);
38void display_floor_layout(Floor * floor, WINDOW * win);
39void display_explored_layout(Floor * floor, WINDOW * win);
40
41void draw_cell(Floor * floor, int cell_x, int cell_y, WINDOW * win,
42 int drawcorner_x, int drawcorner_y, int x_size, int y_size,
43 int recurse);
44void draw_floor_view(Floor * floor, int current_x, int current_y, WINDOW * win);
45
46void move_update(Gamestate * gamestate, Floor * floor, int *current_x,
47 int *current_y, WINDOW * win, Path * path, Fighter * player,
48 Room * room, loadInfo * load_info, Koliseo * kls,
49 Koliseo_Temp * t_kls);
50#else
51#ifndef HELAPORDO_RAYLIB_BUILD
52#error "HELAPORDO_CURSES_BUILD and HELAPORDO_RAYLIB_BUILD are both undefined."
53#else
54void display_roomclass_layout(Floor *floor, Rectangle *win, float pixelSize);
55void display_floor_layout(Floor * floor, Rectangle * win, float pixelSize);
56void display_floor_layout_with_player(Floor * floor, Rectangle * win, int current_x, int current_y, float pixelSize);
57void display_explored_layout(Floor *floor, Rectangle *win, float pixelSize);
58void display_explored_layout_with_player(Floor *floor, Rectangle *win, int current_x, int current_y, float pixelSize);
59void draw_cell(Floor * floor, int cell_x, int cell_y, Rectangle * win,
60 int drawcorner_x, int drawcorner_y, int x_size, int y_size, float pixelSize,
61 int recurse);
62void draw_floor_view(Floor * floor, int current_x, int current_y, float pixelSize, Rectangle * win);
63void step_floor(Floor * floor, int *current_x,
64 int *current_y, int control);
65#endif // HELAPORDO_RAYLIB_BUILD
66
67#endif // HELAPORDO_CURSES_BUILD
68
69#endif // FLOORS_H
void init_floor_rooms(Floor *floor)
Takes a Floor pointer and initialises its rooms_matrix and roomclass_matrix, using the values in floo...
Definition floors.c:60
void floor_set_room_types(Floor *floor)
Takes a Floor pointer and initialises its roomclass_layout, using the floor_layout fields.
Definition floors.c:174
void init_floor_layout(Floor *floor)
Takes a Floor pointer and initialises its floor_layout fields to empty.
Definition floors.c:26
void debug_print_roomclass_layout(Floor *floor, FILE *fp)
Takes a Floor pointer and prints its roomClass layout to the passed FILE pointer.
Definition floors.c:423
void load_floor_explored(Floor *floor)
Takes a Floor pointer and initialises its explored_matrix using the values in floor_layout fields.
Definition floors.c:406
void debug_print_floor_layout(Floor *floor, FILE *fp)
Takes a Floor pointer and prints its floor layout to the passed FILE pointer.
Definition floors.c:473
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.
Definition floors.c:83
float calc_distance(int x1, int y1, int x2, int y2)
Function to calculate the distance between two points.
Definition floors.c:48
Represents the entity initialised from a fighterClass.
Definition game_core.h:1079
Represents the entity initialised from a floorClass.
Definition game_core.h:1811
Holds arguments for a game.
Definition game_core.h:1885
Holds the state of game progression.
Definition game_core.h:1343
Represents the entity initialised from a roomClass.
Definition game_core.h:1756
Contains loaded values to pass to initRoom().
Definition game_core.h:1864