mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Move some more sources to shared target
This commit is contained in:
parent
4e9aa7dc77
commit
b61c83a19d
12 changed files with 33 additions and 45 deletions
|
@ -28,10 +28,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "map_settings_manager.h"
|
||||
#include "util/string.h"
|
||||
|
||||
#if CHECK_CLIENT_BUILD()
|
||||
#include "client/texturepaths.h"
|
||||
#endif
|
||||
|
||||
// The maximum number of identical world names allowed
|
||||
#define MAX_WORLD_NAMES 100
|
||||
|
||||
|
@ -96,8 +92,7 @@ std::string getSubgamePathEnv()
|
|||
|
||||
static SubgameSpec getSubgameSpec(const std::string &game_id,
|
||||
const std::string &game_path,
|
||||
const std::unordered_map<std::string, std::string> &mods_paths,
|
||||
const std::string &menuicon_path)
|
||||
const std::unordered_map<std::string, std::string> &mods_paths)
|
||||
{
|
||||
const auto gamemods_path = game_path + DIR_DELIM + "mods";
|
||||
// Get meta
|
||||
|
@ -130,7 +125,7 @@ static SubgameSpec getSubgameSpec(const std::string &game_id,
|
|||
last_mod = conf.get("last_mod");
|
||||
|
||||
SubgameSpec spec(game_id, game_path, gamemods_path, mods_paths, game_title,
|
||||
menuicon_path, game_author, game_release, first_mod, last_mod);
|
||||
game_author, game_release, first_mod, last_mod);
|
||||
|
||||
if (conf.exists("name") && !conf.exists("title"))
|
||||
spec.deprecation_msgs.push_back("\"name\" setting in game.conf is deprecated, please use \"title\" instead");
|
||||
|
@ -191,13 +186,7 @@ SubgameSpec findSubgame(const std::string &id)
|
|||
mods_paths[fs::AbsolutePath(mod_path)] = mod_path;
|
||||
}
|
||||
|
||||
std::string menuicon_path;
|
||||
#if CHECK_CLIENT_BUILD()
|
||||
menuicon_path = getImagePath(
|
||||
game_path + DIR_DELIM + "menu" + DIR_DELIM + "icon.png");
|
||||
#endif
|
||||
|
||||
return getSubgameSpec(id, game_path, mods_paths, menuicon_path);
|
||||
return getSubgameSpec(id, game_path, mods_paths);
|
||||
}
|
||||
|
||||
SubgameSpec findWorldSubgame(const std::string &world_path)
|
||||
|
@ -206,7 +195,7 @@ SubgameSpec findWorldSubgame(const std::string &world_path)
|
|||
// See if world contains an embedded game; if so, use it.
|
||||
std::string world_gamepath = world_path + DIR_DELIM + "game";
|
||||
if (fs::PathExists(world_gamepath))
|
||||
return getSubgameSpec(world_gameid, world_gamepath, {}, "");
|
||||
return getSubgameSpec(world_gameid, world_gamepath, {});
|
||||
return findSubgame(world_gameid);
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ struct SubgameSpec
|
|||
* Map from virtual path to mods path
|
||||
*/
|
||||
std::unordered_map<std::string, std::string> addon_mods_paths;
|
||||
std::string menuicon_path;
|
||||
|
||||
// For logging purposes
|
||||
std::vector<const char *> deprecation_msgs;
|
||||
|
@ -50,7 +49,6 @@ struct SubgameSpec
|
|||
const std::string &gamemods_path = "",
|
||||
const std::unordered_map<std::string, std::string> &addon_mods_paths = {},
|
||||
const std::string &title = "",
|
||||
const std::string &menuicon_path = "",
|
||||
const std::string &author = "", int release = 0,
|
||||
const std::string &first_mod = "",
|
||||
const std::string &last_mod = "") :
|
||||
|
@ -60,8 +58,7 @@ struct SubgameSpec
|
|||
last_mod(last_mod),
|
||||
path(path),
|
||||
gamemods_path(gamemods_path),
|
||||
addon_mods_paths(addon_mods_paths),
|
||||
menuicon_path(menuicon_path)
|
||||
addon_mods_paths(addon_mods_paths)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue