tuxanci2-engine
Game engine for tuxanci2
Log | Files | Refs | README | LICENSE
commit c04b78ce586b766021d538a530f6347d456f87e7
parent 7f496de5c8407f6d566da0bf99bbc1ef2b16a506
Author: GNUfault <connor@gnufault.org>
Date: Fri, 30 Oct 2026 17:01:24 +0000
fix, cannot do a message i gtg
Diffstat:
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/game/src/ta_button.c b/game/src/ta_button.c
@@ -43,18 +43,18 @@ ta_bool ta_button_lists_add(ta_button_lists *list, const char *label, ta_button_
return ta_false;
}
- if (list->size >= list->buttons_size) {
- ta_size new_capacity = (list->buttons_size == 0) ? 4 : (list->buttons_size * 2);
-
- ta_button *temp = (ta_button *)ta_realloc(list->buttons, new_capacity * sizeof(ta_button));
-
- if (temp == TA_NULL) {
- return ta_false;
- }
-
- list->buttons = temp;
- list->buttons_size = new_capacity;
- }
+ if (list->size >= list->buttons_size) {
+ ta_size new_capacity = list->buttons_size + 1;
+
+ ta_button *temp = (ta_button *)ta_realloc(list->buttons, new_capacity * sizeof(ta_button));
+
+ if (temp == TA_NULL) {
+ return ta_false;
+ }
+
+ list->buttons = temp;
+ list->buttons_size = new_capacity;
+ }
ta_uint32 font_size = scale_to_display(TA_BUTTON_FONT_SIZE);