/* tape control functions */
/* ========================================================================= */
-void TapeErase()
+static void TapeSetDate()
{
time_t epoch_seconds = time(NULL);
- struct tm *time = localtime(&epoch_seconds);
+ struct tm *now = localtime(&epoch_seconds);
+
+ tape.date = 10000 * (now->tm_year % 100) + 100 * now->tm_mon + now->tm_mday;
+}
+
+void TapeErase()
+{
int i;
tape.length = 0;
tape.pos[tape.counter].delay = 0;
tape.changed = TRUE;
- tape.date = 10000*(time->tm_year % 100) + 100*time->tm_mon + time->tm_mday;
tape.random_seed = InitRND(NEW_RANDOMIZE);
tape.file_version = FILE_VERSION_ACTUAL;
tape.game_version = GAME_VERSION_ACTUAL;
tape.engine_version = level.game_version;
+ TapeSetDate();
+
#if 0
printf("::: tape.engine_version = level.game_version = %d \n",
level.game_version);
{
TapeStartRecording();
-#if defined(PLATFORM_UNIX)
+#if defined(NETWORK_AVALIABLE)
if (options.network)
SendToServer_StartPlaying();
else
tape.recording = TRUE;
tape.changed = TRUE;
- DrawVideoDisplay(VIDEO_STATE_PLAY_OFF | VIDEO_STATE_REC_ON,0);
+ TapeSetDate();
+
+ DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
+ DrawVideoDisplay(VIDEO_STATE_PLAY_OFF | VIDEO_STATE_REC_ON, 0);
}
void TapeHaltRecording()
void TapeStopRecording()
{
+#if 0
if (!tape.recording)
return;
+#endif
TapeHaltRecording();
void TapeStopPlaying()
{
+#if 0
if (!tape.playing)
return;
+#endif
tape.playing = FALSE;
tape.pausing = FALSE;
DrawVideoDisplay(VIDEO_STATE_WARP2_ON, VIDEO_DISPLAY_SYMBOL_ONLY);
}
- if (TimePlayed > tape.length_seconds - TAPE_PAUSE_SECONDS_BEFORE_DEATH)
+ if (TapeTime > tape.length_seconds - TAPE_PAUSE_SECONDS_BEFORE_DEATH)
{
TapeTogglePause(TAPE_TOGGLE_MANUAL);
return NULL;
DrawVideoDisplay(VIDEO_STATE_WARP2_ON, VIDEO_DISPLAY_SYMBOL_ONLY);
}
}
+#if 0
+ /* !!! this makes things much slower !!! */
else if (tape.warp_forward)
{
if ((FrameCounter / 20) % 2)
DrawVideoDisplay(VIDEO_STATE_WARP_ON, VIDEO_DISPLAY_SYMBOL_ONLY);
}
+#endif
if (tape.counter >= tape.length) /* end of tape reached */
{
void TapeQuickLoad()
{
+ char *filename = getTapeFilename(level_nr);
+
+ if (!fileExists(filename))
+ {
+ Request("No tape for this level !", REQ_CONFIRM);
+
+ return;
+ }
+
+ if (tape.recording && !Request("Stop recording and load tape ?",
+ REQ_ASK | REQ_STAY_CLOSED))
+ {
+ OpenDoor(DOOR_OPEN_1 | DOOR_COPY_BACK);
+
+ return;
+ }
+
if (game_status == GAME_MODE_PLAYING || game_status == GAME_MODE_MAIN)
{
TapeStop();
tape.quick_resume = TRUE;
}
- else
- Request("No tape for this level !", REQ_CONFIRM);
+ else /* this should not happen (basically checked above) */
+ {
+ int reopen_door = (game_status == GAME_MODE_PLAYING ? REQ_REOPEN : 0);
+
+ Request("No tape for this level !", REQ_CONFIRM | reopen_door);
+ }
}
}
printf("LEVELDIR '%s', SOLVED %d/%d (%d%%)",
autoplay_leveldir->identifier, num_levels_solved, num_levels_played,
(num_levels_played ? num_levels_solved * 100 / num_levels_played :0));
+
if (num_levels_played != num_levels_solved)
{
printf(", FAILED:");
if (levels_failed[i])
printf(" %03d", i);
}
+
printf("\n");
printf_line("=", 79);
}
else /* AUTO PAUSE -> NORMAL PLAY */
{
+#if 1
+ if (tape.warp_forward)
+ TapeStopWarpForward();
+#else
+ tape.warp_forward = FALSE;
+#endif
tape.fast_forward = FALSE;
tape.pause_before_death = FALSE;
- tape.warp_forward = FALSE;
+
#if 1
DrawVideoDisplay(VIDEO_STATE_PBEND_OFF | VIDEO_STATE_PLAY_ON, 0);
#else