X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=d206859a5f6b0f962faf723a636cc8ed20c3d885;hb=7eb9afbda870a52bfef66b5d1750696a6add61c4;hp=629133e8e61451eecb2b347069aff99590931d57;hpb=cccf7a885aab5d50f050fead64cc56e1edfab5d6;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 629133e8..d206859a 100644 --- a/src/init.c +++ b/src/init.c @@ -151,7 +151,7 @@ void InitGadgets() gadgets_initialized = TRUE; } -inline void InitElementSmallImagesScaledUp(int graphic) +inline static void InitElementSmallImagesScaledUp(int graphic) { struct GraphicInfo *g = &graphic_info[graphic]; @@ -4678,10 +4678,16 @@ void Execute_Command(char *command) exit(0); } - else if (strPrefix(command, "autoplay ")) + else if (strPrefix(command, "autotest ") || + strPrefix(command, "autoplay ") || + strPrefix(command, "autoffwd ")) { 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); + while (*str_ptr != '\0') /* continue parsing string */ { /* cut leading whitespace from string, replace it by string terminator */ @@ -5217,6 +5223,15 @@ static void InitLevelInfo() LoadLevelInfo(); /* global level info */ LoadLevelSetup_LastSeries(); /* last played series info */ LoadLevelSetup_SeriesInfo(); /* last played level info */ + + if (global.autoplay_leveldir && + global.autoplay_mode != AUTOPLAY_TEST) + { + leveldir_current = getTreeInfoFromIdentifier(leveldir_first, + global.autoplay_leveldir); + if (leveldir_current == NULL) + leveldir_current = getFirstValidTreeInfoEntry(leveldir_first); + } } static void InitLevelArtworkInfo()