* finished configurability of tape date and time display positions
* fixed bug with game buttons in tape area not properly redrawn
* fixed small graphical bug with default tape time display position
+ * added optionally configurable game frame counter to tape display
2015-02-02
* fixed configurability of editor element palette (for columns != 4)
{ "tape.text.date_yyyy.valign", "top" },
{ "tape.text.date_yyyy.digits", "4" },
{ "tape.text.date_yyyy.font", "font.tape_recorder" },
- { "tape.text.date_yyyy.draw_masked", "true" },
+ { "tape.text.date_yyyy.draw_masked", "false" },
{ "tape.text.date_yy.x", "-1" },
{ "tape.text.date_yy.y", "-1" },
{ "tape.text.date_yy.align", "left" },
{ "tape.text.date_yy.valign", "top" },
{ "tape.text.date_yy.digits", "2" },
{ "tape.text.date_yy.font", "font.tape_recorder" },
- { "tape.text.date_yy.draw_masked", "true" },
+ { "tape.text.date_yy.draw_masked", "false" },
{ "tape.text.date_mon.x", "-1" },
{ "tape.text.date_mon.y", "-1" },
{ "tape.text.date_mon.align", "left" },
{ "tape.text.date_mon.valign", "top" },
{ "tape.text.date_mon.chars", "3" },
{ "tape.text.date_mon.font", "font.tape_recorder" },
- { "tape.text.date_mon.draw_masked", "true" },
+ { "tape.text.date_mon.draw_masked", "false" },
{ "tape.text.date_mm.x", "-1" },
{ "tape.text.date_mm.y", "-1" },
{ "tape.text.date_mm.align", "left" },
{ "tape.text.date_mm.valign", "top" },
{ "tape.text.date_mm.digits", "2" },
{ "tape.text.date_mm.font", "font.tape_recorder" },
- { "tape.text.date_mm.draw_masked", "true" },
+ { "tape.text.date_mm.draw_masked", "false" },
{ "tape.text.date_dd.x", "-1" },
{ "tape.text.date_dd.y", "-1" },
{ "tape.text.date_dd.align", "left" },
{ "tape.text.date_dd.valign", "top" },
{ "tape.text.date_dd.digits", "2" },
{ "tape.text.date_dd.font", "font.tape_recorder" },
- { "tape.text.date_dd.draw_masked", "true" },
+ { "tape.text.date_dd.draw_masked", "false" },
{ "tape.text.time.x", "44" },
{ "tape.text.time.y", "55" },
{ "tape.text.time_hh.valign", "top" },
{ "tape.text.time_hh.digits", "2" },
{ "tape.text.time_hh.font", "font.tape_recorder" },
- { "tape.text.time_hh.draw_masked", "true" },
+ { "tape.text.time_hh.draw_masked", "false" },
{ "tape.text.time_mm.x", "-1" },
{ "tape.text.time_mm.y", "-1" },
{ "tape.text.time_mm.align", "left" },
{ "tape.text.time_mm.valign", "top" },
{ "tape.text.time_mm.digits", "2" },
{ "tape.text.time_mm.font", "font.tape_recorder" },
- { "tape.text.time_mm.draw_masked", "true" },
+ { "tape.text.time_mm.draw_masked", "false" },
{ "tape.text.time_ss.x", "-1" },
{ "tape.text.time_ss.y", "-1" },
{ "tape.text.time_ss.align", "left" },
{ "tape.text.time_ss.valign", "top" },
{ "tape.text.time_ss.digits", "2" },
{ "tape.text.time_ss.font", "font.tape_recorder" },
- { "tape.text.time_ss.draw_masked", "true" },
+ { "tape.text.time_ss.draw_masked", "false" },
+
+ { "tape.text.frame.x", "-1" },
+ { "tape.text.frame.y", "-1" },
+ { "tape.text.frame.align", "left" },
+ { "tape.text.frame.valign", "top" },
+ { "tape.text.frame.digits", "-1" },
+ { "tape.text.frame.font", "font.tape_recorder" },
+ { "tape.text.frame.draw_masked", "false" },
{ "tape.show_game_buttons", "false" },
"tape.text.time_ss.draw_masked",
&tape.text.time_ss.draw_masked
},
+ {
+ "tape.text.frame.x",
+ &tape.text.frame.x
+ },
+ {
+ "tape.text.frame.y",
+ &tape.text.frame.y
+ },
+ {
+ "tape.text.frame.align",
+ &tape.text.frame.align
+ },
+ {
+ "tape.text.frame.valign",
+ &tape.text.frame.valign
+ },
+ {
+ "tape.text.frame.digits",
+ &tape.text.frame.size
+ },
+ {
+ "tape.text.frame.font",
+ &tape.text.frame.font
+ },
+ {
+ "tape.text.frame.draw_masked",
+ &tape.text.frame.draw_masked
+ },
{
"tape.show_game_buttons",
&tape.show_game_buttons
tape.pos[i].delay = demo_repeat + 1;
}
- tape.length_seconds = GetTapeLength();
+ tape.length_frames = GetTapeLengthFrames();
+ tape.length_seconds = GetTapeLengthSeconds();
}
if (tape.no_valid_file)
return;
- tape.length_seconds = GetTapeLength();
+ tape.length_frames = GetTapeLengthFrames();
+ tape.length_seconds = GetTapeLengthSeconds();
}
void LoadTapeFromFilename(char *filename)
closeFile(file);
- tape.length_seconds = GetTapeLength();
+ tape.length_frames = GetTapeLengthFrames();
+ tape.length_seconds = GetTapeLengthSeconds();
#if 0
printf("::: tape file version: %d\n", tape.file_version);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, TapeTime);
}
+ if (tape.recording || tape.playing)
+ DrawVideoDisplay(VIDEO_STATE_FRAME_ON, FrameCounter);
+
UpdateAndDisplayGameControlValues();
}
#define PG_Y2(y) (DOOR_GFX_PAGEY2 + (y))
#define VIDEO_INFO_OFF (VIDEO_STATE_DATE_OFF | \
- VIDEO_STATE_TIME_OFF)
+ VIDEO_STATE_TIME_OFF | \
+ VIDEO_STATE_FRAME_OFF)
#define VIDEO_STATE_OFF (VIDEO_STATE_PLAY_OFF | \
VIDEO_STATE_REC_OFF | \
VIDEO_STATE_PAUSE_OFF | \
VIDEO_PRESS_OFF)
#define VIDEO_INFO_ON (VIDEO_STATE_DATE_ON | \
- VIDEO_STATE_TIME_ON)
+ VIDEO_STATE_TIME_ON | \
+ VIDEO_STATE_FRAME_ON)
#define VIDEO_STATE_ON (VIDEO_STATE_PLAY_ON | \
VIDEO_STATE_REC_ON | \
VIDEO_STATE_PAUSE_ON | \
#define VIDEO_PRESS (VIDEO_PRESS_ON | VIDEO_PRESS_OFF)
#define VIDEO_ALL (VIDEO_ALL_ON | VIDEO_ALL_OFF)
-#define NUM_TAPE_FUNCTIONS 10
+#define NUM_TAPE_FUNCTIONS 11
#define NUM_TAPE_FUNCTION_PARTS 2
#define NUM_TAPE_FUNCTION_STATES 2
{ IMG_TAPE_LABEL_GFX_TIME, &tape.label.time },
{ -1, NULL },
},
+ {
+ /* (no label for displaying optional frame) */
+ { -1, NULL },
+ { -1, NULL },
+ },
{
{ IMG_TAPE_LABEL_GFX_FAST_FORWARD, &tape.label.fast_forward },
{ IMG_TAPE_SYMBOL_GFX_FAST_FORWARD, &tape.symbol.fast_forward },
{
for (j = 0; j < NUM_TAPE_FUNCTION_PARTS; j++) /* label or symbol */
{
- if (video_pos[i][j].graphic == -1 ||
- video_pos[i][j].pos->x < 0 ||
- video_pos[i][j].pos->y < 0)
+ int graphic = video_pos[i][j].graphic;
+ struct Rect *pos = video_pos[i][j].pos;
+
+ if (graphic == -1 ||
+ pos->x == -1 ||
+ pos->y == -1)
continue;
if (state & (1 << (i * 2 + k)))
{
struct GraphicInfo *gfx_bg = &graphic_info[IMG_BACKGROUND_TAPE];
- struct GraphicInfo *gfx = &graphic_info[video_pos[i][j].graphic];
- struct Rect *pos = video_pos[i][j].pos;
+ struct GraphicInfo *gfx = &graphic_info[graphic];
Bitmap *gd_bitmap;
int gd_x, gd_y;
int skip_value =
#define DATETIME_TIME_MM (1 << 7)
#define DATETIME_TIME_SS (1 << 8)
-#define DATETIME_XOFFSET_1 (1 << 9)
-#define DATETIME_XOFFSET_2 (1 << 10)
+#define DATETIME_FRAME (1 << 9)
+
+#define DATETIME_XOFFSET_1 (1 << 10)
+#define DATETIME_XOFFSET_2 (1 << 11)
#define DATETIME_DATE (DATETIME_DATE_YYYY | \
DATETIME_DATE_YY | \
{ &tape.text.time_mm, DATETIME_TIME_MM },
{ &tape.text.time_ss, DATETIME_TIME_SS },
+ { &tape.text.frame, DATETIME_FRAME },
+
{ NULL, DATETIME_NONE },
};
DrawText(xpos, ypos, s, pos->font);
}
+ else if ((type & DATETIME_FRAME) && (state & VIDEO_STATE_FRAME_ON))
+ {
+ DrawText(xpos, ypos, int2str(value, pos->size), pos->font);
+ }
}
}
DrawVideoDisplay(VIDEO_STATE_REC_ON, 0);
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, tape.length_seconds);
+ DrawVideoDisplay(VIDEO_STATE_FRAME_ON, tape.length_frames);
if (tape.pausing)
DrawVideoDisplay(VIDEO_STATE_PAUSE_ON, 0);
DrawVideoDisplay(VIDEO_STATE_PLAY_ON, 0);
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, 0);
+ DrawVideoDisplay(VIDEO_STATE_FRAME_ON, 0);
if (tape.pausing)
DrawVideoDisplay(VIDEO_STATE_PAUSE_ON, 0);
{
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, tape.length_seconds);
+ DrawVideoDisplay(VIDEO_STATE_FRAME_ON, tape.length_frames);
}
BlitBitmap(drawto, bitmap_db_door_2, gfx.vx, gfx.vy, gfx.vxsize, gfx.vysize,
tape.counter = 0;
tape.length = 0;
+ tape.length_frames = 0;
tape.length_seconds = 0;
if (leveldir_current)
DrawVideoDisplay(VIDEO_STATE_REC_ON, 0);
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, 0);
+ DrawVideoDisplay(VIDEO_STATE_FRAME_ON, 0);
MapTapeWarpButton();
tape.pos[tape.counter].delay = 0;
tape.length = tape.counter;
- tape.length_seconds = GetTapeLength();
+ tape.length_frames = GetTapeLengthFrames();
+ tape.length_seconds = GetTapeLengthSeconds();
}
void TapeStopRecording()
DrawVideoDisplay(VIDEO_STATE_PLAY_ON, 0);
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, 0);
+ DrawVideoDisplay(VIDEO_STATE_FRAME_ON, 0);
MapTapeWarpButton();
{
DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date);
DrawVideoDisplay(VIDEO_STATE_TIME_ON, tape.length_seconds);
+ DrawVideoDisplay(VIDEO_STATE_FRAME_ON, tape.length_frames);
}
}
-unsigned int GetTapeLength()
+unsigned int GetTapeLengthFrames()
{
- unsigned int tape_length = 0;
+ unsigned int tape_length_frames = 0;
int i;
if (TAPE_IS_EMPTY(tape))
return(0);
for (i = 0; i < tape.length; i++)
- tape_length += tape.pos[i].delay;
+ tape_length_frames += tape.pos[i].delay;
- return(tape_length * GAME_FRAME_DELAY / 1000);
+ return tape_length_frames;
+}
+
+unsigned int GetTapeLengthSeconds()
+{
+ return (GetTapeLengthFrames() * GAME_FRAME_DELAY / 1000);
}
static void TapeStartWarpForward()
#define VIDEO_STATE_TIME_OFF (1 << 8)
#define VIDEO_STATE_TIME_ON (1 << 9)
#define VIDEO_STATE_TIME (VIDEO_STATE_TIME_OFF | VIDEO_STATE_TIME_ON)
+#define VIDEO_STATE_FRAME_OFF (1 << 10)
+#define VIDEO_STATE_FRAME_ON (1 << 11)
+#define VIDEO_STATE_FRAME (VIDEO_STATE_FRAME_OFF | VIDEO_STATE_FRAME_ON)
-#define VIDEO_STATE_FFWD_OFF (1 << 10)
-#define VIDEO_STATE_FFWD_ON (1 << 11)
+#define VIDEO_STATE_FFWD_OFF (1 << 12)
+#define VIDEO_STATE_FFWD_ON (1 << 13)
#define VIDEO_STATE_FFWD (VIDEO_STATE_FFWD_OFF | VIDEO_STATE_FFWD_ON)
-#define VIDEO_STATE_PBEND_OFF (1 << 12)
-#define VIDEO_STATE_PBEND_ON (1 << 13)
+#define VIDEO_STATE_PBEND_OFF (1 << 14)
+#define VIDEO_STATE_PBEND_ON (1 << 15)
#define VIDEO_STATE_PBEND (VIDEO_STATE_PBEND_OFF | VIDEO_STATE_PBEND_ON)
-#define VIDEO_STATE_WARP_OFF (1 << 14)
-#define VIDEO_STATE_WARP_ON (1 << 15)
+#define VIDEO_STATE_WARP_OFF (1 << 16)
+#define VIDEO_STATE_WARP_ON (1 << 17)
#define VIDEO_STATE_WARP (VIDEO_STATE_WARP_OFF | VIDEO_STATE_WARP_ON)
-#define VIDEO_STATE_WARP2_OFF (1 << 16)
-#define VIDEO_STATE_WARP2_ON (1 << 17)
+#define VIDEO_STATE_WARP2_OFF (1 << 18)
+#define VIDEO_STATE_WARP2_ON (1 << 19)
#define VIDEO_STATE_WARP2 (VIDEO_STATE_WARP_OFF | VIDEO_STATE_WARP_ON)
-#define VIDEO_STATE_1STEP_OFF (1 << 18)
-#define VIDEO_STATE_1STEP_ON (1 << 19)
+#define VIDEO_STATE_1STEP_OFF (1 << 20)
+#define VIDEO_STATE_1STEP_ON (1 << 21)
#define VIDEO_STATE_1STEP (VIDEO_STATE_1STEP_OFF | VIDEO_STATE_1STEP_ON)
-#define VIDEO_PRESS_PLAY_ON (1 << 20)
-#define VIDEO_PRESS_PLAY_OFF (1 << 21)
+#define VIDEO_PRESS_PLAY_ON (1 << 22)
+#define VIDEO_PRESS_PLAY_OFF (1 << 23)
#define VIDEO_PRESS_PLAY (VIDEO_PRESS_PLAY_OFF | VIDEO_PRESS_PLAY_ON)
-#define VIDEO_PRESS_REC_ON (1 << 22)
-#define VIDEO_PRESS_REC_OFF (1 << 23)
+#define VIDEO_PRESS_REC_ON (1 << 24)
+#define VIDEO_PRESS_REC_OFF (1 << 25)
#define VIDEO_PRESS_REC (VIDEO_PRESS_REC_OFF | VIDEO_PRESS_REC_ON)
-#define VIDEO_PRESS_PAUSE_ON (1 << 24)
-#define VIDEO_PRESS_PAUSE_OFF (1 << 25)
+#define VIDEO_PRESS_PAUSE_ON (1 << 26)
+#define VIDEO_PRESS_PAUSE_OFF (1 << 27)
#define VIDEO_PRESS_PAUSE (VIDEO_PRESS_PAUSE_OFF | VIDEO_PRESS_PAUSE_ON)
-#define VIDEO_PRESS_STOP_ON (1 << 26)
-#define VIDEO_PRESS_STOP_OFF (1 << 27)
+#define VIDEO_PRESS_STOP_ON (1 << 28)
+#define VIDEO_PRESS_STOP_OFF (1 << 29)
#define VIDEO_PRESS_STOP (VIDEO_PRESS_STOP_OFF | VIDEO_PRESS_STOP_ON)
-#define VIDEO_PRESS_EJECT_ON (1 << 28)
-#define VIDEO_PRESS_EJECT_OFF (1 << 29)
+#define VIDEO_PRESS_EJECT_ON (1 << 30)
+#define VIDEO_PRESS_EJECT_OFF (1 << 31)
#define VIDEO_PRESS_EJECT (VIDEO_PRESS_EJECT_OFF | VIDEO_PRESS_EJECT_ON)
/* tags to draw video display labels or symbols only */
struct TextPosInfo time_hh;
struct TextPosInfo time_mm;
struct TextPosInfo time_ss;
+
+ struct TextPosInfo frame;
};
struct TapeInfo
unsigned int date;
unsigned int counter;
unsigned int length;
+ unsigned int length_frames;
unsigned int length_seconds;
unsigned int delay_played;
boolean pause_before_death;
byte *TapePlayAction(void);
void TapeStop(void);
void TapeErase(void);
-unsigned int GetTapeLength(void);
+unsigned int GetTapeLengthFrames(void);
+unsigned int GetTapeLengthSeconds(void);
void TapeQuickSave(void);
void TapeQuickLoad(void);
void InsertSolutionTape(void);