From 6478cb96e5054c9146fac90bcabc4d9c780e9915 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Wed, 21 May 2025 13:40:02 -0400 Subject: pke: font DynArray to pk_arr_t --- src/font.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/font.cpp') diff --git a/src/font.cpp b/src/font.cpp index 380827b..35db13f 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -1,7 +1,6 @@ #include "font.hpp" #include "asset-manager.hpp" -#include "dynamic-array.hpp" #include "pk.h" #include "window.hpp" #include "static-plane.hpp" @@ -797,8 +796,9 @@ FontRenderHandle FontType_AddStringRender(FontTypeIndex idx_ft, const pk_cstr && if (window != NULL) { // insert new characters into tmp buffer { - DynArray glyph_indices; - glyph_indices.Reserve(str.length); + pk_arr_t glyph_indices{}; + glyph_indices.bkt = pkeSettings.mem.bkt; + pk_arr_reserve(&glyph_indices, str.length); count = 0; for (i = 0; i < str.length;) { fgc = nullptr; @@ -829,7 +829,7 @@ FontRenderHandle FontType_AddStringRender(FontTypeIndex idx_ft, const pk_cstr && continue; } count += 1; - glyph_indices.Push(m); + pk_arr_append_t(&glyph_indices, uint32_t(m)); } // TODO specific bucket @@ -838,6 +838,7 @@ FontRenderHandle FontType_AddStringRender(FontTypeIndex idx_ft, const pk_cstr && for (i = 0; i < count; ++i) { fr->glyph_indices[i] = glyph_indices[i]; } + glyph_indices.data = nullptr; } VkDeviceSize item_count_orig = ft->bindings.instance_counter; -- cgit v1.2.3