helapordo 1.4.12
Loading...
Searching...
No Matches
game_rl.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 GAMECURSES_RL_H
20#define GAMECURSES_RL_H
21
22#include "../utils/game_utils.h"
23#include "../core/sprites.h"
24#include "../utils/turn_op.h"
26#include "../utils/rooms.h"
27#include <raymath.h> // Needed for: Vector2Clamp()
28
29#define MIN(a, b) ((a) < (b) ? (a) : (b))
36
37typedef struct Gui_Button {
38 Rectangle r;
39 bool on;
41 char label[50];
42 size_t label_len;
43 Color box_color;
46
60
61#define GUI_BUTTONS_MAX BUTTON_NAME_TXTFIELD
62
63typedef struct Gui_Theme {
64 Color bg_color;
65 Color txt_color;
67
79
80void handleTutorial(S4C_Color* palette);
81void setEnemySprite(Enemy * e);
82void setEquipSprite(Equip * e);
86void setBossSprite(Boss * b);
88void setChestSprite(Chest * c);
89void ToggleFullScreenWindow(int w_W, int w_H);
90void hlpd_draw_notifications(RingaBuf* rb_notifications, Rectangle notifications_rect);
91void update_GameScreen(Gui_State* gui_state, Floor** current_floor, Path** game_path, Fighter** player, Room** current_room, Gamestate** gamestate, RingaBuf* rb_notifications, int* current_x, int* current_y, int logo_sleep, bool* pause_animation, Koliseo_Temp** floor_kls, KLS_Conf temporary_kls_conf, int* current_anim_frame, loadInfo* load_info, int* saveslot_index, char current_save_path[1500], char seed[PATH_SEED_BUFSIZE+1], bool is_seeded, int* roomsDone, int* enemyTotal);
92void draw_GameScreen_Texture(RenderTexture2D target_txtr, Gui_State gui_state, int fps_target, int current_anim_frame, Floor* current_floor, Path* game_path, Fighter* player, Room* current_room, Gamestate* gamestate, RingaBuf* rb_notifications, int current_x, int current_y, loadInfo* load_info, int saveslot_index, char current_save_path[1500], char seed[PATH_SEED_BUFSIZE+1]);
93#endif // GAMECURSES_RL_H
#define PATH_SEED_BUFSIZE
Definition game_core.h:1336
void handleTutorial(void)
Shows tutorial info.
Definition game_curses.c:3790
void setConsumableSprite(Consumable *c)
Takes a Consumable pointer and prepares its sprite field by copying it line by line from consumables_...
Definition game_rl.c:110
void setEquipslotSprite(Equipslot *s)
Takes a Equipslot pointer and prepares its sprite field by copying it line by line from equipzones_sp...
Definition game_curses.c:1689
void setFighterSprite(Fighter *f)
Takes a Fighter pointer and prepares its sprite field by copying it line by line.
Definition game_curses.c:1662
void update_GameScreen(Gui_State *gui_state, Floor **current_floor, Path **game_path, Fighter **player, Room **current_room, Gamestate **gamestate, RingaBuf *rb_notifications, int *current_x, int *current_y, int logo_sleep, bool *pause_animation, Koliseo_Temp **floor_kls, KLS_Conf temporary_kls_conf, int *current_anim_frame, loadInfo *load_info, int *saveslot_index, char current_save_path[1500], char seed[PATH_SEED_BUFSIZE+1], bool is_seeded, int *roomsDone, int *enemyTotal)
Definition game_rl.c:360
void hlpd_draw_notifications(RingaBuf *rb_notifications, Rectangle notifications_rect)
Takes a RingaBuf to take the Notification from, and a Rectangle to draw them to.
Definition game_rl.c:276
Gui_Button_State
Definition game_rl.h:31
@ BUTTON_NORMAL
Definition game_rl.h:32
@ BUTTON_PRESSED
Definition game_rl.h:34
@ BUTTON_HOVER
Definition game_rl.h:33
void setEquipSprite(Equip *e)
Takes a Equip pointer and prepares its sprite field by copying it line by line from equips_sprites,...
Definition game_rl.c:91
Gui_Button_Idx
Definition game_rl.h:47
@ BUTTON_SAVESLOT_3
Definition game_rl.h:52
@ BUTTON_CLASS_ASSASSIN
Definition game_rl.h:57
@ BUTTON_CLASS_TXTFIELD
Definition game_rl.h:53
@ BUTTON_SAVESLOT_2
Definition game_rl.h:51
@ BUTTON_NEW_GAME
Definition game_rl.h:48
@ BUTTON_NAME_TXTFIELD
Definition game_rl.h:58
@ BUTTON_CLASS_MAGE
Definition game_rl.h:56
@ BUTTON_CLASS_KNIGHT
Definition game_rl.h:54
@ BUTTON_SAVESLOT_1
Definition game_rl.h:50
@ BUTTON_CLASS_ARCHER
Definition game_rl.h:55
@ BUTTON_LOAD_GAME
Definition game_rl.h:49
void draw_GameScreen_Texture(RenderTexture2D target_txtr, Gui_State gui_state, int fps_target, int current_anim_frame, Floor *current_floor, Path *game_path, Fighter *player, Room *current_room, Gamestate *gamestate, RingaBuf *rb_notifications, int current_x, int current_y, loadInfo *load_info, int saveslot_index, char current_save_path[1500], char seed[PATH_SEED_BUFSIZE+1])
Definition game_rl.c:1213
struct Gui_Button Gui_Button
void setArtifactSprite(Artifact *a)
Takes a Artifact pointer and prepares its sprite field by copying it line by line from artifacts_spri...
Definition game_rl.c:130
#define GUI_BUTTONS_MAX
Definition game_rl.h:61
void setEnemySprite(Enemy *e)
Takes a Enemy pointer and prepares its sprite field by copying it line by line from enemies_sprites,...
Definition game_curses.c:1623
void setChestSprite(Chest *c)
Takes a Chest pointer and prepares its sprite field by copying it line by line.
Definition game_curses.c:1708
void setBossSprite(Boss *b)
Takes a Boss pointer and prepares its sprite field by copying it line by line from bosses_sprites,...
Definition game_curses.c:1643
struct Gui_State Gui_State
void ToggleFullScreenWindow(int w_W, int w_H)
Definition game_rl.c:209
struct Gui_Theme Gui_Theme
S4C_Color palette[33]
Declares S4C_Color array for palette.
Definition palette.c:3
Represents the entity initialised from a artifactClass.
Definition game_core.h:537
Represents the entity initialised from a bossClass.
Definition game_core.h:1190
Represents the entity initialised from a chestClass.
Definition game_core.h:1543
Holds a certain qty of a consumableClass.
Definition game_core.h:488
Represents the entity initialised from a enemyClass.
Definition game_core.h:1149
Represents the entity initialised from a equipClass.
Definition game_core.h:1402
Represents the entity containing an Equip instance.
Definition game_core.h:1457
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
Definition game_rl.h:37
Color box_color
Definition game_rl.h:43
char label[50]
Definition game_rl.h:41
Color text_color
Definition game_rl.h:44
Gui_Button_State state
Definition game_rl.h:40
Rectangle r
Definition game_rl.h:38
size_t label_len
Definition game_rl.h:42
bool on
Definition game_rl.h:39
Definition game_rl.h:68
GameScreen currentScreen
Definition game_rl.h:72
Gui_Button buttons[GUI_BUTTONS_MAX+1]
Definition game_rl.h:76
Vector2 mouse
Definition game_rl.h:74
float gameScreenWidth
Definition game_rl.h:70
float scale
Definition game_rl.h:69
float gameScreenHeight
Definition game_rl.h:71
int framesCounter
Definition game_rl.h:73
Gui_Theme theme
Definition game_rl.h:77
Vector2 virtualMouse
Definition game_rl.h:75
Definition game_rl.h:63
Color bg_color
Definition game_rl.h:64
Color txt_color
Definition game_rl.h:65
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