diff options
author | Jacques Lucke <jacques@blender.org> | 2020-06-05 22:28:18 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-06-05 22:55:45 +0300 |
commit | f0047e6754de30b4c458c0cec476cfb2915d75fd (patch) | |
tree | 91f45bd17cc8698010b1371ccfb8692970f3a3a7 /source/blender | |
parent | 0f1361bbc3c5670934dfa49a1fab514ddc4cbce9 (diff) |
Refactor: use new api for write_movieclip and write_keyingsets
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index d4d97cab0bc..cca560f3890 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -892,22 +892,22 @@ static void write_action(BlendWriter *writer, bAction *act, const void *id_addre } } -static void write_keyingsets(WriteData *wd, ListBase *list) +static void write_keyingsets(BlendWriter *writer, ListBase *list) { KeyingSet *ks; KS_Path *ksp; for (ks = list->first; ks; ks = ks->next) { /* KeyingSet */ - writestruct(wd, DATA, KeyingSet, 1, ks); + BLO_write_struct(writer, KeyingSet, ks); /* Paths */ for (ksp = ks->paths.first; ksp; ksp = ksp->next) { /* Path */ - writestruct(wd, DATA, KS_Path, 1, ksp); + BLO_write_struct(writer, KS_Path, ksp); if (ksp->rna_path) { - writedata(wd, DATA, strlen(ksp->rna_path) + 1, ksp->rna_path); + BLO_write_string(writer, ksp->rna_path); } } } @@ -2622,7 +2622,7 @@ static void write_scene(BlendWriter *writer, Scene *sce, const void *id_address) if (sce->adt) { write_animdata(writer, sce->adt); } - write_keyingsets(writer->wd, &sce->keyingsets); + write_keyingsets(writer, &sce->keyingsets); /* direct data */ ToolSettings *tos = sce->toolsettings; @@ -3382,42 +3382,41 @@ static void write_paintcurve(BlendWriter *writer, PaintCurve *pc, const void *id } } -static void write_movieTracks(WriteData *wd, ListBase *tracks) +static void write_movieTracks(BlendWriter *writer, ListBase *tracks) { MovieTrackingTrack *track; track = tracks->first; while (track) { - writestruct(wd, DATA, MovieTrackingTrack, 1, track); + BLO_write_struct(writer, MovieTrackingTrack, track); if (track->markers) { - writestruct(wd, DATA, MovieTrackingMarker, track->markersnr, track->markers); + BLO_write_struct_array(writer, MovieTrackingMarker, track->markersnr, track->markers); } track = track->next; } } -static void write_moviePlaneTracks(WriteData *wd, ListBase *plane_tracks_base) +static void write_moviePlaneTracks(BlendWriter *writer, ListBase *plane_tracks_base) { MovieTrackingPlaneTrack *plane_track; for (plane_track = plane_tracks_base->first; plane_track; plane_track = plane_track->next) { - writestruct(wd, DATA, MovieTrackingPlaneTrack, 1, plane_track); + BLO_write_struct(writer, MovieTrackingPlaneTrack, plane_track); - writedata(wd, - DATA, - sizeof(MovieTrackingTrack *) * plane_track->point_tracksnr, - plane_track->point_tracks); - writestruct(wd, DATA, MovieTrackingPlaneMarker, plane_track->markersnr, plane_track->markers); + BLO_write_pointer_array(writer, plane_track->point_tracksnr, plane_track->point_tracks); + BLO_write_struct_array( + writer, MovieTrackingPlaneMarker, plane_track->markersnr, plane_track->markers); } } -static void write_movieReconstruction(WriteData *wd, MovieTrackingReconstruction *reconstruction) +static void write_movieReconstruction(BlendWriter *writer, + MovieTrackingReconstruction *reconstruction) { if (reconstruction->camnr) { - writestruct( - wd, DATA, MovieReconstructedCamera, reconstruction->camnr, reconstruction->cameras); + BLO_write_struct_array( + writer, MovieReconstructedCamera, reconstruction->camnr, reconstruction->cameras); } } @@ -3439,17 +3438,17 @@ static void write_movieclip(BlendWriter *writer, MovieClip *clip, const void *id write_animdata(writer, clip->adt); } - write_movieTracks(writer->wd, &tracking->tracks); - write_moviePlaneTracks(writer->wd, &tracking->plane_tracks); - write_movieReconstruction(writer->wd, &tracking->reconstruction); + write_movieTracks(writer, &tracking->tracks); + write_moviePlaneTracks(writer, &tracking->plane_tracks); + write_movieReconstruction(writer, &tracking->reconstruction); object = tracking->objects.first; while (object) { BLO_write_struct(writer, MovieTrackingObject, object); - write_movieTracks(writer->wd, &object->tracks); - write_moviePlaneTracks(writer->wd, &object->plane_tracks); - write_movieReconstruction(writer->wd, &object->reconstruction); + write_movieTracks(writer, &object->tracks); + write_moviePlaneTracks(writer, &object->plane_tracks); + write_movieReconstruction(writer, &object->reconstruction); object = object->next; } |