diff options
author | Bastien Montagne <bastien@blender.org> | 2021-01-06 20:06:11 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-01-06 20:07:09 +0300 |
commit | 3028de9527a0a7e2772fd87fcf1abbf823698371 (patch) | |
tree | ee0498f7c5109dfde30246675009984392f2ec33 /source/blender/editors | |
parent | 5cdf279ef46fa8672d086d1f57025e31f477accc (diff) |
UndoType: Refactor: replace `use_context` boolean by a bitflag.
We will soon need more options here, sinmpler and cleaner to use a
bitflag then.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/editarmature_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/curve/editcurve_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/curve/editfont_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/lattice/editlattice_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/metaball/editmball_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_edit_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_curve_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_undo.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_undo.c | 2 | ||||
-rw-r--r-- | source/blender/editors/undo/memfile_undo.c | 2 |
12 files changed, 15 insertions, 13 deletions
diff --git a/source/blender/editors/armature/editarmature_undo.c b/source/blender/editors/armature/editarmature_undo.c index d6b80909247..c6d7d2eb869 100644 --- a/source/blender/editors/armature/editarmature_undo.c +++ b/source/blender/editors/armature/editarmature_undo.c @@ -249,7 +249,7 @@ void ED_armature_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = armature_undosys_foreach_ID_ref; - ut->use_context_for_encode = true; + ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE; ut->step_size = sizeof(ArmatureUndoStep); } diff --git a/source/blender/editors/curve/editcurve_undo.c b/source/blender/editors/curve/editcurve_undo.c index 3fd3a348426..534d29c0cc7 100644 --- a/source/blender/editors/curve/editcurve_undo.c +++ b/source/blender/editors/curve/editcurve_undo.c @@ -309,7 +309,7 @@ void ED_curve_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = curve_undosys_foreach_ID_ref; - ut->use_context_for_encode = true; + ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE; ut->step_size = sizeof(CurveUndoStep); } diff --git a/source/blender/editors/curve/editfont_undo.c b/source/blender/editors/curve/editfont_undo.c index 895db2b4ad1..8559234b62f 100644 --- a/source/blender/editors/curve/editfont_undo.c +++ b/source/blender/editors/curve/editfont_undo.c @@ -398,7 +398,7 @@ void ED_font_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = font_undosys_foreach_ID_ref; - ut->use_context_for_encode = true; + ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE; ut->step_size = sizeof(FontUndoStep); } diff --git a/source/blender/editors/lattice/editlattice_undo.c b/source/blender/editors/lattice/editlattice_undo.c index 393b9858e1d..3a5734706f1 100644 --- a/source/blender/editors/lattice/editlattice_undo.c +++ b/source/blender/editors/lattice/editlattice_undo.c @@ -283,7 +283,7 @@ void ED_lattice_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = lattice_undosys_foreach_ID_ref; - ut->use_context_for_encode = true; + ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE; ut->step_size = sizeof(LatticeUndoStep); } diff --git a/source/blender/editors/mesh/editmesh_undo.c b/source/blender/editors/mesh/editmesh_undo.c index 38ff58fb965..1cbbbccdfa9 100644 --- a/source/blender/editors/mesh/editmesh_undo.c +++ b/source/blender/editors/mesh/editmesh_undo.c @@ -819,7 +819,7 @@ void ED_mesh_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = mesh_undosys_foreach_ID_ref; - ut->use_context_for_encode = true; + ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE; ut->step_size = sizeof(MeshUndoStep); } diff --git a/source/blender/editors/metaball/editmball_undo.c b/source/blender/editors/metaball/editmball_undo.c index 64443270c96..cbc60bcc031 100644 --- a/source/blender/editors/metaball/editmball_undo.c +++ b/source/blender/editors/metaball/editmball_undo.c @@ -258,7 +258,7 @@ void ED_mball_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = mball_undosys_foreach_ID_ref; - ut->use_context_for_encode = true; + ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE; ut->step_size = sizeof(MBallUndoStep); } diff --git a/source/blender/editors/physics/particle_edit_undo.c b/source/blender/editors/physics/particle_edit_undo.c index 5dbbf90639d..77b8d410d81 100644 --- a/source/blender/editors/physics/particle_edit_undo.c +++ b/source/blender/editors/physics/particle_edit_undo.c @@ -299,7 +299,7 @@ void ED_particle_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = particle_undosys_foreach_ID_ref; - ut->use_context_for_encode = true; + ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE; ut->step_size = sizeof(ParticleUndoStep); } diff --git a/source/blender/editors/sculpt_paint/paint_curve_undo.c b/source/blender/editors/sculpt_paint/paint_curve_undo.c index c78af7c38c6..0ffb392f826 100644 --- a/source/blender/editors/sculpt_paint/paint_curve_undo.c +++ b/source/blender/editors/sculpt_paint/paint_curve_undo.c @@ -159,7 +159,7 @@ void ED_paintcurve_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = paintcurve_undosys_foreach_ID_ref; - ut->use_context_for_encode = false; + ut->flags = 0; ut->step_size = sizeof(PaintCurveUndoStep); } diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 9f2a6e305d0..443aee81696 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -1576,7 +1576,7 @@ void ED_sculpt_undosys_type(UndoType *ut) ut->step_decode = sculpt_undosys_step_decode; ut->step_free = sculpt_undosys_step_free; - ut->use_context_for_encode = false; + ut->flags = 0; ut->step_size = sizeof(SculptUndoStep); } diff --git a/source/blender/editors/space_image/image_undo.c b/source/blender/editors/space_image/image_undo.c index 6cbebd2a959..1d5725033e0 100644 --- a/source/blender/editors/space_image/image_undo.c +++ b/source/blender/editors/space_image/image_undo.c @@ -997,8 +997,10 @@ void ED_image_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = image_undosys_foreach_ID_ref; /* NOTE this is actually a confusing case, since it expects a valid context, but only in a - * specific case, see `image_undosys_step_encode` code. */ - ut->use_context_for_encode = false; + * specific case, see `image_undosys_step_encode` code. We cannot specify + * `UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE` though, as it can be called with a NULL context by + * current code. */ + ut->flags = 0; ut->step_size = sizeof(ImageUndoStep); } diff --git a/source/blender/editors/space_text/text_undo.c b/source/blender/editors/space_text/text_undo.c index 8bc22833502..61b786b2b13 100644 --- a/source/blender/editors/space_text/text_undo.c +++ b/source/blender/editors/space_text/text_undo.c @@ -260,7 +260,7 @@ void ED_text_undosys_type(UndoType *ut) ut->step_foreach_ID_ref = text_undosys_foreach_ID_ref; - ut->use_context_for_encode = true; + ut->flags = UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE; ut->step_size = sizeof(TextUndoStep); } diff --git a/source/blender/editors/undo/memfile_undo.c b/source/blender/editors/undo/memfile_undo.c index 5f3381e3c9e..eea0f29d295 100644 --- a/source/blender/editors/undo/memfile_undo.c +++ b/source/blender/editors/undo/memfile_undo.c @@ -282,7 +282,7 @@ void ED_memfile_undosys_type(UndoType *ut) ut->step_decode = memfile_undosys_step_decode; ut->step_free = memfile_undosys_step_free; - ut->use_context_for_encode = false; + ut->flags = 0; ut->step_size = sizeof(MemFileUndoStep); } |