diff options
Diffstat (limited to 'source/blender/editors/undo')
-rw-r--r-- | source/blender/editors/undo/ed_undo.c | 11 | ||||
-rw-r--r-- | source/blender/editors/undo/memfile_undo.c | 14 |
2 files changed, 7 insertions, 18 deletions
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c index 0771d0254e8..baa178a6a94 100644 --- a/source/blender/editors/undo/ed_undo.c +++ b/source/blender/editors/undo/ed_undo.c @@ -70,15 +70,6 @@ /** We only need this locally. */ static CLG_LogRef LOG = {"ed.undo"}; -/** - * \warning Values are used in #ED_undo_gpencil_step, - * which should eventually be replaced with the undo-system. - */ -enum eUndoStepDir { - STEP_REDO = 1, - STEP_UNDO = -1, -}; - /* -------------------------------------------------------------------- */ /** \name Generic Undo System Access * @@ -276,7 +267,7 @@ static int ed_undo_step_direction(bContext *C, enum eUndoStepDir step, ReportLis * FIXME: However, it seems to never be used in current code (`ED_gpencil_session_active` seems * to always return false). */ if (ED_gpencil_session_active()) { - return ED_undo_gpencil_step(C, (int)step); + return ED_undo_gpencil_step(C, step); } wmWindowManager *wm = CTX_wm_manager(C); diff --git a/source/blender/editors/undo/memfile_undo.c b/source/blender/editors/undo/memfile_undo.c index eea0f29d295..51859b6a555 100644 --- a/source/blender/editors/undo/memfile_undo.c +++ b/source/blender/editors/undo/memfile_undo.c @@ -145,19 +145,18 @@ static int memfile_undosys_step_id_reused_cb(LibraryIDLinkCallbackData *cb_data) static void memfile_undosys_step_decode(struct bContext *C, struct Main *bmain, UndoStep *us_p, - int undo_direction, + const eUndoStepDir undo_direction, bool UNUSED(is_final)) { - BLI_assert(undo_direction != 0); + BLI_assert(undo_direction != STEP_INVALID); bool use_old_bmain_data = true; if (USER_EXPERIMENTAL_TEST(&U, use_undo_legacy)) { use_old_bmain_data = false; } - else if (undo_direction > 0) { - /* Redo case. - * The only time we should have to force a complete redo is when current step is tagged as a + else if (undo_direction == STEP_REDO) { + /* The only time we should have to force a complete redo is when current step is tagged as a * redo barrier. * If previous step was not a memfile one should not matter here, current data in old bmain * should still always be valid for unchanged data-blocks. */ @@ -165,9 +164,8 @@ static void memfile_undosys_step_decode(struct bContext *C, use_old_bmain_data = false; } } - else { - /* Undo case. - * Here we do not care whether current step is an undo barrier, since we are coming from + else if (undo_direction == STEP_UNDO) { + /* Here we do not care whether current step is an undo barrier, since we are coming from * 'the future' we can still re-use old data. However, if *next* undo step * (i.e. the one immediately in the future, the one we are coming from) * is a barrier, then we have to force a complete undo. |