diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-31 03:34:57 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-31 04:07:13 +0300 |
commit | 51bba03b319319d59f739673c3fafb71bc308e0d (patch) | |
tree | 239eaf352608f35d924061002d4fcb8adb4f3749 /source/blender/editors/sculpt_paint | |
parent | d16e4d077dfe4ac887b51075784170911d3adca5 (diff) |
Undo System: add Main argument to encode/decode
Needed since we don't always have the context,
and avoids adding G_MAIN into undo callbacks.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_curve_undo.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_undo.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_curve_undo.c b/source/blender/editors/sculpt_paint/paint_curve_undo.c index 59f424a9f31..9e116a5a3aa 100644 --- a/source/blender/editors/sculpt_paint/paint_curve_undo.c +++ b/source/blender/editors/sculpt_paint/paint_curve_undo.c @@ -98,7 +98,7 @@ static void paintcurve_undosys_step_encode_init(struct bContext *C, UndoStep *us UNUSED_VARS(C, us_p); } -static bool paintcurve_undosys_step_encode(struct bContext *C, UndoStep *us_p) +static bool paintcurve_undosys_step_encode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p) { Paint *p = BKE_paint_get_active_from_context(C); PaintCurve *pc = p ? (p->brush ? p->brush->paint_curve : NULL) : NULL; @@ -115,7 +115,7 @@ static bool paintcurve_undosys_step_encode(struct bContext *C, UndoStep *us_p) return true; } -static void paintcurve_undosys_step_decode(struct bContext *UNUSED(C), UndoStep *us_p, int UNUSED(dir)) +static void paintcurve_undosys_step_decode(struct bContext *UNUSED(C), struct Main *UNUSED(bmain), UndoStep *us_p, int UNUSED(dir)) { PaintCurveUndoStep *us = (PaintCurveUndoStep *)us_p; undocurve_to_paintcurve(&us->data, us->pc); diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/sculpt_paint/paint_image_undo.c index 7a4641008a4..b049e613b86 100644 --- a/source/blender/editors/sculpt_paint/paint_image_undo.c +++ b/source/blender/editors/sculpt_paint/paint_image_undo.c @@ -436,7 +436,7 @@ static void image_undosys_step_encode_init(struct bContext *UNUSED(C), UndoStep BLI_listbase_clear(&us->tiles); } -static bool image_undosys_step_encode(struct bContext *UNUSED(C), UndoStep *us_p) +static bool image_undosys_step_encode(struct bContext *UNUSED(C), struct Main *UNUSED(bmain), UndoStep *us_p) { /* dummy, encoding is done along the way by adding tiles * to the current 'ImageUndoStep' added by encode_init. */ @@ -466,7 +466,7 @@ static bool image_undosys_step_encode(struct bContext *UNUSED(C), UndoStep *us_p return true; } -static void image_undosys_step_decode(struct bContext *UNUSED(C), UndoStep *us_p, int UNUSED(dir)) +static void image_undosys_step_decode(struct bContext *UNUSED(C), struct Main *UNUSED(bmain), UndoStep *us_p, int UNUSED(dir)) { ImageUndoStep *us = (ImageUndoStep *)us_p; #if 0 diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 0355f8e933b..8b8493aa415 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -1049,7 +1049,7 @@ static void sculpt_undosys_step_encode_init(struct bContext *UNUSED(C), UndoStep BLI_listbase_clear(&us->data.nodes); } -static bool sculpt_undosys_step_encode(struct bContext *UNUSED(C), UndoStep *us_p) +static bool sculpt_undosys_step_encode(struct bContext *UNUSED(C), struct Main *UNUSED(bmain), UndoStep *us_p) { /* dummy, encoding is done along the way by adding tiles * to the current 'SculptUndoStep' added by encode_init. */ @@ -1063,7 +1063,7 @@ static bool sculpt_undosys_step_encode(struct bContext *UNUSED(C), UndoStep *us_ return true; } -static void sculpt_undosys_step_decode(struct bContext *C, UndoStep *us_p, int UNUSED(dir)) +static void sculpt_undosys_step_decode(struct bContext *C, struct Main *UNUSED(bmain), UndoStep *us_p, int UNUSED(dir)) { /* TODO(campbell): undo_system: use low-level API to set mode. */ ED_object_mode_set(C, OB_MODE_SCULPT); |