From b2a96ba8e198d20bc14f5c1cc889033f392ae4d2 Mon Sep 17 00:00:00 2001 From: Greg Wells Date: Tue, 1 Jul 2025 16:14:56 -0400 Subject: [PATCH] more array list functions --- utils/lists/gryphn_array_list.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/utils/lists/gryphn_array_list.h b/utils/lists/gryphn_array_list.h index f9bfe65..969fd08 100644 --- a/utils/lists/gryphn_array_list.h +++ b/utils/lists/gryphn_array_list.h @@ -37,6 +37,22 @@ int newCount = count - (list->maxSize - list->count);\ list->data = realloc(list->data, sizeof(type) * (newCount + list->maxSize)); \ list->maxSize += newCount; \ list->count += count; \ +} \ +inline static void type##ArrayListRemove(type##ArrayList* list) { \ +if (list->count == 0) return; \ +list->count--; \ +} \ +inline static void type##ArrayListPopHead(type##ArrayList* list) { \ +if (list->count == 0) return; \ +list->count--; \ +for (int i = 0; i < list->count; i++) { \ +list->data[i] = list->data[i + 1];\ +} \ } + + +//metalAvaliableTextureArrayListPopHead + GN_ARRAY_LIST(int); +GN_ARRAY_LIST(uint32_t);