X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=7802e8e9a7da848e6abd41291bbbe3c0b61d66b2;hb=456850f38548906c013fb29dd03f2171021ee9ec;hp=528404b73f0581196b0e786a493357226862825c;hpb=d0eb0b41da335f373d6b21eda21a437e39241b87;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 528404b7..7802e8e9 100644 --- a/src/init.c +++ b/src/init.c @@ -4664,7 +4664,7 @@ void InitElementPropertiesEngine(int engine_version) i == EL_BLACK_ORB)); // ---------- COULD_MOVE_INTO_ACID ---------------------------------------- - SET_PROPERTY(i, EP_COULD_MOVE_INTO_ACID, (ELEM_IS_PLAYER(i) || + SET_PROPERTY(i, EP_COULD_MOVE_INTO_ACID, (IS_PLAYER_ELEMENT(i) || CAN_MOVE(i) || IS_CUSTOM_ELEMENT(i))); @@ -4906,6 +4906,7 @@ static void InitGlobal(void) global.dumplevel_leveldir = NULL; global.dumptape_leveldir = NULL; global.create_sketch_images_dir = NULL; + global.create_collect_images_dir = NULL; global.frames_per_second = 0; global.show_frames_per_second = FALSE; @@ -5067,15 +5068,20 @@ static void Execute_Command(char *command) strPrefix(command, "autoffwd ") || strPrefix(command, "autowarp ") || strPrefix(command, "autotest ") || + strPrefix(command, "autosave ") || + strPrefix(command, "autoupload ") || strPrefix(command, "autofix ")) { - char *str_ptr = getStringCopy(&command[8]); // read command parameters + char *arg_ptr = strchr(command, ' '); + char *str_ptr = getStringCopy(arg_ptr); // read command parameters global.autoplay_mode = (strPrefix(command, "autoplay") ? AUTOPLAY_MODE_PLAY : strPrefix(command, "autoffwd") ? AUTOPLAY_MODE_FFWD : strPrefix(command, "autowarp") ? AUTOPLAY_MODE_WARP : strPrefix(command, "autotest") ? AUTOPLAY_MODE_TEST : + strPrefix(command, "autosave") ? AUTOPLAY_MODE_SAVE : + strPrefix(command, "autoupload") ? AUTOPLAY_MODE_UPLOAD : strPrefix(command, "autofix") ? AUTOPLAY_MODE_FIX : AUTOPLAY_MODE_NONE); @@ -5197,6 +5203,14 @@ static void Execute_Command(char *command) Fail("image target directory '%s' not found or not writable", global.create_sketch_images_dir); } + else if (strPrefix(command, "create collect image ")) + { + global.create_collect_images_dir = getStringCopy(&command[21]); + + if (access(global.create_collect_images_dir, W_OK) != 0) + Fail("image target directory '%s' not found or not writable", + global.create_collect_images_dir); + } else if (strPrefix(command, "create CE image ")) { CreateCustomElementImages(&command[16]); @@ -5218,7 +5232,6 @@ static void InitSetup(void) LoadUserSetup(); // global user number LoadSetup(); // global setup info - LoadSetup_AutoSetup(); // global auto setup info // set some options from setup file @@ -5516,7 +5529,7 @@ static void InitGfx(void) DrawProgramInfo(); - DrawInitText("Loading graphics", 120, FC_GREEN); + DrawInitTextHead("Loading graphics"); // initialize settings for busy animation with default values int parameter[NUM_GFX_ARGS]; @@ -6182,6 +6195,9 @@ void OpenAll(void) InitGlobal(); // initialize some global variables + InitRND(NEW_RANDOMIZE); + InitSimpleRandom(NEW_RANDOMIZE); + print_timestamp_time("[init global stuff]"); InitSetup(); @@ -6217,9 +6233,6 @@ void OpenAll(void) InitMixer(); print_timestamp_time("[init setup/config stuff (6)]"); - InitRND(NEW_RANDOMIZE); - InitSimpleRandom(NEW_RANDOMIZE); - InitJoysticks(); print_timestamp_time("[init setup/config stuff]"); @@ -6299,6 +6312,11 @@ void OpenAll(void) CreateLevelSketchImages(); return; } + else if (global.create_collect_images_dir) + { + CreateCollectElementImages(); + return; + } InitNetworkServer(); @@ -6314,6 +6332,9 @@ void OpenAll(void) DrawMainMenu(); + // needed once to offer uploading score tapes after starting the program + CheckUploadTapes(); + #if 0 Debug("internal:path", "SDL_GetBasePath() == '%s'", SDL_GetBasePath());