}
else if (tape->file_version < FILE_VERSION_2_0)
{
+ /* convert pre-2.0 tapes to new tape format */
+
if (tape->pos[i].delay > 1)
{
/* action part */
return FALSE;
#else
if (!FrameReached(&player->move_delay, player->move_delay_value) &&
- !(tape.playing && tape.game_version < FILE_VERSION_2_0))
+ !(tape.playing && tape.game_version < GAME_VERSION_2_0))
return FALSE;
#endif
return MF_NO_ACTION;
#else
if (!FrameReached(&player->push_delay, player->push_delay_value) &&
- !(tape.playing && tape.game_version < FILE_VERSION_2_0) &&
+ !(tape.playing && tape.game_version < GAME_VERSION_2_0) &&
element != EL_SPRING)
return MF_NO_ACTION;
#endif
return MF_NO_ACTION;
#else
if (!FrameReached(&player->push_delay, player->push_delay_value) &&
- !(tape.playing && tape.game_version < FILE_VERSION_2_0) &&
+ !(tape.playing && tape.game_version < GAME_VERSION_2_0) &&
element != EL_BALLOON)
return MF_NO_ACTION;
#endif
#define NUM_TAPE_BUTTONS 6
+/* values for tape handling */
+#define TAPE_PAUSE_SECONDS_BEFORE_DEATH 5
+
/* forward declaration for internal use */
static void HandleTapeButtons(struct GadgetInfo *);
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, 0);
MapTapeIndexButton();
+
+ SetDrawDeactivationMask(REDRAW_NONE);
}
void TapeStopRecording()
SetDrawDeactivationMask(REDRAW_NONE);
RedrawPlayfield(TRUE, 0,0,0,0);
}
+
+ if (tape.index_search)
+ {
+ tape.index_search = FALSE;
+
+ SetDrawDeactivationMask(REDRAW_NONE);
+ RedrawPlayfield(TRUE, 0,0,0,0);
+ }
}
void TapeStartPlaying()
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, 0);
MapTapeIndexButton();
+
+ SetDrawDeactivationMask(REDRAW_NONE);
}
void TapeStopPlaying()
}
}
- if (tape.index_search)
+ if (tape.counter >= tape.length) /* end of tape reached */
{
- if (tape.counter >= tape.length)
- {
- tape.index_search = FALSE;
-
- SetDrawDeactivationMask(REDRAW_NONE);
- RedrawPlayfield(TRUE, 0,0,0,0);
-
+ if (tape.index_search)
TapeTogglePause();
- return NULL;
- }
- }
+ else
+ TapeStop();
- if (tape.counter >= tape.length)
- {
- TapeStop();
return NULL;
}
printf("Going to index mark ...\n");
tape.index_search = TRUE;
- SetDrawDeactivationMask(REDRAW_FIELD);
+
+ if (!tape.fast_forward || tape.pause_before_death)
+ SetDrawDeactivationMask(REDRAW_FIELD);
}
break;
{
if (tape.playing) /* PLAYING -> PAUSING -> RECORDING */
{
+ if (tape.game_version != GAME_VERSION_ACTUAL &&
+ !Request("This may break old version tape ! Append anyway ?",
+ REQ_ASK))
+ break;
+
tape.pos[tape.counter].delay = tape.delay_played;
tape.playing = FALSE;
tape.recording = TRUE;
#include "main.h"
-#define TAPE_PAUSE_SECONDS_BEFORE_DEATH 3
-
/* some positions in the video tape control window */
#define VIDEO_DISPLAY1_XPOS 5
#define VIDEO_DISPLAY1_YPOS 5
return 0;
}
+#define MAX_REQUEST_LINES 13
+#define MAX_REQUEST_LINE_LEN 7
+
boolean Request(char *text, unsigned int req_state)
{
int mx, my, ty, result = -1;
ClearRectangle(drawto, DX, DY, DXSIZE, DYSIZE);
/* write text for request */
- for(ty=0; ty<13; ty++)
+ for(ty=0; ty < MAX_REQUEST_LINES; ty++)
{
+ char text_line[MAX_REQUEST_LINE_LEN + 1];
int tx, tl, tc;
- char txt[256];
if (!*text)
break;
- for(tl=0,tx=0; tx<7; tl++,tx++)
+ for(tl=0,tx=0; tx < MAX_REQUEST_LINE_LEN; tl++,tx++)
{
tc = *(text + tx);
- if (!tc || tc == 32)
+ if (!tc || tc == ' ')
break;
}
+
if (!tl)
{
text++;
ty--;
continue;
}
- sprintf(txt, text);
- txt[tl] = 0;
- DrawTextExt(drawto, DX + 51 - (tl * 14)/2, DY + 8 + ty * 16,
- txt, FS_SMALL, FC_YELLOW);
- text += tl + (tc == 32 ? 1 : 0);
+
+ strncpy(text_line, text, tl);
+ text_line[tl] = 0;
+
+ DrawTextExt(drawto, DX + 50 - (tl * 14)/2, DY + 8 + ty * 16,
+ text_line, FS_SMALL, FC_YELLOW);
+
+ text += tl + (tc == ' ' ? 1 : 0);
}
if (req_state & REQ_ASK)