X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ffiles.c;h=12813f59a4aa88ade989bae047640df2a40dcc2b;hb=22d6bccc33b6a7ddd0961be470d72800f171579c;hp=258d73da62d1a16c1f48aade53f5167c9b789ff4;hpb=4bc7734b858d687cea4c0bf86ee42e442d0c0817;p=rocksndiamonds.git diff --git a/src/files.c b/src/files.c index 258d73da..12813f59 100644 --- a/src/files.c +++ b/src/files.c @@ -5721,6 +5721,9 @@ static void LoadLevelFromFileStream_DC(File *file, struct LevelInfo *level, level->score[SC_SHIELD] = 0; level->extra_time_score = 0; + // set time for normal and deadly shields to the same value + level->shield_deadly_time = level->shield_normal_time; + // Diamond Caves has the same (strange) behaviour as Emerald Mine that gems // can slip down from flat walls, like normal walls and steel walls level->em_slippery_gems = TRUE; @@ -9150,6 +9153,14 @@ static struct TokenInfo debug_setup_tokens[] = TYPE_BOOLEAN, &setup.debug.show_frames_per_second, "debug.show_frames_per_second" }, + { + TYPE_SWITCH3, + &setup.debug.xsn_mode, "debug.xsn_mode" + }, + { + TYPE_INTEGER, + &setup.debug.xsn_percent, "debug.xsn_percent" + }, }; static struct TokenInfo options_setup_tokens[] = @@ -9423,11 +9434,16 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->debug.show_frames_per_second = FALSE; + si->debug.xsn_mode = AUTO; + si->debug.xsn_percent = 0; + si->options.verbose = FALSE; #if defined(PLATFORM_ANDROID) si->fullscreen = TRUE; #endif + + setHideSetupEntry(&setup.debug.xsn_mode); } static void setSetupInfoToDefaults_AutoSetup(struct SetupInfo *si) @@ -9474,10 +9490,21 @@ void setHideSetupEntry(void *setup_value) { char *hide_setup_token = getHideSetupToken(setup_value); + if (hide_setup_hash == NULL) + hide_setup_hash = newSetupFileHash(); + if (setup_value != NULL) setHashEntry(hide_setup_hash, hide_setup_token, ""); } +void removeHideSetupEntry(void *setup_value) +{ + char *hide_setup_token = getHideSetupToken(setup_value); + + if (setup_value != NULL) + removeHashEntry(hide_setup_hash, hide_setup_token); +} + boolean hideSetupEntry(void *setup_value) { char *hide_setup_token = getHideSetupToken(setup_value); @@ -9516,9 +9543,6 @@ static void decodeSetupFileHash(SetupFileHash *setup_file_hash) if (!setup_file_hash) return; - if (hide_setup_hash == NULL) - hide_setup_hash = newSetupFileHash(); - for (i = 0; i < ARRAY_SIZE(global_setup_tokens); i++) setSetupInfoFromTokenInfo(setup_file_hash, global_setup_tokens, i); @@ -9860,7 +9884,9 @@ void SaveSetup(void) fprintf(file, "\n"); for (i = 0; i < ARRAY_SIZE(debug_setup_tokens); i++) - fprintf(file, "%s\n", getSetupLine(debug_setup_tokens, "", i)); + if (!strPrefix(debug_setup_tokens[i].text, "debug.xsn_") || + setup.debug.xsn_mode != AUTO) + fprintf(file, "%s\n", getSetupLine(debug_setup_tokens, "", i)); fprintf(file, "\n"); for (i = 0; i < ARRAY_SIZE(options_setup_tokens); i++)