mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Removed no longer used code
This commit is contained in:
@@ -205,7 +205,7 @@ int main(int argc, char * argv[])
|
|||||||
logGlobal->info("The log file will be saved to %s", logPath);
|
logGlobal->info("The log file will be saved to %s", logPath);
|
||||||
|
|
||||||
// Init filesystem and settings
|
// Init filesystem and settings
|
||||||
preinitDLL(::console);
|
preinitDLL(::console, false);
|
||||||
|
|
||||||
Settings session = settings.write["session"];
|
Settings session = settings.write["session"];
|
||||||
auto setSettingBool = [](std::string key, std::string arg) {
|
auto setSettingBool = [](std::string key, std::string arg) {
|
||||||
|
@@ -47,14 +47,14 @@ VCMI_LIB_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
LibClasses * VLC = nullptr;
|
LibClasses * VLC = nullptr;
|
||||||
|
|
||||||
DLL_LINKAGE void preinitDLL(CConsoleHandler * Console, bool onlyEssential, bool extractArchives)
|
DLL_LINKAGE void preinitDLL(CConsoleHandler * Console, bool extractArchives)
|
||||||
{
|
{
|
||||||
console = Console;
|
console = Console;
|
||||||
VLC = new LibClasses();
|
VLC = new LibClasses();
|
||||||
VLC->loadFilesystem(extractArchives);
|
VLC->loadFilesystem(extractArchives);
|
||||||
settings.init("config/settings.json", "vcmi:settings");
|
settings.init("config/settings.json", "vcmi:settings");
|
||||||
persistentStorage.init("config/persistentStorage.json", "");
|
persistentStorage.init("config/persistentStorage.json", "");
|
||||||
VLC->loadModFilesystem(onlyEssential);
|
VLC->loadModFilesystem();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,12 +182,12 @@ void LibClasses::loadFilesystem(bool extractArchives)
|
|||||||
logGlobal->info("\tData loading: %d ms", loadTime.getDiff());
|
logGlobal->info("\tData loading: %d ms", loadTime.getDiff());
|
||||||
}
|
}
|
||||||
|
|
||||||
void LibClasses::loadModFilesystem(bool onlyEssential)
|
void LibClasses::loadModFilesystem()
|
||||||
{
|
{
|
||||||
CStopWatch loadTime;
|
CStopWatch loadTime;
|
||||||
modh = new CModHandler();
|
modh = new CModHandler();
|
||||||
identifiersHandler = new CIdentifierStorage();
|
identifiersHandler = new CIdentifierStorage();
|
||||||
modh->loadMods(onlyEssential);
|
modh->loadMods();
|
||||||
logGlobal->info("\tMod handler: %d ms", loadTime.getDiff());
|
logGlobal->info("\tMod handler: %d ms", loadTime.getDiff());
|
||||||
|
|
||||||
modh->loadModFilesystems();
|
modh->loadModFilesystems();
|
||||||
|
@@ -115,7 +115,7 @@ public:
|
|||||||
|
|
||||||
// basic initialization. should be called before init(). Can also extract original H3 archives
|
// basic initialization. should be called before init(). Can also extract original H3 archives
|
||||||
void loadFilesystem(bool extractArchives);
|
void loadFilesystem(bool extractArchives);
|
||||||
void loadModFilesystem(bool onlyEssential);
|
void loadModFilesystem();
|
||||||
|
|
||||||
#if SCRIPTING_ENABLED
|
#if SCRIPTING_ENABLED
|
||||||
void scriptsLoaded();
|
void scriptsLoaded();
|
||||||
@@ -124,7 +124,7 @@ public:
|
|||||||
|
|
||||||
extern DLL_LINKAGE LibClasses * VLC;
|
extern DLL_LINKAGE LibClasses * VLC;
|
||||||
|
|
||||||
DLL_LINKAGE void preinitDLL(CConsoleHandler * Console, bool onlyEssential = false, bool extractArchives = false);
|
DLL_LINKAGE void preinitDLL(CConsoleHandler * Console, bool extractArchives);
|
||||||
DLL_LINKAGE void loadDLLClasses(bool onlyEssential = false);
|
DLL_LINKAGE void loadDLLClasses(bool onlyEssential = false);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -237,19 +237,12 @@ void CModHandler::loadOneMod(std::string modName, const std::string & parent, co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CModHandler::loadMods(bool onlyEssential)
|
void CModHandler::loadMods()
|
||||||
{
|
{
|
||||||
JsonNode modConfig;
|
JsonNode modConfig;
|
||||||
|
|
||||||
if(onlyEssential)
|
|
||||||
{
|
|
||||||
loadOneMod("vcmi", "", modConfig, true);//only vcmi and submods
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
modConfig = loadModSettings(JsonPath::builtin("config/modSettings.json"));
|
modConfig = loadModSettings(JsonPath::builtin("config/modSettings.json"));
|
||||||
loadMods("", "", modConfig["activeMods"], true);
|
loadMods("", "", modConfig["activeMods"], true);
|
||||||
}
|
|
||||||
|
|
||||||
coreMod = std::make_unique<CModInfo>(ModScope::scopeBuiltin(), modConfig[ModScope::scopeBuiltin()], JsonNode(JsonPath::builtin("config/gameConfig.json")));
|
coreMod = std::make_unique<CModInfo>(ModScope::scopeBuiltin(), modConfig[ModScope::scopeBuiltin()], JsonNode(JsonPath::builtin("config/gameConfig.json")));
|
||||||
}
|
}
|
||||||
|
@@ -58,7 +58,7 @@ public:
|
|||||||
|
|
||||||
/// receives list of available mods and trying to load mod.json from all of them
|
/// receives list of available mods and trying to load mod.json from all of them
|
||||||
void initializeConfig();
|
void initializeConfig();
|
||||||
void loadMods(bool onlyEssential = false);
|
void loadMods();
|
||||||
void loadModFilesystems();
|
void loadModFilesystems();
|
||||||
|
|
||||||
/// returns ID of mod that provides selected file resource
|
/// returns ID of mod that provides selected file resource
|
||||||
|
@@ -177,7 +177,7 @@ MainWindow::MainWindow(QWidget* parent) :
|
|||||||
logGlobal->info("The log file will be saved to %s", logPath);
|
logGlobal->info("The log file will be saved to %s", logPath);
|
||||||
|
|
||||||
//init
|
//init
|
||||||
preinitDLL(::console, false, extractionOptions.extractArchives);
|
preinitDLL(::console, extractionOptions.extractArchives);
|
||||||
|
|
||||||
// Initialize logging based on settings
|
// Initialize logging based on settings
|
||||||
logConfig->configure();
|
logConfig->configure();
|
||||||
|
@@ -1172,7 +1172,7 @@ int main(int argc, const char * argv[])
|
|||||||
|
|
||||||
boost::program_options::variables_map opts;
|
boost::program_options::variables_map opts;
|
||||||
handleCommandOptions(argc, argv, opts);
|
handleCommandOptions(argc, argv, opts);
|
||||||
preinitDLL(console);
|
preinitDLL(console, false);
|
||||||
logConfig.configure();
|
logConfig.configure();
|
||||||
|
|
||||||
loadDLLClasses();
|
loadDLLClasses();
|
||||||
|
Reference in New Issue
Block a user