projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed bug with high scores for wrong level when auto-playing next level
[rocksndiamonds.git]
/
src
/
tape.c
diff --git
a/src/tape.c
b/src/tape.c
index fa73f3f99c64b43c55421faba707a68cdc5caa82..8e2f627da65b5b0c32b2b1127fe56bd9c592e157 100644
(file)
--- a/
src/tape.c
+++ b/
src/tape.c
@@
-38,8
+38,8
@@
/* forward declaration for internal use */
static void HandleTapeButtons(struct GadgetInfo *);
/* forward declaration for internal use */
static void HandleTapeButtons(struct GadgetInfo *);
-static void TapeStopWarpForward();
-static float GetTapeLengthSecondsFloat();
+static void TapeStopWarpForward(
void
);
+static float GetTapeLengthSecondsFloat(
void
);
static struct GadgetInfo *tape_gadget[NUM_TAPE_BUTTONS];
static struct GadgetInfo *tape_gadget[NUM_TAPE_BUTTONS];
@@
-349,17
+349,17
@@
void DrawVideoDisplay(unsigned int state, unsigned int value)
DrawVideoDisplay_DateTime(state, value);
}
DrawVideoDisplay_DateTime(state, value);
}
-void DrawVideoDisplayLabel(unsigned int state)
+
static
void DrawVideoDisplayLabel(unsigned int state)
{
DrawVideoDisplay(state, VIDEO_DISPLAY_LABEL_ONLY);
}
{
DrawVideoDisplay(state, VIDEO_DISPLAY_LABEL_ONLY);
}
-void DrawVideoDisplaySymbol(unsigned int state)
+
static
void DrawVideoDisplaySymbol(unsigned int state)
{
DrawVideoDisplay(state, VIDEO_DISPLAY_SYMBOL_ONLY);
}
{
DrawVideoDisplay(state, VIDEO_DISPLAY_SYMBOL_ONLY);
}
-
void DrawVideoDisplayCurrentState(
)
+
static void DrawVideoDisplayCurrentState(void
)
{
int state = 0;
{
int state = 0;
@@
-398,7
+398,7
@@
void DrawVideoDisplayCurrentState()
DrawVideoDisplaySymbol(state);
}
DrawVideoDisplaySymbol(state);
}
-void DrawCompleteVideoDisplay()
+void DrawCompleteVideoDisplay(
void
)
{
struct GraphicInfo *g_tape = &graphic_info[IMG_BACKGROUND_TAPE];
{
struct GraphicInfo *g_tape = &graphic_info[IMG_BACKGROUND_TAPE];
@@
-442,7
+442,7
@@
void DrawCompleteVideoDisplay()
0, 0);
}
0, 0);
}
-void TapeDeactivateDisplayOn()
+void TapeDeactivateDisplayOn(
void
)
{
SetDrawDeactivationMask(REDRAW_FIELD);
audio.sound_deactivated = TRUE;
{
SetDrawDeactivationMask(REDRAW_FIELD);
audio.sound_deactivated = TRUE;
@@
-465,7
+465,7
@@
void TapeDeactivateDisplayOff(boolean redraw_display)
/* tape logging functions */
/* ========================================================================= */
/* tape logging functions */
/* ========================================================================= */
-void PrintTapeReplayProgress(boolean replay_finished)
+
static
void PrintTapeReplayProgress(boolean replay_finished)
{
static unsigned int counter_last = -1;
unsigned int counter = Counter();
{
static unsigned int counter_last = -1;
unsigned int counter = Counter();
@@
-512,12
+512,12
@@
void TapeSetDateFromEpochSeconds(time_t epoch_seconds)
tape.date = 10000 * (lt->tm_year % 100) + 100 * lt->tm_mon + lt->tm_mday;
}
tape.date = 10000 * (lt->tm_year % 100) + 100 * lt->tm_mon + lt->tm_mday;
}
-void TapeSetDateFromNow()
+void TapeSetDateFromNow(
void
)
{
TapeSetDateFromEpochSeconds(time(NULL));
}
{
TapeSetDateFromEpochSeconds(time(NULL));
}
-void TapeErase()
+void TapeErase(
void
)
{
int i;
{
int i;
@@
-550,7
+550,7
@@
void TapeErase()
tape.use_mouse = (level.game_engine_type == GAME_ENGINE_TYPE_MM);
}
tape.use_mouse = (level.game_engine_type == GAME_ENGINE_TYPE_MM);
}
-static void TapeRewind()
+static void TapeRewind(
void
)
{
tape.counter = 0;
tape.delay_played = 0;
{
tape.counter = 0;
tape.delay_played = 0;
@@
-598,12
+598,12
@@
void TapeStartRecording(int random_seed)
audio.sound_deactivated = FALSE;
}
audio.sound_deactivated = FALSE;
}
-static void TapeStartGameRecording()
+static void TapeStartGameRecording(
void
)
{
{
- StartGameActions(
options.network
, TRUE, level.random_seed);
+ StartGameActions(
network.enabled
, TRUE, level.random_seed);
}
}
-static void TapeAppendRecording()
+static void TapeAppendRecording(
void
)
{
if (!tape.playing || !tape.pausing)
return;
{
if (!tape.playing || !tape.pausing)
return;
@@
-631,7
+631,7
@@
static void TapeAppendRecording()
UpdateAndDisplayGameControlValues();
}
UpdateAndDisplayGameControlValues();
}
-void TapeHaltRecording()
+void TapeHaltRecording(
void
)
{
tape.counter++;
{
tape.counter++;
@@
-644,7
+644,7
@@
void TapeHaltRecording()
tape.length_seconds = GetTapeLengthSeconds();
}
tape.length_seconds = GetTapeLengthSeconds();
}
-void TapeStopRecording()
+void TapeStopRecording(
void
)
{
if (tape.recording)
TapeHaltRecording();
{
if (tape.recording)
TapeHaltRecording();
@@
-771,7
+771,7
@@
void TapeTogglePause(boolean toggle_mode)
}
}
}
}
-void TapeStartPlaying()
+void TapeStartPlaying(
void
)
{
if (TAPE_IS_EMPTY(tape))
return;
{
if (TAPE_IS_EMPTY(tape))
return;
@@
-794,14
+794,14
@@
void TapeStartPlaying()
audio.sound_deactivated = FALSE;
}
audio.sound_deactivated = FALSE;
}
-static void TapeStartGamePlaying()
+static void TapeStartGamePlaying(
void
)
{
TapeStartPlaying();
InitGame();
}
{
TapeStartPlaying();
InitGame();
}
-void TapeStopPlaying()
+void TapeStopPlaying(
void
)
{
tape.playing = FALSE;
tape.pausing = FALSE;
{
tape.playing = FALSE;
tape.pausing = FALSE;
@@
-813,7
+813,7
@@
void TapeStopPlaying()
MapTapeEjectButton();
}
MapTapeEjectButton();
}
-byte *TapePlayAction()
+byte *TapePlayAction(
void
)
{
int update_delay = FRAMES_PER_SECOND / 2;
boolean update_video_display = (FrameCounter % update_delay == 0);
{
int update_delay = FRAMES_PER_SECOND / 2;
boolean update_video_display = (FrameCounter % update_delay == 0);
@@
-908,7
+908,7
@@
byte *TapePlayAction()
return action;
}
return action;
}
-void TapeStop()
+void TapeStop(
void
)
{
if (tape.pausing)
TapeTogglePause(TAPE_TOGGLE_MANUAL);
{
if (tape.pausing)
TapeTogglePause(TAPE_TOGGLE_MANUAL);
@@
-926,7
+926,7
@@
void TapeStop()
}
}
}
}
-unsigned int GetTapeLengthFrames()
+unsigned int GetTapeLengthFrames(
void
)
{
unsigned int tape_length_frames = 0;
int i;
{
unsigned int tape_length_frames = 0;
int i;
@@
-940,12
+940,12
@@
unsigned int GetTapeLengthFrames()
return tape_length_frames;
}
return tape_length_frames;
}
-unsigned int GetTapeLengthSeconds()
+unsigned int GetTapeLengthSeconds(
void
)
{
return (GetTapeLengthFrames() * GAME_FRAME_DELAY / 1000);
}
{
return (GetTapeLengthFrames() * GAME_FRAME_DELAY / 1000);
}
-static float GetTapeLengthSecondsFloat()
+static float GetTapeLengthSecondsFloat(
void
)
{
return ((float)GetTapeLengthFrames() * GAME_FRAME_DELAY / 1000);
}
{
return ((float)GetTapeLengthFrames() * GAME_FRAME_DELAY / 1000);
}
@@
-964,7
+964,7
@@
static void TapeStartWarpForward(int mode)
DrawVideoDisplayCurrentState();
}
DrawVideoDisplayCurrentState();
}
-static void TapeStopWarpForward()
+static void TapeStopWarpForward(
void
)
{
tape.fast_forward = FALSE;
tape.warp_forward = FALSE;
{
tape.fast_forward = FALSE;
tape.warp_forward = FALSE;
@@
-977,9
+977,9
@@
static void TapeStopWarpForward()
DrawVideoDisplayCurrentState();
}
DrawVideoDisplayCurrentState();
}
-static void TapeSingleStep()
+static void TapeSingleStep(
void
)
{
{
- if (
options.network
)
+ if (
network.enabled
)
return;
if (!tape.pausing)
return;
if (!tape.pausing)
@@
-990,7
+990,7
@@
static void TapeSingleStep()
DrawVideoDisplay(VIDEO_STATE_1STEP(tape.single_step), 0);
}
DrawVideoDisplay(VIDEO_STATE_1STEP(tape.single_step), 0);
}
-void TapeQuickSave()
+void TapeQuickSave(
void
)
{
if (game_status == GAME_MODE_MAIN)
{
{
if (game_status == GAME_MODE_MAIN)
{
@@
-1016,7
+1016,7
@@
void TapeQuickSave()
SaveEngineSnapshotSingle();
}
SaveEngineSnapshotSingle();
}
-void TapeQuickLoad()
+void TapeQuickLoad(
void
)
{
char *filename = getTapeFilename(level_nr);
{
char *filename = getTapeFilename(level_nr);
@@
-1079,12
+1079,18
@@
void TapeQuickLoad()
}
}
}
}
-boolean
InsertSolutionTape(
)
+boolean
hasSolutionTape(void
)
{
{
+ boolean tape_file_exists = fileExists(getSolutionTapeFilename(level_nr));
boolean level_has_tape = (level.game_engine_type == GAME_ENGINE_TYPE_SP &&
level.native_sp_level->demo.is_available);
boolean level_has_tape = (level.game_engine_type == GAME_ENGINE_TYPE_SP &&
level.native_sp_level->demo.is_available);
- if (!fileExists(getSolutionTapeFilename(level_nr)) && !level_has_tape)
+ return (tape_file_exists || level_has_tape);
+}
+
+boolean InsertSolutionTape(void)
+{
+ if (!hasSolutionTape())
{
Request("No solution tape for this level!", REQ_CONFIRM);
{
Request("No solution tape for this level!", REQ_CONFIRM);
@@
-1111,7
+1117,7
@@
boolean InsertSolutionTape()
return TRUE;
}
return TRUE;
}
-boolean PlaySolutionTape()
+boolean PlaySolutionTape(
void
)
{
if (!InsertSolutionTape())
return FALSE;
{
if (!InsertSolutionTape())
return FALSE;
@@
-1126,7
+1132,7
@@
boolean PlaySolutionTape()
* tape autoplay functions
* ------------------------------------------------------------------------- */
* tape autoplay functions
* ------------------------------------------------------------------------- */
-void AutoPlayTape()
+void AutoPlayTape(
void
)
{
static LevelDirTree *autoplay_leveldir = NULL;
static boolean autoplay_initialized = FALSE;
{
static LevelDirTree *autoplay_leveldir = NULL;
static boolean autoplay_initialized = FALSE;
@@
-1305,13
+1311,14
@@
static struct
}
};
}
};
-void CreateTapeButtons()
+void CreateTapeButtons(
void
)
{
int i;
for (i = 0; i < NUM_TAPE_BUTTONS; i++)
{
{
int i;
for (i = 0; i < NUM_TAPE_BUTTONS; i++)
{
- struct GraphicInfo *gfx = &graphic_info[tapebutton_info[i].graphic];
+ int graphic = tapebutton_info[i].graphic;
+ struct GraphicInfo *gfx = &graphic_info[graphic];
struct XY *pos = tapebutton_info[i].pos;
struct GadgetInfo *gi;
int gd_x = gfx->src_x;
struct XY *pos = tapebutton_info[i].pos;
struct GadgetInfo *gi;
int gd_x = gfx->src_x;
@@
-1321,6
+1328,7
@@
void CreateTapeButtons()
int id = i;
gi = CreateGadget(GDI_CUSTOM_ID, id,
int id = i;
gi = CreateGadget(GDI_CUSTOM_ID, id,
+ GDI_IMAGE_ID, graphic,
GDI_INFO_TEXT, tapebutton_info[i].infotext,
GDI_X, VX + pos->x,
GDI_Y, VY + pos->y,
GDI_INFO_TEXT, tapebutton_info[i].infotext,
GDI_X, VX + pos->x,
GDI_Y, VY + pos->y,
@@
-1342,7
+1350,7
@@
void CreateTapeButtons()
}
}
}
}
-void FreeTapeButtons()
+void FreeTapeButtons(
void
)
{
int i;
{
int i;
@@
-1350,19
+1358,19
@@
void FreeTapeButtons()
FreeGadget(tape_gadget[i]);
}
FreeGadget(tape_gadget[i]);
}
-void MapTapeEjectButton()
+void MapTapeEjectButton(
void
)
{
UnmapGadget(tape_gadget[TAPE_CTRL_ID_EXTRA]);
MapGadget(tape_gadget[TAPE_CTRL_ID_EJECT]);
}
{
UnmapGadget(tape_gadget[TAPE_CTRL_ID_EXTRA]);
MapGadget(tape_gadget[TAPE_CTRL_ID_EJECT]);
}
-void MapTapeWarpButton()
+void MapTapeWarpButton(
void
)
{
UnmapGadget(tape_gadget[TAPE_CTRL_ID_EJECT]);
MapGadget(tape_gadget[TAPE_CTRL_ID_EXTRA]);
}
{
UnmapGadget(tape_gadget[TAPE_CTRL_ID_EJECT]);
MapGadget(tape_gadget[TAPE_CTRL_ID_EXTRA]);
}
-void MapTapeButtons()
+void MapTapeButtons(
void
)
{
int i;
{
int i;
@@
-1377,7
+1385,7
@@
void MapTapeButtons()
MapGameButtonsOnTape();
}
MapGameButtonsOnTape();
}
-void UnmapTapeButtons()
+void UnmapTapeButtons(
void
)
{
int i;
{
int i;
@@
-1388,7
+1396,7
@@
void UnmapTapeButtons()
UnmapGameButtonsOnTape();
}
UnmapGameButtonsOnTape();
}
-void RedrawTapeButtons()
+void RedrawTapeButtons(
void
)
{
int i;
{
int i;
@@
-1402,7
+1410,7
@@
void RedrawTapeButtons()
redraw_mask &= ~REDRAW_ALL;
}
redraw_mask &= ~REDRAW_ALL;
}
-void RedrawOrRemapTapeButtons()
+void RedrawOrRemapTapeButtons(
void
)
{
if (tape_gadget[TAPE_CTRL_ID_PLAY]->mapped)
{
{
if (tape_gadget[TAPE_CTRL_ID_PLAY]->mapped)
{