diff --git a/similar/main/mission.cpp b/similar/main/mission.cpp index 4b0e8e542..cb6a0f8ee 100644 --- a/similar/main/mission.cpp +++ b/similar/main/mission.cpp @@ -266,6 +266,28 @@ static void allocate_levels(const unsigned count_regular_level, const unsigned c } } +static void allocate_shareware_levels(const unsigned count_regular_level, const unsigned count_secret_level) +{ + Briefing_text_filename = BIMD1_BRIEFING_FILE; + Ending_text_filename = BIMD1_ENDING_FILE_SHARE; + allocate_levels(count_regular_level, count_secret_level); + //build level names + for (const auto &&[idx, name] : enumerate(unchecked_partial_range(Level_names.get(), count_regular_level), 1u)) + snprintf(&name[0u], name.size(), "level%02u.sdl", idx); +} + +static void build_rdl_regular_level_names(const unsigned count_regular_level, std::unique_ptr &names) +{ + for (auto &&[idx, name] : enumerate(unchecked_partial_range(names.get(), count_regular_level), 1u)) + snprintf(&name[0u], name.size(), "level%02u.rdl", idx); +} + +static void build_rdl_secret_level_names(const unsigned count_secret_level, std::unique_ptr &names) +{ + for (auto &&[idx, name] : enumerate(unchecked_partial_range(names.get(), count_secret_level), 1u)) + snprintf(&name[0u], name.size(), "levels%1u.rdl", idx); +} + // // Special versions of mission routines for d1 builtins // @@ -276,20 +298,10 @@ static void load_mission_d1() { case D1_SHAREWARE_MISSION_HOGSIZE: case D1_SHAREWARE_10_MISSION_HOGSIZE: - allocate_levels(7, 0); - //build level names - for (int i=0;i