diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-11-10 16:48:20 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-11-12 12:14:05 -0500 |
| commit | 283d1f8dff8731c7317f845a7df5f619b623a121 (patch) | |
| tree | aa2c729e51a4a7c530a6dca833fc4d414ef560e0 /src/project.cpp | |
| parent | 112c9d067343d85ffc77f559683c0284381d196e (diff) | |
pke: FontType pk_bkt_arr
Diffstat (limited to 'src/project.cpp')
| -rw-r--r-- | src/project.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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<Asset> iter_asset{}; pk_iter_t<EntityType> iter_ent_type{}; + pk_iter_t<FontType> 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; |
