X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fsubgame.h;h=8c21973eab3cdec319e28b6b236c9907c4a2f4e3;hb=b5f7249a7edc25077d84b27b38552228b92ff763;hp=2e16c2fec7f8357980cebdc74cfc78086d0a5328;hpb=084be3599a5ef0acba7c341bfd14a4e9801423a2;p=oweals%2Fminetest.git diff --git a/src/subgame.h b/src/subgame.h index 2e16c2fec..8c21973ea 100644 --- a/src/subgame.h +++ b/src/subgame.h @@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef SUBGAME_HEADER -#define SUBGAME_HEADER +#pragma once #include #include @@ -26,8 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc., class Settings; -#define WORLDNAME_BLACKLISTED_CHARS "/\\" - struct SubgameSpec { std::string id; // "" = game does not exist @@ -35,25 +32,19 @@ struct SubgameSpec std::string gamemods_path; //path to mods of the game std::set addon_mods_paths; //paths to addon mods for this game std::string name; - std::string menubackground_path; - std::string menuoverlay_path; std::string menuicon_path; - SubgameSpec(const std::string &id_="", - const std::string &path_="", - const std::string &gamemods_path_="", - const std::set &addon_mods_paths_=std::set(), - const std::string &name_="", - const std::string &menubackground_path_="", - const std::string &menuoverlay_path_="", - const std::string &menuicon_path_=""): + SubgameSpec(const std::string &id_ = "", + const std::string &path_ = "", + const std::string &gamemods_path_ = "", + const std::set &addon_mods_paths_ = std::set(), + const std::string &name_ = "", + const std::string &menuicon_path_ = ""): id(id_), path(path_), - gamemods_path(gamemods_path_), + gamemods_path(gamemods_path_), addon_mods_paths(addon_mods_paths_), name(name_), - menubackground_path(menubackground_path_), - menuoverlay_path(menuoverlay_path_), menuicon_path(menuicon_path_) {} @@ -104,8 +95,6 @@ struct WorldSpec std::vector getAvailableWorlds(); -// Create world directory and world.mt if they don't exist -bool initializeWorld(const std::string &path, const std::string &gameid); - -#endif - +// loads the subgame's config and creates world directory +// and world.mt if they don't exist +bool loadGameConfAndInitWorld(const std::string &path, const SubgameSpec &gamespec);