diff --git a/src/game.c b/src/game.c index e8bb763..f697bc5 100644 --- a/src/game.c +++ b/src/game.c @@ -160,7 +160,7 @@ void scene_setup(void) } int parent_node = new_ent->node; - int num_suz = 200; + int num_suz = 2; srand(time(NULL)); for(int i = 0; i < num_suz; i++) { diff --git a/src/input.c b/src/input.c index fa70351..8d07b6d 100644 --- a/src/input.c +++ b/src/input.c @@ -7,10 +7,11 @@ #include "log.h" #include "gui.h" #include "file_io.h" +#include "string_utils.h" struct Input_Map { - const char* name; + char* name; struct Key_Combination* keys; int state; }; @@ -39,6 +40,8 @@ void input_cleanup(void) for(int i = 0; i < array_len(input_map_list); i++) { struct Input_Map* map = &input_map_list[i]; + log_message("Map : %s, Num keys : %d", map->name, array_len(map->keys)); + if(map->name) free(map->name); array_free(map->keys); } array_free(input_map_list); @@ -70,7 +73,7 @@ int input_keybinds_load(const char* filename) if(line_buffer[0] == '#' || strlen(line_buffer) == 0) continue; - log_message("Line : %s", line_buffer); + //log_message("Line : %s", line_buffer); memset(key_str, '\0', MAX_KEYBIND_LEN); char* value_str = strstr(line_buffer, ":"); if(!value_str) @@ -96,7 +99,7 @@ int input_keybinds_load(const char* filename) while(val) { - log_message("Key read : %s", val); + //log_message("Key read : %s", val); /* Check if there are any Modifiers */ int modifiers = KMD_NONE; @@ -109,7 +112,7 @@ int input_keybinds_load(const char* filename) { memset(key_name, '\0', max_key_str_len); strncpy(key_name, start_loc, (keys - start_loc)); - log_message("key_name : %s", key_name); + //log_message("key_name : %s", key_name); int key_modifier = platform_key_from_name(key_name); @@ -280,7 +283,7 @@ void input_map_create(const char* name, struct Key_Combination* keys, size_t num else { struct Input_Map* new_map = array_grow(input_map_list, struct Input_Map); - new_map->name = name; + new_map->name = str_new(name); new_map->keys = array_new_cap(struct Key_Combination, num_keys); new_map->state = KS_INACTIVE; for(size_t i = 0; i < num_keys; i++) diff --git a/src/utils.c b/src/utils.c index e435fbd..0946c22 100644 --- a/src/utils.c +++ b/src/utils.c @@ -2,7 +2,7 @@ #include #include -#define BUFF_SIZE 64 +#define BUFF_SIZE 128 static char str_buff[BUFF_SIZE]; const char* tostr_vec3(vec3* v) diff --git a/src/utils.h b/src/utils.h index 53ceb8e..4383ac3 100644 --- a/src/utils.h +++ b/src/utils.h @@ -1,5 +1,5 @@ -#ifndef utils_H -#define utils_H +#ifndef UTILS_H +#define UTILS_H #include "linmath.h"