Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-09-10 18:31:18 +0300
committerJacques Lucke <jacques@blender.org>2020-09-10 18:31:18 +0300
commit0c7e77d416cac85d6b50778115d8cae4c3d64a6c (patch)
tree69f86021fea53d821f0497474d6735b014c82246 /source/blender/blenloader
parentbe5cbbabcea555fc5ba3ac84922342ad2fb71dd4 (diff)
Refactor: move Speaker .blend I/O to IDTypeInfo callbacks
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c39
-rw-r--r--source/blender/blenloader/intern/writefile.c17
2 files changed, 3 insertions, 53 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index ccc5248c472..b8697734013 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6445,28 +6445,6 @@ static void direct_link_lightprobe(BlendDataReader *reader, LightProbe *prb)
/** \} */
/* -------------------------------------------------------------------- */
-/** \name Read ID: Speaker
- * \{ */
-
-static void lib_link_speaker(BlendLibReader *reader, Speaker *spk)
-{
- BLO_read_id_address(reader, spk->id.lib, &spk->sound);
-}
-
-static void direct_link_speaker(BlendDataReader *reader, Speaker *spk)
-{
- BLO_read_data_address(reader, &spk->adt);
- BKE_animdata_blend_read_data(reader, spk->adt);
-
-#if 0
- spk->sound = newdataadr(fd, spk->sound);
- direct_link_sound(fd, spk->sound);
-#endif
-}
-
-/** \} */
-
-/* -------------------------------------------------------------------- */
/** \name Read ID: Sound
* \{ */
@@ -6789,9 +6767,6 @@ static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID *
case ID_LI:
direct_link_library(fd, (Library *)id, main);
break;
- case ID_SPK:
- direct_link_speaker(&reader, (Speaker *)id);
- break;
case ID_SO:
direct_link_sound(&reader, (bSound *)id);
break;
@@ -6847,6 +6822,7 @@ static bool direct_link_id(FileData *fd, Main *main, const int tag, ID *id, ID *
case ID_CA:
case ID_WO:
case ID_MSK:
+ case ID_SPK:
/* Do nothing. Handled by IDTypeInfo callback. */
break;
}
@@ -7473,9 +7449,6 @@ static void lib_link_all(FileData *fd, Main *bmain)
case ID_LP:
lib_link_lightprobe(&reader, (LightProbe *)id);
break;
- case ID_SPK:
- lib_link_speaker(&reader, (Speaker *)id);
- break;
case ID_PA:
lib_link_particlesettings(&reader, (ParticleSettings *)id);
break;
@@ -7538,6 +7511,7 @@ static void lib_link_all(FileData *fd, Main *bmain)
case ID_CA:
case ID_WO:
case ID_MSK:
+ case ID_SPK:
/* Do nothing. Handled by IDTypeInfo callback. */
break;
}
@@ -8496,11 +8470,6 @@ static void expand_cachefile(BlendExpander *UNUSED(expander), CacheFile *UNUSED(
{
}
-static void expand_speaker(BlendExpander *expander, Speaker *spk)
-{
- BLO_expand(expander, spk->sound);
-}
-
static void expand_sound(BlendExpander *expander, bSound *snd)
{
BLO_expand(expander, snd->ipo); // XXX deprecated - old animation system
@@ -8510,7 +8479,6 @@ static void expand_lightprobe(BlendExpander *UNUSED(expander), LightProbe *UNUSE
{
}
-
static void expand_gpencil(BlendExpander *expander, bGPdata *gpd)
{
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
@@ -8612,9 +8580,6 @@ void BLO_expand_main(void *fdhandle, Main *mainvar)
case ID_KE:
expand_key(&expander, (Key *)id);
break;
- case ID_SPK:
- expand_speaker(&expander, (Speaker *)id);
- break;
case ID_SO:
expand_sound(&expander, (bSound *)id);
break;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index dff161172c7..9a423ab6906 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2187,19 +2187,6 @@ static void write_armature(BlendWriter *writer, bArmature *arm, const void *id_a
}
}
-static void write_speaker(BlendWriter *writer, Speaker *spk, const void *id_address)
-{
- if (spk->id.us > 0 || BLO_write_is_undo(writer)) {
- /* write LibData */
- BLO_write_id_struct(writer, Speaker, id_address, &spk->id);
- BKE_id_blend_write(writer, &spk->id);
-
- if (spk->adt) {
- BKE_animdata_blend_write(writer, spk->adt);
- }
- }
-}
-
static void write_sound(BlendWriter *writer, bSound *sound, const void *id_address)
{
if (sound->id.us > 0 || BLO_write_is_undo(writer)) {
@@ -2665,9 +2652,6 @@ static bool write_file_handle(Main *mainvar,
case ID_KE:
write_key(&writer, (Key *)id_buffer, id);
break;
- case ID_SPK:
- write_speaker(&writer, (Speaker *)id_buffer, id);
- break;
case ID_LP:
write_probe(&writer, (LightProbe *)id_buffer, id);
break;
@@ -2726,6 +2710,7 @@ static bool write_file_handle(Main *mainvar,
case ID_CA:
case ID_WO:
case ID_MSK:
+ case ID_SPK:
/* Do nothing, handled in IDTypeInfo callback. */
break;
case ID_LI: