diff options
author | Jacques Lucke <jacques@blender.org> | 2020-09-10 15:42:39 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-09-10 15:42:54 +0300 |
commit | 3679f899fb6048efd47a7325df65d7bcefc92482 (patch) | |
tree | d38498a0dfa930fea0a26810f3fb62f51a0a32fa /source/blender/blenloader/intern | |
parent | fbc12e6cc5ea72215ade0ac3405c50ca7c89e29c (diff) |
Refactor: move VFont .blend I/O to IDTypeInfo callbacks
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 25 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 20 |
2 files changed, 3 insertions, 42 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9d0a61c8a1a..4f1cb4e0ecc 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3151,23 +3151,6 @@ static void direct_link_world(BlendDataReader *reader, World *wrld) /** \} */ /* -------------------------------------------------------------------- */ -/** \name Read ID: VFont - * \{ */ - -static void lib_link_vfont(BlendLibReader *UNUSED(reader), VFont *UNUSED(vf)) -{ -} - -static void direct_link_vfont(BlendDataReader *reader, VFont *vf) -{ - vf->data = NULL; - vf->temp_pf = NULL; - BKE_packedfile_blend_read(reader, &vf->packedfile); -} - -/** \} */ - -/* -------------------------------------------------------------------- */ /** \name Read ID: Image * \{ */ @@ -7413,9 +7396,6 @@ static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID * case ID_LA: direct_link_light(&reader, (Light *)id); break; - case ID_VF: - direct_link_vfont(&reader, (VFont *)id); - break; case ID_IP: direct_link_ipo(&reader, (Ipo *)id); break; @@ -7491,6 +7471,7 @@ static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID * case ID_NT: case ID_LS: case ID_TXT: + case ID_VF: /* Do nothing. Handled by IDTypeInfo callback. */ break; } @@ -8162,9 +8143,6 @@ static void lib_link_all(FileData *fd, Main *bmain) case ID_AR: lib_link_armature(&reader, (bArmature *)id); break; - case ID_VF: - lib_link_vfont(&reader, (VFont *)id); - break; case ID_HA: lib_link_hair(&reader, (Hair *)id); break; @@ -8208,6 +8186,7 @@ static void lib_link_all(FileData *fd, Main *bmain) case ID_NT: case ID_LS: case ID_TXT: + case ID_VF: /* Do nothing. Handled by IDTypeInfo callback. */ break; } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index ab52e2f95b7..6ede8711138 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1393,22 +1393,6 @@ static void write_object(BlendWriter *writer, Object *ob, const void *id_address } } -static void write_vfont(BlendWriter *writer, VFont *vf, const void *id_address) -{ - if (vf->id.us > 0 || BLO_write_is_undo(writer)) { - /* Clean up, important in undo case to reduce false detection of changed datablocks. */ - vf->data = NULL; - vf->temp_pf = NULL; - - /* write LibData */ - BLO_write_id_struct(writer, VFont, id_address, &vf->id); - BKE_id_blend_write(writer, &vf->id); - - /* direct data */ - BKE_packedfile_blend_write(writer, vf->packedfile); - } -} - static void write_key(BlendWriter *writer, Key *key, const void *id_address) { if (key->id.us > 0 || BLO_write_is_undo(writer)) { @@ -3096,9 +3080,6 @@ static bool write_file_handle(Main *mainvar, case ID_LA: write_light(&writer, (Light *)id_buffer, id); break; - case ID_VF: - write_vfont(&writer, (VFont *)id_buffer, id); - break; case ID_KE: write_key(&writer, (Key *)id_buffer, id); break; @@ -3165,6 +3146,7 @@ static bool write_file_handle(Main *mainvar, case ID_NT: case ID_LS: case ID_TXT: + case ID_VF: /* Do nothing, handled in IDTypeInfo callback. */ break; case ID_LI: |