}
else if (strPrefix(command, "autotest ") ||
strPrefix(command, "autoplay ") ||
- strPrefix(command, "autoffwd "))
+ strPrefix(command, "autoffwd ") ||
+ strPrefix(command, "autowarp "))
{
char *str_ptr = getStringCopy(&command[9]); /* read command parameters */
- global.autoplay_mode = (strPrefix(command, "autotest") ? AUTOPLAY_TEST :
- strPrefix(command, "autoplay") ? AUTOPLAY_PLAY :
- strPrefix(command, "autoffwd") ? AUTOPLAY_FFWD : 0);
+ global.autoplay_mode =
+ (strPrefix(command, "autotest") ? AUTOPLAY_MODE_TEST :
+ strPrefix(command, "autoplay") ? AUTOPLAY_MODE_PLAY :
+ strPrefix(command, "autoffwd") ? AUTOPLAY_MODE_FFWD :
+ strPrefix(command, "autowarp") ? AUTOPLAY_MODE_WARP :
+ AUTOPLAY_MODE_NONE);
while (*str_ptr != '\0') /* continue parsing string */
{
LoadLevelSetup_SeriesInfo(); /* last played level info */
if (global.autoplay_leveldir &&
- global.autoplay_mode != AUTOPLAY_TEST)
+ global.autoplay_mode != AUTOPLAY_MODE_TEST)
{
leveldir_current = getTreeInfoFromIdentifier(leveldir_first,
global.autoplay_leveldir);
" \"autotest LEVELDIR [NR ...]\" test level tapes for LEVELDIR\n"
" \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n"
" \"autoffwd LEVELDIR [NR ...]\" ffwd level tapes for LEVELDIR\n"
+ " \"autowarp LEVELDIR [NR ...]\" warp level tapes for LEVELDIR\n"
" \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n"
" \"create images DIRECTORY\" write BMP images to DIRECTORY\n"
" \"create CE image DIRECTORY\" write BMP image to DIRECTORY\n"
#define NUM_ENGINE_TYPES 4
/* values for automatically playing tapes */
-#define AUTOPLAY_TEST 0
-#define AUTOPLAY_PLAY 1
-#define AUTOPLAY_FFWD 2
+#define AUTOPLAY_NONE 0
+#define AUTOPLAY_PLAY (1 << 0)
+#define AUTOPLAY_FFWD (1 << 1)
+#define AUTOPLAY_WARP (1 << 2)
+#define AUTOPLAY_TEST (1 << 3)
+#define AUTOPLAY_WARP_NO_DISPLAY AUTOPLAY_TEST
+
+#define AUTOPLAY_MODE_NONE 0
+#define AUTOPLAY_MODE_PLAY (AUTOPLAY_MODE_NONE | AUTOPLAY_PLAY)
+#define AUTOPLAY_MODE_FFWD (AUTOPLAY_MODE_PLAY | AUTOPLAY_FFWD)
+#define AUTOPLAY_MODE_WARP (AUTOPLAY_MODE_FFWD | AUTOPLAY_WARP)
+#define AUTOPLAY_MODE_TEST (AUTOPLAY_MODE_WARP | AUTOPLAY_TEST)
+#define AUTOPLAY_MODE_WARP_NO_DISPLAY AUTOPLAY_MODE_TEST
struct BorderInfo
return (GetTapeLengthFrames() * GAME_FRAME_DELAY / 1000);
}
-static void TapeStartWarpForward()
+static void TapeStartWarpForward(int mode)
{
- tape.fast_forward = TRUE;
- tape.warp_forward = TRUE;
- tape.deactivate_display = TRUE;
+ tape.fast_forward = (mode & AUTOPLAY_FFWD);
+ tape.warp_forward = (mode & AUTOPLAY_WARP);
+ tape.deactivate_display = (mode & AUTOPLAY_WARP_NO_DISPLAY);
tape.pausing = FALSE;
- TapeDeactivateDisplayOn();
+ if (tape.deactivate_display)
+ TapeDeactivateDisplayOn();
DrawVideoDisplayCurrentState();
}
if (!TAPE_IS_EMPTY(tape))
{
TapeStartGamePlaying();
- TapeStartWarpForward();
+ TapeStartWarpForward(AUTOPLAY_MODE_WARP_NO_DISPLAY);
tape.quick_resume = TRUE;
}
printf("playing tape ... ");
TapeStartGamePlaying();
-
- if (global.autoplay_mode == AUTOPLAY_FFWD)
- tape.fast_forward = TRUE;
-
- if (global.autoplay_mode != AUTOPLAY_PLAY)
- TapeStartWarpForward();
+ TapeStartWarpForward(global.autoplay_mode);
return;
}