Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Chukobyte/seika
Browse files Browse the repository at this point in the history
  • Loading branch information
Chukobyte committed Dec 7, 2023
2 parents 2c9c0c6 + d07f9d2 commit f520565
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion seika/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ void input_load_gamepads();
void input_process_gamepad(SDL_Event event);

void input_initialize_gamepad_system();
void input_finalize_gamepad_system();
void input_gamepad_cleanup_flags();

//--- Input ---//
Expand Down Expand Up @@ -173,7 +174,12 @@ bool se_input_initialize() {
return true;
}

void se_input_finalize() {}
void se_input_finalize() {
se_string_hash_map_destroy(inputActionMap);
se_string_hash_map_destroy(keyboardStringValuesMap);
input_finalize_gamepad_system();
se_mouse_clear();
}

void se_input_add_action_value(const char* actionName, const char* actionValue, int deviceId) {
if (!se_string_hash_map_has(inputActionMap, actionName)) {
Expand Down Expand Up @@ -441,6 +447,10 @@ void input_initialize_gamepad_system() {
input_load_gamepads();
}

void input_finalize_gamepad_system() {
se_string_hash_map_destroy(gamepadStringValuesMap);
}

void input_load_gamepads() {
for (size_t i = 0; i < CRE_MAX_GAMEPAD_DEVICES; i++) {
activeGamePads[i].gameController = NULL;
Expand Down

0 comments on commit f520565

Please sign in to comment.