helapordo 1.4.20
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-2026 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 "../core/game_log.h"
23#include "game_utils.h"
24
25void init_floor_layout(Floor * floor);
26float calc_distance(int x1, int y1, int x2, int y2);
27void init_floor_rooms(Floor * floor);
28void floor_random_walk(Floor * floor, int x, int y, int steps,
29 int do_layout_clean);
30void floor_set_room_types(Floor * floor);
31void load_floor_explored(Floor * floor);
32void debug_print_roomclass_layout(Floor * floor, FILE * fp);
33void debug_print_floor_layout(Floor * floor, FILE * fp);
34
35#ifdef HELAPORDO_CURSES_BUILD
37
38void display_roomclass_layout(Floor * floor, WINDOW * win);
39void display_floor_layout(Floor * floor, WINDOW * win);
40void display_explored_layout(Floor * floor, WINDOW * win);
41
42void draw_cell(Floor * floor, int cell_x, int cell_y, WINDOW * win,
43 int drawcorner_x, int drawcorner_y, int x_size, int y_size,
44 int recurse);
45void draw_floor_view(Floor * floor, int current_x, int current_y, WINDOW * win);
46
47void move_update(Gamestate * gamestate, Floor * floor, int *current_x,
48 int *current_y, WINDOW * win, Path * path, Fighter * player,
49 Room * room, loadInfo * load_info, Koliseo * kls,
50 Koliseo_Temp * t_kls);
51#else
52#ifndef HELAPORDO_RAYLIB_BUILD
53#error "HELAPORDO_CURSES_BUILD and HELAPORDO_RAYLIB_BUILD are both undefined."
54#else
55void display_roomclass_layout(Floor *floor, Rectangle *win, float pixelSize);
56void display_floor_layout(Floor * floor, Rectangle * win, float pixelSize);
57void display_floor_layout_with_player(Floor * floor, Rectangle * win, int current_x, int current_y, float pixelSize);
58void display_explored_layout(Floor *floor, Rectangle *win, float pixelSize);
59void display_explored_layout_with_player(Floor *floor, Rectangle *win, int current_x, int current_y, float pixelSize);
60void draw_cell(Floor * floor, int cell_x, int cell_y, Rectangle * win,
61 int drawcorner_x, int drawcorner_y, int x_size, int y_size, float pixelSize,
62 int recurse);
63void draw_floor_view(Floor * floor, int current_x, int current_y, float pixelSize, Rectangle * win);
64void step_floor(Floor * floor, int *current_x,
65 int *current_y, int control);
66#endif // HELAPORDO_RAYLIB_BUILD
67
68#endif // HELAPORDO_CURSES_BUILD
69
70#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:1093
Represents the entity initialised from a floorClass.
Definition game_core.h:1825
Holds arguments for a game.
Definition game_core.h:1899
Holds the state of game progression.
Definition game_core.h:1357
Represents the entity initialised from a roomClass.
Definition game_core.h:1770
Contains loaded values to pass to initRoom().
Definition game_core.h:1878