-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsettings.c
More file actions
46 lines (36 loc) · 1.11 KB
/
settings.c
File metadata and controls
46 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* beanbricks.c: a questionable breakout clone in C and Raylib.
*
* Copyright (c) Eason Qin <eason@ezntek.com>, 2024-2025.
*
* This source code form is wholly licensed under the MIT/Expat license. View
* the full license text in the root of the project.
*
* INFO: settings screen
*/
#include "settings.h"
#include <raylib.h>
#include "beanbricks.h"
#include "title.h"
void s_settings_gui_draw(SettingsState* s) { title_draw(&s->gui.title); }
void s_settings_draw(SettingsState* s) { s_settings_gui_draw(s); }
void s_settings_update(SettingsState* s) {
if (IsKeyPressed(KEY_Q) || IsKeyPressed(KEY_ESCAPE)) {
switch_screen(SCR_TITLE);
}
}
SettingsGui s_settings_gui_new(void) {
return (SettingsGui){.title = title_new_centered(
20, astr("nothing to see here..."), TXT_PRIMARY)};
}
Screen s_settings_new(void) {
SettingsState s = (SettingsState){
.gui = s_settings_gui_new(),
};
Screen res = {
.variant = SCR_SETTINGS,
.data.settings = s,
};
return res;
}
void s_settings_deinit(SettingsState* s) { title_deinit(&s->gui.title); }