#define BUTTON_ELEMENT(button) ((button) == 1 ? new_element1 : \
(button) == 2 ? new_element2 : \
(button) == 3 ? new_element3 : EL_EMPTY)
-#define BUTTON_STEPSIZE(button) ((button) == 1 ? 1 : \
- (button) == 2 ? 5 : \
- (button) == 3 ? 10 : \
- (button))
/* forward declaration for internal use */
static void ModifyEditorCounterValue(int, int);
static boolean player_was_snapping = FALSE;
static boolean player_was_dropping = FALSE;
- if (!tape.recording)
- return;
-
if ((!player->is_moving && player_was_moving) ||
(player->MovPos == 0 && player_was_moving) ||
(player->is_snapping && !player_was_snapping) ||
LoadEngineSnapshotValues();
}
-void LoadEngineSnapshot_Undo()
+void LoadEngineSnapshot_Undo(int steps)
{
- LoadSnapshotFromList_Older();
+ LoadSnapshotFromList_Older(steps);
LoadEngineSnapshotValues();
}
-void LoadEngineSnapshot_Redo()
+void LoadEngineSnapshot_Redo(int steps)
{
- LoadSnapshotFromList_Newer();
+ LoadSnapshotFromList_Newer(steps);
LoadEngineSnapshotValues();
}
BackToFront();
}
-void GameUndo()
+void GameUndo(int steps)
{
if (!CheckEngineSnapshot())
return;
- LoadEngineSnapshot_Undo();
+ LoadEngineSnapshot_Undo(steps);
GameUndoRedoExt();
}
-void GameRedo()
+void GameRedo(int steps)
{
if (!CheckEngineSnapshot())
return;
- LoadEngineSnapshot_Redo();
+ LoadEngineSnapshot_Redo(steps);
GameUndoRedoExt();
}
-static void HandleGameButtonsExt(int id)
+static void HandleGameButtonsExt(int id, int button)
{
+ int steps = BUTTON_STEPSIZE(button);
boolean handle_game_buttons =
(game_status == GAME_MODE_PLAYING ||
(game_status == GAME_MODE_MAIN && tape.show_game_buttons));
break;
case GAME_CTRL_ID_UNDO:
- GameUndo();
+ GameUndo(steps);
break;
case GAME_CTRL_ID_REDO:
- GameRedo();
+ GameRedo(steps);
break;
case GAME_CTRL_ID_SAVE:
static void HandleGameButtons(struct GadgetInfo *gi)
{
- HandleGameButtonsExt(gi->custom_id);
+ HandleGameButtonsExt(gi->custom_id, gi->event.button);
}
void HandleSoundButtonKeys(Key key)
return FALSE;
}
-boolean LoadSnapshotFromList_Older()
+boolean LoadSnapshotFromList_Older(int steps)
{
if (snapshot_current->next)
{
- snapshot_current = snapshot_current->next;
+ while (snapshot_current->next && steps--)
+ snapshot_current = snapshot_current->next;
LoadSnapshotBuffers(snapshot_current->content);
return FALSE;
}
-boolean LoadSnapshotFromList_Newer()
+boolean LoadSnapshotFromList_Newer(int steps)
{
if (snapshot_current->prev)
{
- snapshot_current = snapshot_current->prev;
+ while (snapshot_current->prev && steps--)
+ snapshot_current = snapshot_current->prev;
LoadSnapshotBuffers(snapshot_current->content);