summaryrefslogtreecommitdiff
path: root/src/project.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/project.cpp')
-rw-r--r--src/project.cpp16
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;