From 283d1f8dff8731c7317f845a7df5f619b623a121 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Mon, 10 Nov 2025 16:48:20 -0500 Subject: pke: FontType pk_bkt_arr --- src/project.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/project.cpp') diff --git a/src/project.cpp b/src/project.cpp index e1c3333..32f6503 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -396,8 +396,10 @@ void PkeProject_Save(const char *filePath) { bool b; pk_iter_t iter_asset{}; pk_iter_t iter_ent_type{}; + pk_iter_t iter_font_type{}; pk_bkt_arr *bkt_arr_assets; pk_bkt_arr *bkt_arr_ent_types; + pk_bkt_arr *bkt_arr_font_types; const char *saveFilePath = filePath == nullptr ? PKE_PROJ_DEFAULT_FILENAME : filePath; std::ostringstream stream{}; @@ -452,16 +454,14 @@ void PkeProject_Save(const char *filePath) { b = pk_bkt_arr_iter_increment(bkt_arr_ent_types, &iter_ent_type); } - 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; + bkt_arr_font_types = FontType_GetFonts(); + b = pk_bkt_arr_iter_begin(bkt_arr_font_types, &iter_font_type); + while(b) { + if (PK_HAS_FLAG(iter_font_type->entity_flags, ENTITY_FLAG_DO_NOT_SERIALIZE)) continue; stream << PKE_PROJ_FILE_OBJ_FONT << std::endl; - FontType_Serialize(stream, ft); + FontType_Serialize(stream, iter_font_type); stream << PKE_PROJ_FILE_OBJ_END << std::endl; + b = pk_bkt_arr_iter_increment(bkt_arr_font_types, &iter_font_type); } stream << PKE_PROJ_FILE_END << std::endl; -- cgit v1.2.3