X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Ftape.c;h=88f0f5a0300e4e0799ff9abf40cda0e138d3fd51;hp=49f06aa32272c5f77c13e0de6584d78411a23561;hb=4a8368abd71c718621838773eed914b5bbd4e1d8;hpb=9991027ba0e61f105a15d517461614fce184ba48 diff --git a/src/tape.c b/src/tape.c index 49f06aa3..88f0f5a0 100644 --- a/src/tape.c +++ b/src/tape.c @@ -453,12 +453,16 @@ void TapeDeactivateDisplayOff(boolean redraw_display) /* tape control functions */ /* ========================================================================= */ -static void TapeSetDate() +void TapeSetDateFromEpochSeconds(time_t epoch_seconds) { - time_t epoch_seconds = time(NULL); - struct tm *now = localtime(&epoch_seconds); + struct tm *lt = localtime(&epoch_seconds); - tape.date = 10000 * (now->tm_year % 100) + 100 * now->tm_mon + now->tm_mday; + tape.date = 10000 * (lt->tm_year % 100) + 100 * lt->tm_mon + lt->tm_mday; +} + +void TapeSetDateFromNow() +{ + TapeSetDateFromEpochSeconds(time(NULL)); } void TapeErase() @@ -481,7 +485,7 @@ void TapeErase() tape.game_version = GAME_VERSION_ACTUAL; tape.engine_version = level.game_version; - TapeSetDate(); + TapeSetDateFromNow(); for (i = 0; i < MAX_PLAYERS; i++) tape.player_participates[i] = FALSE; @@ -562,7 +566,7 @@ static void TapeAppendRecording() tape.recording = TRUE; tape.changed = TRUE; - TapeSetDate(); + TapeSetDateFromNow(); DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date); DrawVideoDisplay(VIDEO_STATE_PLAY_OFF | VIDEO_STATE_REC_ON, 0);