SNAPSHOT_MODE_EVERY_MOVE :
strEqual(setup.engine_snapshot_mode, STR_SNAPSHOT_MODE_EVERY_COLLECT) ?
SNAPSHOT_MODE_EVERY_COLLECT : SNAPSHOT_MODE_OFF);
+ game.snapshot.save_snapshot = FALSE;
}
int get_num_special_action(int element, int action_first, int action_last)
(player->is_snapping && !player->was_snapping) ||
(player->is_dropping && !player->was_dropping))
{
- if (!SaveEngineSnapshotToList())
+ if (!CheckSaveEngineSnapshotToList())
return;
player->was_moving = FALSE;
InitGame();
}
-void GameActions()
+void GameActionsExt()
{
#if 0
static unsigned int game_frame_delay = 0;
}
}
+static void GameActions_CheckSaveEngineSnapshot()
+{
+ if (!game.snapshot.save_snapshot)
+ return;
+
+ // clear flag for saving snapshot _before_ saving snapshot
+ game.snapshot.save_snapshot = FALSE;
+
+ SaveEngineSnapshotToList();
+}
+
+void GameActions()
+{
+ GameActionsExt();
+
+ GameActions_CheckSaveEngineSnapshot();
+}
+
void GameActions_EM_Main()
{
byte effective_action[MAX_PLAYERS];
snapshot_level_nr = level_nr;
}
-static boolean SaveEngineSnapshotToListExt(boolean initial_snapshot)
+boolean CheckSaveEngineSnapshotToList()
{
boolean save_snapshot =
- (initial_snapshot ||
- (game.snapshot.mode == SNAPSHOT_MODE_EVERY_STEP) ||
+ ((game.snapshot.mode == SNAPSHOT_MODE_EVERY_STEP) ||
(game.snapshot.mode == SNAPSHOT_MODE_EVERY_MOVE &&
game.snapshot.changed_action) ||
(game.snapshot.mode == SNAPSHOT_MODE_EVERY_COLLECT &&
game.snapshot.changed_action = FALSE;
game.snapshot.collected_item = FALSE;
+ game.snapshot.save_snapshot = save_snapshot;
+
+ return save_snapshot;
+}
+void SaveEngineSnapshotToList()
+{
if (game.snapshot.mode == SNAPSHOT_MODE_OFF ||
- tape.quick_resume ||
- !save_snapshot)
- return FALSE;
+ tape.quick_resume)
+ return;
ListNode *buffers = SaveEngineSnapshotBuffers();
/* finally save all snapshot buffers to snapshot list */
SaveSnapshotToList(buffers);
-
- return TRUE;
-}
-
-boolean SaveEngineSnapshotToList()
-{
- return SaveEngineSnapshotToListExt(FALSE);
}
void SaveEngineSnapshotToListInitial()
{
FreeEngineSnapshotList();
- SaveEngineSnapshotToListExt(TRUE);
+ SaveEngineSnapshotToList();
}
void LoadEngineSnapshotValues()
byte last_action[MAX_PLAYERS];
boolean changed_action;
boolean collected_item;
+
+ boolean save_snapshot;
};
struct GameInfo
void FreeEngineSnapshotList();
void LoadEngineSnapshotSingle();
void SaveEngineSnapshotSingle();
-boolean SaveEngineSnapshotToList();
+boolean CheckSaveEngineSnapshotToList();
+void SaveEngineSnapshotToList();
void SaveEngineSnapshotToListInitial();
boolean CheckEngineSnapshotSingle();
boolean CheckEngineSnapshotList();
{
if (!local_player->was_waiting)
{
- if (!SaveEngineSnapshotToList())
+ if (!CheckSaveEngineSnapshotToList())
return;
local_player->was_waiting = TRUE;
{
if (!local_player->was_waiting)
{
- if (!SaveEngineSnapshotToList())
+ if (!CheckSaveEngineSnapshotToList())
return;
local_player->was_waiting = TRUE;