From 73c5e170260638cc566cba2689ea570caee39251 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Tue, 16 Sep 2025 16:58:02 -0400 Subject: pke: major object lifetime overhaul. Added pke-test-load-unload to ensure objects are managed as expected. --- src/project.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/project.cpp') diff --git a/src/project.cpp b/src/project.cpp index 62525ef..e1c3333 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -452,10 +452,11 @@ void PkeProject_Save(const char *filePath) { b = pk_bkt_arr_iter_increment(bkt_arr_ent_types, &iter_ent_type); } - FontTypeIndex font_count; - FontType *fonts = FontType_GetFonts(font_count); - for (FontTypeIndex b = FontTypeIndex{0}; b < font_count; ++b) { - FontType *ft = &fonts[(FontTypeIndex_T)b]; + uint64_t idx_unused; + FontType *fonts = FontType_GetFonts(idx_unused); + for (uint64_t u = 0; u < PKE_FONT_MAX_FONT_TYPES; ++u) { + if ((idx_unused & (1llu << u)) != 0) continue; + FontType *ft = &fonts[(FontTypeIndex_T)u]; if (ft->title.val == nullptr) continue; if (PK_HAS_FLAG(ft->entity_flags, ENTITY_FLAG_DO_NOT_SERIALIZE)) continue; stream << PKE_PROJ_FILE_OBJ_FONT << std::endl; -- cgit v1.2.3