mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	- minor optimizations
- fixed incorrect error reporting in launcher - set WoG version to "0.0.0" so full version will be installed from repo in future - updated debian required packages list - launcher will be enabled by default
This commit is contained in:
		| @@ -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) | ||||
|  | ||||
| ############################################ | ||||
|   | ||||
| @@ -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", | ||||
|   | ||||
							
								
								
									
										2
									
								
								debian/control
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								debian/control
									
									
									
									
										vendored
									
									
								
							| @@ -2,7 +2,7 @@ Source: vcmi | ||||
| Section: games | ||||
| Priority: optional | ||||
| Maintainer: Ivan Savenko <saven.ivan@gmail.com> | ||||
| 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 | ||||
|  | ||||
|   | ||||
| @@ -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(); | ||||
|   | ||||
| @@ -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); | ||||
| 	} | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
| @@ -69,7 +69,10 @@ std::unique_ptr<CInputStream> 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 | ||||
|   | ||||
| @@ -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<std::string, EResType::Type> stringToRes = | ||||
| 			boost::assign::map_list_of | ||||
|   | ||||
		Reference in New Issue
	
	Block a user