projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added dedicated setter function for setting game status
[rocksndiamonds.git]
/
src
/
tape.c
diff --git
a/src/tape.c
b/src/tape.c
index 342f346df3703fabf00f668a17c19b528d67f162..07f8f82234b23f2a3008e2475ce03a49e058cb25 100644
(file)
--- a/
src/tape.c
+++ b/
src/tape.c
@@
-195,7
+195,7
@@
static void DrawVideoDisplay_Graphics(unsigned int state, unsigned int value)
static struct
{
int graphic;
static struct
{
int graphic;
- struct
Rect
*pos;
+ struct
XY
*pos;
}
video_pos[NUM_TAPE_FUNCTIONS][NUM_TAPE_FUNCTION_PARTS] =
{
}
video_pos[NUM_TAPE_FUNCTIONS][NUM_TAPE_FUNCTION_PARTS] =
{
@@
-253,7
+253,7
@@
static void DrawVideoDisplay_Graphics(unsigned int state, unsigned int value)
for (j = 0; j < NUM_TAPE_FUNCTION_PARTS; j++) /* label or symbol */
{
int graphic = video_pos[i][j].graphic;
for (j = 0; j < NUM_TAPE_FUNCTION_PARTS; j++) /* label or symbol */
{
int graphic = video_pos[i][j].graphic;
- struct
Rect
*pos = video_pos[i][j].pos;
+ struct
XY
*pos = video_pos[i][j].pos;
if (graphic == -1 ||
pos->x == -1 ||
if (graphic == -1 ||
pos->x == -1 ||
@@
-289,6
+289,8
@@
static void DrawVideoDisplay_Graphics(unsigned int state, unsigned int value)
if (gd_bitmap != NULL)
BlitBitmap(gd_bitmap, drawto, gd_x, gd_y, gfx->width, gfx->height,
VX + pos->x, VY + pos->y);
if (gd_bitmap != NULL)
BlitBitmap(gd_bitmap, drawto, gd_x, gd_y, gfx->width, gfx->height,
VX + pos->x, VY + pos->y);
+
+ redraw_mask |= REDRAW_DOOR_2;
}
}
}
}
}
}
@@
-431,8
+433,6
@@
void DrawVideoDisplay(unsigned int state, unsigned int value)
{
DrawVideoDisplay_Graphics(state, value);
DrawVideoDisplay_DateTime(state, value);
{
DrawVideoDisplay_Graphics(state, value);
DrawVideoDisplay_DateTime(state, value);
-
- redraw_mask |= REDRAW_DOOR_2;
}
void DrawCompleteVideoDisplay()
}
void DrawCompleteVideoDisplay()
@@
-493,7
+493,7
@@
void TapeDeactivateDisplayOff(boolean redraw_display)
if (redraw_display)
{
if (redraw_display)
{
- RedrawPlayfield(
TRUE, 0,0,0,0
);
+ RedrawPlayfield();
DrawGameDoorValues();
}
}
DrawGameDoorValues();
}
}
@@
-739,10
+739,23
@@
void TapeTogglePause(boolean toggle_manual)
TapeAppendRecording();
TapeAppendRecording();
- if (!CheckEngineSnapshot())
- SaveEngineSnapshot();
+ if (!CheckEngineSnapshotSingle())
+ SaveEngineSnapshotSingle();
+
+ // restart step/move snapshots after quick loading tape
+ SaveEngineSnapshotToListInitial();
}
}
}
}
+
+ if (setup.show_snapshot_buttons &&
+ game_status == GAME_MODE_PLAYING &&
+ CheckEngineSnapshotList())
+ {
+ if (tape.pausing)
+ MapUndoRedoButtons();
+ else if (!tape.single_step)
+ UnmapUndoRedoButtons();
+ }
}
void TapeStartPlaying()
}
void TapeStartPlaying()
@@
-1002,7
+1015,7
@@
void TapeQuickSave()
}
if (SaveTapeChecked(tape.level_nr))
}
if (SaveTapeChecked(tape.level_nr))
- SaveEngineSnapshot();
+ SaveEngineSnapshot
Single
();
}
void TapeQuickLoad()
}
void TapeQuickLoad()
@@
-1027,11
+1040,11
@@
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 (CheckEngineSnapshot())
+ if (CheckEngineSnapshot
Single
())
{
TapeStartGamePlaying();
{
TapeStartGamePlaying();
- LoadEngineSnapshot();
+ LoadEngineSnapshot
Single
();
DrawCompleteVideoDisplay();
DrawCompleteVideoDisplay();
@@
-1041,6
+1054,9
@@
void TapeQuickLoad()
TapeStopWarpForward();
TapeAppendRecording();
TapeStopWarpForward();
TapeAppendRecording();
+ // restart step/move snapshots after quick loading tape
+ SaveEngineSnapshotToListInitial();
+
if (FrameCounter > 0)
return;
}
if (FrameCounter > 0)
return;
}
@@
-1109,7
+1125,9
@@
void AutoPlayTape()
else
{
DrawCompleteVideoDisplay();
else
{
DrawCompleteVideoDisplay();
+
audio.sound_enabled = FALSE;
audio.sound_enabled = FALSE;
+ setup.engine_snapshot_mode = getStringCopy(STR_SNAPSHOT_MODE_OFF);
autoplay_leveldir = getTreeInfoFromIdentifier(leveldir_first,
global.autoplay_leveldir);
autoplay_leveldir = getTreeInfoFromIdentifier(leveldir_first,
global.autoplay_leveldir);
@@
-1181,7
+1199,12
@@
void AutoPlayTape()
printf("playing tape ... ");
TapeStartGamePlaying();
printf("playing tape ... ");
TapeStartGamePlaying();
- TapeStartWarpForward();
+
+ if (global.autoplay_mode == AUTOPLAY_FFWD)
+ tape.fast_forward = TRUE;
+
+ if (global.autoplay_mode != AUTOPLAY_PLAY)
+ TapeStartWarpForward();
return;
}
return;
}
@@
-1217,7
+1240,7
@@
void AutoPlayTape()
static struct
{
int graphic;
static struct
{
int graphic;
- struct
Rect
*pos;
+ struct
XY
*pos;
int gadget_id;
char *infotext;
} tapebutton_info[NUM_TAPE_BUTTONS] =
int gadget_id;
char *infotext;
} tapebutton_info[NUM_TAPE_BUTTONS] =
@@
-1256,7
+1279,7
@@
void CreateTapeButtons()
for (i = 0; i < NUM_TAPE_BUTTONS; i++)
{
struct GraphicInfo *gfx = &graphic_info[tapebutton_info[i].graphic];
for (i = 0; i < NUM_TAPE_BUTTONS; i++)
{
struct GraphicInfo *gfx = &graphic_info[tapebutton_info[i].graphic];
- struct
Rect
*pos = tapebutton_info[i].pos;
+ struct
XY
*pos = tapebutton_info[i].pos;
struct GadgetInfo *gi;
int gd_x = gfx->src_x;
int gd_y = gfx->src_y;
struct GadgetInfo *gi;
int gd_x = gfx->src_x;
int gd_y = gfx->src_y;
@@
-1398,6
+1421,13
@@
static void HandleTapeButtonsExt(int id)
break;
case TAPE_CTRL_ID_PLAY:
break;
case TAPE_CTRL_ID_PLAY:
+ if (tape.recording && tape.pausing) /* PAUSE -> RECORD */
+ {
+ // ("TAPE_IS_EMPTY(tape)" is TRUE here -- probably fix this)
+
+ TapeTogglePause(TAPE_TOGGLE_MANUAL);
+ }
+
if (TAPE_IS_EMPTY(tape))
break;
if (TAPE_IS_EMPTY(tape))
break;