From: Holger Schemel Date: Mon, 14 Dec 1998 22:24:14 +0000 (+0100) Subject: rnd-19981214-4 X-Git-Tag: 1.3.0^2~61 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=c795e57154a65ad24c99eff435a524a73f92e754 rnd-19981214-4 --- diff --git a/src/editor.c b/src/editor.c index bcecaa88..4b52fdb5 100644 --- a/src/editor.c +++ b/src/editor.c @@ -39,7 +39,7 @@ #define CHOICE_DELAY_VALUE 100 /* how many steps can be cancelled */ -#define NUM_UNDO_STEPS 10 +#define NUM_UNDO_STEPS (10 + 1) /* values for the control window */ #define ED_CTRL_BUTTONS_GFX_YPOS 236 @@ -553,6 +553,23 @@ void HandleLevelEditorControlButtons(struct GadgetInfo *gi) drawing_function = id; break; + case ED_CTRL_ID_UNDO: + if (undo_buffer_steps == 0) + { + Request("Undo buffer empty !", REQ_CONFIRM); + break; + } + + undo_buffer_position = + (undo_buffer_position - 1 + NUM_UNDO_STEPS) % NUM_UNDO_STEPS; + undo_buffer_steps--; + + for(x=0; x