}
}
}
+
+static void UploadTapes(void)
+{
+ SetGameStatus(GAME_MODE_LOADING);
+
+ FadeSetEnterScreen();
+ FadeOut(REDRAW_ALL);
+
+ ClearRectangle(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE);
+
+ FadeIn(REDRAW_ALL);
+
+ DrawInitTextHead("Uploading tapes");
+
+ global.autoplay_mode = AUTOPLAY_MODE_UPLOAD;
+ global.autoplay_leveldir = "ALL";
+ global.autoplay_all = TRUE;
+
+ AutoPlayTapes();
+
+ global.autoplay_mode = AUTOPLAY_MODE_NONE;
+ global.autoplay_leveldir = NULL;
+ global.autoplay_all = FALSE;
+
+ SetGameStatus(GAME_MODE_MAIN);
+
+ DrawMainMenu();
+}
+
+void CheckUploadTapes(void)
+{
+ if (!setup.ask_for_uploading_tapes)
+ return;
+
+ if (directoryExists(getTapeDir(NULL)))
+ {
+ if (Request("Upload all your tapes to the high score server now?", REQ_ASK))
+ {
+ UploadTapes();
+
+ Request("All tapes uploaded!", REQ_CONFIRM);
+ }
+ else
+ {
+ Request("You can upload your tapes from the setup menu later!", REQ_CONFIRM);
+ }
+ }
+
+ setup.ask_for_uploading_tapes = FALSE;
+
+ SaveSetup();
+}
Print("Number of levels: %d\n", autoplay->leveldir->levels);
PrintLine("=", 79);
Print("\n");
+
+ DrawInitTextItem(autoplay->leveldir->name);
}
static void PrintTapeReplayProgress(boolean replay_finished)
// tape autoplay functions
// ----------------------------------------------------------------------------
+static TreeInfo *getNextValidAutoPlayEntry(TreeInfo *node)
+{
+ node = getNextValidTreeInfoEntry(node);
+
+ while (node && node->is_copy)
+ node = getNextValidTreeInfoEntry(node);
+
+ return node;
+}
+
+static TreeInfo *getFirstValidAutoPlayEntry(TreeInfo *node)
+{
+ node = getFirstValidTreeInfoEntry(node);
+
+ if (node && node->is_copy)
+ return getNextValidAutoPlayEntry(node);
+
+ return node;
+}
+
static void AutoPlayTapes_SetScoreEntry(int score, int time)
{
// set unique basename for score tape (for uploading to score server)
Fail("cannot upload score tape to score server");
}
+ UPDATE_BUSY_STATE();
+
Delay(20);
}
Fail("specify player name when uploading solution tapes");
}
- DrawCompleteVideoDisplay();
+ if (global.autoplay_mode != AUTOPLAY_MODE_UPLOAD)
+ DrawCompleteVideoDisplay();
- audio.sound_enabled = FALSE;
- setup.engine_snapshot_mode = getStringCopy(STR_SNAPSHOT_MODE_OFF);
+ if (program.headless)
+ {
+ audio.sound_enabled = FALSE;
+ setup.engine_snapshot_mode = getStringCopy(STR_SNAPSHOT_MODE_OFF);
+ }
if (strSuffix(global.autoplay_leveldir, ".tape"))
{
if (autoplay.all_levelsets)
{
// start auto-playing first level set
- autoplay.leveldir = getFirstValidTreeInfoEntry(leveldir_first);
+ autoplay.leveldir = getFirstValidAutoPlayEntry(leveldir_first);
}
else
{
if (global.autoplay_mode != AUTOPLAY_MODE_FIX || patch_nr == 0)
level_nr = autoplay.level_nr++;
+ UPDATE_BUSY_STATE();
+
// check if all tapes for this level set have been processed
if (level_nr > autoplay.leveldir->last_level)
{
break;
// continue with next level set
- autoplay.leveldir = getNextValidTreeInfoEntry(autoplay.leveldir);
+ autoplay.leveldir = getNextValidAutoPlayEntry(autoplay.leveldir);
// all level sets processed
if (autoplay.leveldir == NULL)
return;
}
- CloseAllAndExit(0);
+ if (program.headless)
+ CloseAllAndExit(0);
}
void AutoPlayTapes(void)