X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftape.c;h=fb705a9f9204bfea3fa3aaed7a6b27b5c9428cdf;hb=1442f47fb19411923cba74dd8a7c17fef1fe5e0d;hp=f39c09ec7fff453a585f929008695f5936cf844b;hpb=78dc584e5e2a4afa8b5e5858a356f46a3880aee0;p=rocksndiamonds.git diff --git a/src/tape.c b/src/tape.c index f39c09ec..fb705a9f 100644 --- a/src/tape.c +++ b/src/tape.c @@ -654,10 +654,16 @@ void TapeDeactivateDisplayOff(boolean redraw_display) /* 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; @@ -670,13 +676,14 @@ void TapeErase() 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); @@ -727,7 +734,7 @@ static void TapeStartGameRecording() { TapeStartRecording(); -#if defined(PLATFORM_UNIX) +#if defined(NETWORK_AVALIABLE) if (options.network) SendToServer_StartPlaying(); else @@ -749,7 +756,10 @@ static void TapeAppendRecording() 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() @@ -952,7 +962,7 @@ byte *TapePlayAction() 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; @@ -1142,6 +1152,17 @@ void TapeQuickSave() void TapeQuickLoad() { + if (tape.recording && !Request("Stop recording and load tape ?", + REQ_ASK | REQ_STAY_CLOSED)) + { + BlitBitmap(bitmap_db_door, bitmap_db_door, + DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, + DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1); + OpenDoor(DOOR_OPEN_1); + + return; + } + if (game_status == GAME_MODE_PLAYING || game_status == GAME_MODE_MAIN) { TapeStop(); @@ -1537,9 +1558,15 @@ static void HandleTapeButtons(struct GadgetInfo *gi) } 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