twn_input: singleton rework, twn_control.h and fixes

This commit is contained in:
2024-10-08 10:12:30 +03:00
parent aef3f6444e
commit 0ede612bec
17 changed files with 677 additions and 647 deletions

View File

@ -188,7 +188,7 @@ static void main_loop(void) {
poll_events();
input_state_update(&ctx.game.input);
input_state_update(&ctx.input);
game_object_tick();
@ -634,7 +634,7 @@ static bool initialize(void) {
ctx.keybind_slots = datum_keybind_slots.u.i;
}
}
input_state_init(&ctx.game.input);
input_state_init(&ctx.input);
/* scripting */
/*
@ -657,7 +657,7 @@ static void clean_up(void) {
scripting_deinit(ctx);
*/
input_state_deinit(&ctx.game.input);
input_state_deinit(&ctx.input);
text_cache_deinit(&ctx.text_cache);
textures_cache_deinit(&ctx.texture_cache);
@ -675,7 +675,7 @@ static void clean_up(void) {
static void reset_state(void) {
input_reset_state(&ctx.game.input);
input_reset_state(&ctx.input);
textures_reset_state();
}