projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20100309-1-src
[rocksndiamonds.git]
/
src
/
tape.c
diff --git
a/src/tape.c
b/src/tape.c
index a7bd35ee2f94196452216d1adcd08749b5119e5e..88f0f5a0300e4e0799ff9abf40cda0e138d3fd51 100644
(file)
--- a/
src/tape.c
+++ b/
src/tape.c
@@
-453,12
+453,16
@@
void TapeDeactivateDisplayOff(boolean redraw_display)
/* tape control functions */
/* ========================================================================= */
/* 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()
}
void TapeErase()
@@
-475,13
+479,13
@@
void TapeErase()
tape.pos[tape.counter].delay = 0;
tape.changed = TRUE;
tape.pos[tape.counter].delay = 0;
tape.changed = TRUE;
- tape.random_seed = InitRND(
NEW_RANDOMIZE
);
+ tape.random_seed = InitRND(
level.random_seed
);
tape.file_version = FILE_VERSION_ACTUAL;
tape.game_version = GAME_VERSION_ACTUAL;
tape.engine_version = level.game_version;
tape.file_version = FILE_VERSION_ACTUAL;
tape.game_version = GAME_VERSION_ACTUAL;
tape.engine_version = level.game_version;
- TapeSetDate();
+ TapeSetDate
FromNow
();
for (i = 0; i < MAX_PLAYERS; i++)
tape.player_participates[i] = FALSE;
for (i = 0; i < MAX_PLAYERS; i++)
tape.player_participates[i] = FALSE;
@@
-538,7
+542,7
@@
void TapeStartRecording(long random_seed)
static void TapeStartGameRecording()
{
static void TapeStartGameRecording()
{
- TapeStartRecording(
NEW_RANDOMIZE
);
+ TapeStartRecording(
level.random_seed
);
#if defined(NETWORK_AVALIABLE)
if (options.network)
#if defined(NETWORK_AVALIABLE)
if (options.network)
@@
-562,10
+566,14
@@
static void TapeAppendRecording()
tape.recording = TRUE;
tape.changed = TRUE;
tape.recording = TRUE;
tape.changed = TRUE;
- TapeSetDate();
+ TapeSetDate
FromNow
();
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_PLAY_OFF | VIDEO_STATE_REC_ON, 0);
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_PLAY_OFF | VIDEO_STATE_REC_ON, 0);
+
+#if 1
+ UpdateAndDisplayGameControlValues();
+#endif
}
void TapeHaltRecording()
}
void TapeHaltRecording()
@@
-919,11
+927,14
@@
void TapeQuickSave()
TapeHaltRecording(); /* prepare tape for saving on-the-fly */
if (TAPE_IS_EMPTY(tape))
TapeHaltRecording(); /* prepare tape for saving on-the-fly */
if (TAPE_IS_EMPTY(tape))
+ {
Request("No tape that can be saved !", REQ_CONFIRM);
Request("No tape that can be saved !", REQ_CONFIRM);
- else
- SaveTape(tape.level_nr);
- SaveEngineSnapshot();
+ return;
+ }
+
+ if (SaveTapeChecked(tape.level_nr))
+ SaveEngineSnapshot();
}
void TapeQuickLoad()
}
void TapeQuickLoad()
@@
-948,12
+959,14
@@
void TapeQuickLoad()
if (game_status != GAME_MODE_PLAYING && game_status != GAME_MODE_MAIN)
return;
if (game_status != GAME_MODE_PLAYING && game_status != GAME_MODE_MAIN)
return;
- if (
1 &&
CheckEngineSnapshot())
+ if (CheckEngineSnapshot())
{
TapeStartGamePlaying();
LoadEngineSnapshot();
{
TapeStartGamePlaying();
LoadEngineSnapshot();
+ DrawCompleteVideoDisplay();
+
tape.playing = TRUE;
tape.pausing = TRUE;
tape.playing = TRUE;
tape.pausing = TRUE;
@@
-1234,6
+1247,7
@@
void CreateTapeButtons()
GDI_STATE, GD_BUTTON_UNPRESSED,
GDI_DESIGN_UNPRESSED, gd_bitmap, gd_x1, gd_y,
GDI_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y,
GDI_STATE, GD_BUTTON_UNPRESSED,
GDI_DESIGN_UNPRESSED, gd_bitmap, gd_x1, gd_y,
GDI_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y,
+ GDI_DIRECT_DRAW, FALSE,
GDI_EVENT_MASK, GD_EVENT_RELEASED,
GDI_CALLBACK_ACTION, HandleTapeButtons,
GDI_END);
GDI_EVENT_MASK, GD_EVENT_RELEASED,
GDI_CALLBACK_ACTION, HandleTapeButtons,
GDI_END);
@@
-1296,18
+1310,22
@@
static void HandleTapeButtons(struct GadgetInfo *gi)
{
case TAPE_CTRL_ID_EJECT:
TapeStop();
{
case TAPE_CTRL_ID_EJECT:
TapeStop();
+
if (TAPE_IS_EMPTY(tape))
{
LoadTape(level_nr);
if (TAPE_IS_EMPTY(tape))
{
LoadTape(level_nr);
+
if (TAPE_IS_EMPTY(tape))
Request("No tape for this level !", REQ_CONFIRM);
}
else
{
if (tape.changed)
if (TAPE_IS_EMPTY(tape))
Request("No tape for this level !", REQ_CONFIRM);
}
else
{
if (tape.changed)
- SaveTape(tape.level_nr);
+ SaveTapeChecked(tape.level_nr);
+
TapeErase();
}
TapeErase();
}
+
DrawCompleteVideoDisplay();
break;
DrawCompleteVideoDisplay();
break;
@@
-1325,6
+1343,7
@@
static void HandleTapeButtons(struct GadgetInfo *gi)
}
else if (tape.recording)
TapeSingleStep();
}
else if (tape.recording)
TapeSingleStep();
+
break;
case TAPE_CTRL_ID_STOP:
break;
case TAPE_CTRL_ID_STOP: