helapordo 1.4.14
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))
30
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
74
75#define GUI_BUTTONS_MAX BUTTON_SPECIAL_UNLOCK_4
76
77typedef struct Gui_Theme {
78 Color bg_color;
79 Color txt_color;
81
94
95void handleTutorial(S4C_Color* palette);
96void setEnemySprite(Enemy * e);
97void setEquipSprite(Equip * e);
101void setBossSprite(Boss * b);
102void setFighterSprite(Fighter * f);
103void setChestSprite(Chest * c);
104void ToggleFullScreenWindow(int w_W, int w_H);
105void hlpd_draw_notifications(RingaBuf* rb_notifications, Rectangle notifications_rect);
106void 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);
107void 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]);
108void fight_Special(specialMove move, Rectangle *w, Fighter *f, Enemy *e, Boss *b,
109 Path *p, int roomIndex, int enemyIndex, int isBoss);
110#endif // GAMECURSES_RL_H
#define PATH_SEED_BUFSIZE
Definition game_core.h:1344
specialMove
The different kinds of special moves.
Definition game_core.h:798
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 fight_Special(specialMove move, Rectangle *w, Fighter *f, Enemy *e, Boss *b, Path *p, int roomIndex, int enemyIndex, int isBoss)
Takes a specialMove, a Fighter, a Enemy, a Boss and a Path pointers (and integers for current room an...
Definition game_rl.c:2371
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_SPECIAL_UNLOCK_3
Definition game_rl.h:71
@ BUTTON_SAVESLOT_3
Definition game_rl.h:52
@ BUTTON_SPECIAL_2
Definition game_rl.h:66
@ BUTTON_CLASS_ASSASSIN
Definition game_rl.h:57
@ BUTTON_SPECIAL_1
Definition game_rl.h:65
@ BUTTON_SPECIAL_UNLOCK_4
Definition game_rl.h:72
@ BUTTON_CLASS_TXTFIELD
Definition game_rl.h:53
@ BUTTON_SAVESLOT_2
Definition game_rl.h:51
@ BUTTON_EQUIPS
Definition game_rl.h:61
@ BUTTON_SPECIAL
Definition game_rl.h:60
@ BUTTON_SPECIAL_3
Definition game_rl.h:67
@ BUTTON_NEW_GAME
Definition game_rl.h:48
@ BUTTON_SPECIAL_4
Definition game_rl.h:68
@ BUTTON_NAME_TXTFIELD
Definition game_rl.h:58
@ BUTTON_CLASS_MAGE
Definition game_rl.h:56
@ BUTTON_CHECK_LOADOUT
Definition game_rl.h:64
@ BUTTON_CONSUMABLES
Definition game_rl.h:62
@ BUTTON_SPECIAL_UNLOCK_1
Definition game_rl.h:69
@ BUTTON_CLASS_KNIGHT
Definition game_rl.h:54
@ BUTTON_FIGHT
Definition game_rl.h:59
@ BUTTON_SPECIAL_UNLOCK_2
Definition game_rl.h:70
@ BUTTON_OPEN_BAG
Definition game_rl.h:63
@ 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:1565
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:75
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
void ToggleFullScreenWindow(int w_W, int w_H)
Definition game_rl.c:209
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:545
Represents the entity initialised from a bossClass.
Definition game_core.h:1198
Represents the entity initialised from a chestClass.
Definition game_core.h:1551
Holds a certain qty of a consumableClass.
Definition game_core.h:496
Represents the entity initialised from a enemyClass.
Definition game_core.h:1157
Represents the entity initialised from a equipClass.
Definition game_core.h:1410
Represents the entity containing an Equip instance.
Definition game_core.h:1465
Represents the entity initialised from a fighterClass.
Definition game_core.h:1087
Represents the entity initialised from a floorClass.
Definition game_core.h:1819
Holds arguments for a game.
Definition game_core.h:1893
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:82
GameScreen currentScreen
Definition game_rl.h:86
Gui_Button buttons[GUI_BUTTONS_MAX+1]
Definition game_rl.h:90
Vector2 mouse
Definition game_rl.h:88
float gameScreenWidth
Definition game_rl.h:84
float scale
Definition game_rl.h:83
float gameScreenHeight
Definition game_rl.h:85
int framesCounter
Definition game_rl.h:87
Gui_Theme theme
Definition game_rl.h:91
Vector2 virtualMouse
Definition game_rl.h:89
int selectedIndex
Definition game_rl.h:92
Definition game_rl.h:77
Color bg_color
Definition game_rl.h:78
Color txt_color
Definition game_rl.h:79
Holds the state of game progression.
Definition game_core.h:1351
Represents the entity initialised from a roomClass.
Definition game_core.h:1764
Contains loaded values to pass to initRoom().
Definition game_core.h:1872