From 94cf74afbb1329a9ff099e2ebd7f43ed8313f9ec Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 4 Feb 2021 22:03:39 +0100 Subject: Cleanup/refactor: Undosys: Get rid of the magic values for undo direction. Move `eUndoStepDir` to `BKE_undo_system.h` and use its values everywhere. Note that this also introduce the `STEP_INVALID` value in that enum. Finally, kept the matching struct members in some lower-level readfile code as an `int` to avoid having to include `BKE_undo_system.h` in a lot of unrelated files. --- source/blender/blenkernel/intern/blendfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/blendfile.c') diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index 49475c014cd..32710c4fa60 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -57,6 +57,7 @@ #include "BKE_scene.h" #include "BKE_screen.h" #include "BKE_studiolight.h" +#include "BKE_undo_system.h" #include "BKE_workspace.h" #include "BLO_readfile.h" @@ -148,7 +149,7 @@ static void setup_app_data(bContext *C, LOAD_UNDO, } mode; - if (params->undo_direction != 0) { + if (params->undo_direction != STEP_INVALID) { BLI_assert(bfd->curscene != NULL); mode = LOAD_UNDO; } -- cgit v1.2.3