Undo: support implicit-sharing in memfile undo step #106903
|
@ -1623,7 +1623,7 @@ void CurvesGeometry::blend_read(BlendDataReader &reader)
|
|||
|
||||
if (this->curve_offsets) {
|
||||
this->runtime->curve_offsets_sharing_info = BLO_read_shared(
|
||||
&reader, (void **)&this->curve_offsets, [&]() {
|
||||
&reader, &this->curve_offsets, [&]() {
|
||||
BLO_read_int32_array(&reader, this->curve_num + 1, &this->curve_offsets);
|
||||
return implicit_sharing::info_for_mem_free(this->curve_offsets);
|
||||
});
|
||||
|
|
|
@ -398,7 +398,7 @@ static void mesh_blend_read_data(BlendDataReader *reader, ID *id)
|
|||
|
||||
if (mesh->poly_offset_indices) {
|
||||
mesh->runtime->poly_offsets_sharing_info = BLO_read_shared(
|
||||
reader, (void **)&mesh->poly_offset_indices, [&]() {
|
||||
reader, &mesh->poly_offset_indices, [&]() {
|
||||
BLO_read_int32_array(reader, mesh->totpoly + 1, &mesh->poly_offset_indices);
|
||||
return blender::implicit_sharing::info_for_mem_free(mesh->poly_offset_indices);
|
||||
});
|
||||
|
|
|
@ -268,10 +268,12 @@ void BLO_read_pointer_array(BlendDataReader *reader, void **ptr_p);
|
|||
/* Misc. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
const blender::ImplicitSharingInfo *BLO_read_shared(
|
||||
const blender::ImplicitSharingInfo *BLO_read_shared_impl(
|
||||
BlendDataReader *reader,
|
||||
void **data_ptr,
|
||||
blender::FunctionRef<const blender::ImplicitSharingInfo *()> read_cb);
|
||||
# define BLO_read_shared(reader, ptr_p, read_cb) \
|
||||
BLO_read_shared_impl(reader, (void **)ptr_p, read_cb)
|
||||
#endif
|
||||
|
||||
int BLO_read_fileversion_get(BlendDataReader *reader);
|
||||
|
|
|
@ -5133,7 +5133,7 @@ void BLO_read_pointer_array(BlendDataReader *reader, void **ptr_p)
|
|||
*ptr_p = final_array;
|
||||
}
|
||||
|
||||
const blender::ImplicitSharingInfo *BLO_read_shared(
|
||||
const blender::ImplicitSharingInfo *BLO_read_shared_impl(
|
||||
BlendDataReader *reader,
|
||||
void **data_ptr,
|
||||
blender::FunctionRef<const blender::ImplicitSharingInfo *()> read_cb)
|
||||
|
|
Loading…
Reference in New Issue