diff --git a/client/render/AssetGenerator.cpp b/client/render/AssetGenerator.cpp index 2895be470..1d6984fb1 100644 --- a/client/render/AssetGenerator.cpp +++ b/client/render/AssetGenerator.cpp @@ -36,7 +36,6 @@ void AssetGenerator::createAdventureOptionsCleanBackground() ResourcePath savePath(filename, EResType::IMAGE); auto res = ImagePath::builtin("ADVOPTBK"); - res = res.setOriginalResource(true); std::shared_ptr img = GH.renderHandler().loadImage(res, EImageBlitMode::OPAQUE); @@ -66,7 +65,6 @@ void AssetGenerator::createBigSpellBook() ResourcePath savePath(filename, EResType::IMAGE); auto res = ImagePath::builtin("SpelBack"); - res = res.setOriginalResource(true); std::shared_ptr img = GH.renderHandler().loadImage(res, EImageBlitMode::OPAQUE); Canvas canvas = Canvas(Point(800, 600), CanvasScalingPolicy::IGNORE); diff --git a/lib/filesystem/AdapterLoaders.cpp b/lib/filesystem/AdapterLoaders.cpp index caa1dd7f6..90d76ea2c 100644 --- a/lib/filesystem/AdapterLoaders.cpp +++ b/lib/filesystem/AdapterLoaders.cpp @@ -66,19 +66,10 @@ CFilesystemList::~CFilesystemList() std::unique_ptr CFilesystemList::load(const ResourcePath & resourceName) const { - if(resourceName.getOriginalResource()) - { - for(const auto & loader : loaders) - if (loader->existsResource(resourceName)) - return loader->load(resourceName); - } - else - { - // load resource from last loader that have it (last overridden version) - for(const auto & loader : boost::adaptors::reverse(loaders)) - if (loader->existsResource(resourceName)) - return loader->load(resourceName); - } + // load resource from last loader that have it (last overridden version) + for(const auto & loader : boost::adaptors::reverse(loaders)) + if (loader->existsResource(resourceName)) + return loader->load(resourceName); throw std::runtime_error("Resource with name " + resourceName.getName() + " and type " + EResTypeHelper::getEResTypeAsString(resourceName.getType()) + " wasn't found."); diff --git a/lib/filesystem/ResourcePath.cpp b/lib/filesystem/ResourcePath.cpp index 1c2b29f7b..347c3e9fd 100644 --- a/lib/filesystem/ResourcePath.cpp +++ b/lib/filesystem/ResourcePath.cpp @@ -51,22 +51,19 @@ static inline std::string readName(std::string name, bool uppercase) ResourcePath::ResourcePath(const std::string & name_): type(readType(name_)), name(readName(name_, true)), - originalName(readName(name_, false)), - originalResource(false) + originalName(readName(name_, false)) {} ResourcePath::ResourcePath(const std::string & name_, EResType type_): type(type_), name(readName(name_, true)), - originalName(readName(name_, false)), - originalResource(false) + originalName(readName(name_, false)) {} ResourcePath::ResourcePath(const JsonNode & name, EResType type): type(type), name(readName(name.String(), true)), - originalName(readName(name.String(), false)), - originalResource(false) + originalName(readName(name.String(), false)) { } diff --git a/lib/filesystem/ResourcePath.h b/lib/filesystem/ResourcePath.h index 92fa3702b..4f4b4e9a1 100644 --- a/lib/filesystem/ResourcePath.h +++ b/lib/filesystem/ResourcePath.h @@ -99,7 +99,6 @@ public: bool empty() const {return name.empty();} std::string getName() const {return name;} std::string getOriginalName() const {return originalName;} - bool getOriginalResource() const {return originalResource;} EResType getType() const {return type;} void serializeJson(JsonSerializeFormat & handler); @@ -109,8 +108,6 @@ public: h & type; h & name; h & originalName; - if (h.version >= Handler::Version::RESOURCE_GENERATION) - h & originalResource; } protected: @@ -123,9 +120,6 @@ protected: /// name in original case std::string originalName; - - /// flag for requesting unmodded, original resource - bool originalResource; }; template @@ -186,17 +180,6 @@ public: ResourcePathTempl result; result.name = prefix + this->getName(); result.originalName = prefix + this->getOriginalName(); - result.originalResource = this->getOriginalResource(); - - return result; - } - - ResourcePathTempl setOriginalResource(bool original) const - { - ResourcePathTempl result; - result.name = this->getName(); - result.originalName = this->getOriginalName(); - result.originalResource = original; return result; } diff --git a/lib/serializer/ESerializationVersion.h b/lib/serializer/ESerializationVersion.h index 7eb6bfbfe..d7c9ad4c1 100644 --- a/lib/serializer/ESerializationVersion.h +++ b/lib/serializer/ESerializationVersion.h @@ -66,7 +66,6 @@ enum class ESerializationVersion : int32_t NEW_TOWN_BUILDINGS, // 855 - old bonusing buildings have been removed STATISTICS_SCREEN, // 856 - extent statistic functions NEW_MARKETS, // 857 - reworked market classes - RESOURCE_GENERATION, // 858 - resource generation - CURRENT = RESOURCE_GENERATION + CURRENT = NEW_MARKETS };