X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ffiles.c;h=5c8b149d11b38db83fbac390b6c794ed393ada45;hb=be87135dee857f298379bf68ea26f9fec49890b8;hp=3564470c443802426c5ca3d943bffdfd5a328a22;hpb=0d2fcc38f14413196242563d64a2d2b52cf28d68;p=rocksndiamonds.git diff --git a/src/files.c b/src/files.c index 3564470c..5c8b149d 100644 --- a/src/files.c +++ b/src/files.c @@ -6566,6 +6566,13 @@ static void LoadLevel_InitSettings(struct LevelInfo *level) { // adjust level settings for (non-native) Sokoban-style levels LoadLevel_InitSettings_SB(level); + + // rename levels with title "nameless level" or if renaming is forced + if (leveldir_current->empty_level_name != NULL && + (strEqual(level->name, NAMELESS_LEVEL_NAME) || + leveldir_current->force_level_name)) + snprintf(level->name, MAX_LEVEL_NAME_LEN + 1, + leveldir_current->empty_level_name, level_nr); } static void LoadLevel_InitStandardElements(struct LevelInfo *level) @@ -7791,6 +7798,28 @@ void DumpLevel(struct LevelInfo *level) Print("use step counter: %s\n", (level->use_step_counter ? "yes" : "no")); Print("rate time over score: %s\n", (level->rate_time_over_score ? "yes" : "no")); + if (options.debug) + { + int i, j; + + for (i = 0; i < NUM_ENVELOPES; i++) + { + char *text = level->envelope[i].text; + int text_len = strlen(text); + boolean has_text = FALSE; + + for (j = 0; j < text_len; j++) + if (text[j] != ' ' && text[j] != '\n') + has_text = TRUE; + + if (has_text) + { + Print("\n"); + Print("Envelope %d:\n'%s'\n", i + 1, text); + } + } + } + PrintLine("-", 79); } @@ -8333,6 +8362,13 @@ void LoadScoreTape(char *score_tape_basename, int nr) LoadTapeFromFilename(filename); } +void LoadScoreCacheTape(char *score_tape_basename, int nr) +{ + char *filename = getScoreCacheTapeFilename(score_tape_basename, nr); + + LoadTapeFromFilename(filename); +} + static boolean checkSaveTape_SCRN(struct TapeInfo *tape) { // chunk required for team mode tapes with non-default screen size @@ -8675,6 +8711,13 @@ static void setScoreInfoToDefaultsExt(struct ScoreInfo *scores) scores->uploaded = FALSE; scores->tape_downloaded = FALSE; scores->force_last_added = FALSE; + + // The following values are intentionally not reset here: + // - last_level_nr + // - last_entry_nr + // - next_level_nr + // - continue_playing + // - continue_on_return } static void setScoreInfoToDefaults(void) @@ -9307,6 +9350,7 @@ void SaveServerScoreFromFile(int nr, boolean tape_saved, void LoadLocalAndServerScore(int nr, boolean download_score) { int last_added_local = scores.last_added_local; + boolean force_last_added = scores.force_last_added; // needed if only showing server scores setScoreInfoToDefaults(); @@ -9326,6 +9370,9 @@ void LoadLocalAndServerScore(int nr, boolean download_score) // merge local scores with scores from server MergeServerScore(); } + + if (force_last_added) + scores.force_last_added = force_last_added; } @@ -10819,6 +10866,12 @@ void LoadSetup_Default(void) // try to load setup values from default setup file filename = getDefaultSetupFilename(); + if (fileExists(filename)) + LoadSetupFromFilename(filename); + + // try to load setup values from platform setup file + filename = getPlatformSetupFilename(); + if (fileExists(filename)) LoadSetupFromFilename(filename);