diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d630f007..1d68f5480 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ set(VCMI_VERSION_PATCH 0) option(ENABLE_ERM "Enable compilation of ERM scripting module" OFF) option(ENABLE_EDITOR "Enable compilation of map editor" OFF) -option(ENABLE_LAUNCHER "Enable compilation of launcher" OFF) +option(ENABLE_LAUNCHER "Enable compilation of launcher" ON) option(ENABLE_TEST "Enable compilation of unit tests" OFF) ############################################ diff --git a/Mods/WoG/mod.json b/Mods/WoG/mod.json index 7c5864933..93a5280ad 100644 --- a/Mods/WoG/mod.json +++ b/Mods/WoG/mod.json @@ -2,7 +2,7 @@ "name" : "In The Wake of Gods", "description" : "Unnofficial addon for Heroes of Might and Magic III", - "version" : "3.58.0", + "version" : "0.0.0", "author" : "WoG Team", "contact" : "http://forum.vcmi.eu/index.php", "modType" : "Expansion", diff --git a/debian/control b/debian/control index 9daf18f26..20338e976 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: vcmi Section: games Priority: optional Maintainer: Ivan Savenko -Build-Depends: debhelper (>= 8), cmake, libsdl-image1.2-dev, libsdl-ttf2.0-dev, libsdl-mixer1.2-dev (>= 1.2.8), zlib1g-dev, libavformat-dev, libswscale-dev, libboost-dev (>=1.48), libboost-program-options-dev (>=1.48), libboost-filesystem-dev (>=1.48), libboost-system-dev (>=1.48), libboost-locale-dev (>=1.48), libboost-thread-dev (>=1.48) +Build-Depends: debhelper (>= 8), cmake, libsdl-image1.2-dev, libsdl-ttf2.0-dev, libsdl-mixer1.2-dev (>= 1.2.8), zlib1g-dev, libavformat-dev, libswscale-dev, libboost-dev (>=1.48), libboost-program-options-dev (>=1.48), libboost-filesystem-dev (>=1.48), libboost-system-dev (>=1.48), libboost-locale-dev (>=1.48), libboost-thread-dev (>=1.48), qtbase5-dev Standards-Version: 3.9.1 Homepage: http://vcmi.eu diff --git a/launcher/modManager/cmodlistview_moc.cpp b/launcher/modManager/cmodlistview_moc.cpp index c8a5a1469..ff16c5f72 100644 --- a/launcher/modManager/cmodlistview_moc.cpp +++ b/launcher/modManager/cmodlistview_moc.cpp @@ -381,7 +381,8 @@ void CModListView::on_uninstallButton_clicked() if (modModel->hasMod(modName) && modModel->getMod(modName).isInstalled()) { - manager->disableMod(modName); + if (modModel->getMod(modName).isEnabled()) + manager->disableMod(modName); manager->uninstallMod(modName); } checkManagerErrors(); diff --git a/lib/CCreatureHandler.cpp b/lib/CCreatureHandler.cpp index 8980809b0..5a0e7b34d 100644 --- a/lib/CCreatureHandler.cpp +++ b/lib/CCreatureHandler.cpp @@ -385,7 +385,7 @@ void CCreatureHandler::loadObject(std::string scope, std::string name, const Jso creatures[index] = object; VLC->modh->identifiers.registerObject(scope, "creature", name, object->idNumber); - for(auto node : data["extraNames"].Vector()) + for(auto & node : data["extraNames"].Vector()) { VLC->modh->identifiers.registerObject(scope, "creature", node.String(), object->idNumber); } diff --git a/lib/CModHandler.cpp b/lib/CModHandler.cpp index b39946ed3..e0ffe6b99 100644 --- a/lib/CModHandler.cpp +++ b/lib/CModHandler.cpp @@ -247,7 +247,7 @@ bool CContentHandler::ContentTypeHandler::loadMod(std::string modName, bool vali if (!modInfo.patches.isNull()) JsonUtils::merge(modInfo.modData, modInfo.patches); - for(auto entry : modInfo.modData.Struct()) + for(auto & entry : modInfo.modData.Struct()) { const std::string & name = entry.first; JsonNode & data = entry.second; diff --git a/lib/filesystem/AdapterLoaders.cpp b/lib/filesystem/AdapterLoaders.cpp index 9d1ef8a22..a0bd18219 100644 --- a/lib/filesystem/AdapterLoaders.cpp +++ b/lib/filesystem/AdapterLoaders.cpp @@ -69,7 +69,10 @@ std::unique_ptr CFilesystemList::load(const ResourceID & resourceN bool CFilesystemList::existsResource(const ResourceID & resourceName) const { - return !getResourcesWithName(resourceName).empty(); + for (auto & loader : *loaders) + if (loader->existsResource(resourceName)) + return true; + return false; } std::string CFilesystemList::getMountPoint() const diff --git a/lib/filesystem/ResourceID.cpp b/lib/filesystem/ResourceID.cpp index 602257f78..4209cb9c1 100644 --- a/lib/filesystem/ResourceID.cpp +++ b/lib/filesystem/ResourceID.cpp @@ -3,6 +3,30 @@ #include "CFileInfo.h" +// trivial to_upper that completely ignores localization and only work with ASCII +// Technically not a problem since +// 1) Right now VCMI does not supports unicode in filenames on Win +// 2) Filesystem case-sensivity is only problem for H3 data which uses ASCII-only symbols +// for me (Ivan) this define gives notable decrease in loading times +// #define ENABLE_TRIVIAL_TOUPPER + +#ifdef ENABLE_TRIVIAL_TOUPPER +static inline void toUpper(char & symbol) +{ + static const int diff = 'a' - 'A'; + if (symbol >= 'a' && symbol <= 'z') + symbol -= diff; +} + +static inline void toUpper(std::string & string) +{ + for (char & symbol : string) + toUpper(symbol); +} + +#endif + + ResourceID::ResourceID() :type(EResType::OTHER) { @@ -40,8 +64,12 @@ void ResourceID::setName(std::string name) if(dotPos != std::string::npos && this->name[dotPos] == '.') this->name.erase(dotPos); +#ifdef ENABLE_TRIVIAL_TOUPPER + toUpper(this->name); +#else // strangely enough but this line takes 40-50% of filesystem loading time boost::to_upper(this->name); +#endif } void ResourceID::setType(EResType::Type type) @@ -51,7 +79,11 @@ void ResourceID::setType(EResType::Type type) EResType::Type EResTypeHelper::getTypeFromExtension(std::string extension) { +#ifdef ENABLE_TRIVIAL_TOUPPER + toUpper(extension); +#else boost::to_upper(extension); +#endif static const std::map stringToRes = boost::assign::map_list_of