diff options
author | AnyOldName3 <krizdjali@gmail.com> | 2024-02-23 01:34:01 +0000 |
---|---|---|
committer | AnyOldName3 <krizdjali@gmail.com> | 2024-02-23 01:34:01 +0000 |
commit | 6406095bfb478a25c0831c41db7dfc1bd26a480e (patch) | |
tree | 564099b275112d45143203f0d5a406e985ca0554 | |
parent | 1717e696b16ff852a8e274f0f0be8c1699084376 (diff) |
s p a n
-rw-r--r-- | components/misc/resourcehelpers.cpp | 8 | ||||
-rw-r--r-- | components/misc/resourcehelpers.hpp | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/components/misc/resourcehelpers.cpp b/components/misc/resourcehelpers.cpp index 119936f2ab..4e7f7c41e3 100644 --- a/components/misc/resourcehelpers.cpp +++ b/components/misc/resourcehelpers.cpp @@ -47,7 +47,7 @@ bool Misc::ResourceHelpers::changeExtensionToDds(std::string& path) } std::string Misc::ResourceHelpers::correctResourcePath( - const std::vector<std::string_view>& topLevelDirectories, std::string_view resPath, const VFS::Manager* vfs) + std::span<const std::string_view> topLevelDirectories, std::string_view resPath, const VFS::Manager* vfs) { /* Bethesda at some point converted all their BSA * textures from tga to dds for increased load speed, but all @@ -124,17 +124,17 @@ std::string Misc::ResourceHelpers::correctResourcePath( std::string Misc::ResourceHelpers::correctTexturePath(std::string_view resPath, const VFS::Manager* vfs) { - return correctResourcePath({ "textures", "bookart" }, resPath, vfs); + return correctResourcePath({ { "textures", "bookart" } }, resPath, vfs); } std::string Misc::ResourceHelpers::correctIconPath(std::string_view resPath, const VFS::Manager* vfs) { - return correctResourcePath({ "icons" }, resPath, vfs); + return correctResourcePath({ { "icons" } }, resPath, vfs); } std::string Misc::ResourceHelpers::correctBookartPath(std::string_view resPath, const VFS::Manager* vfs) { - return correctResourcePath({ "bookart", "textures" }, resPath, vfs); + return correctResourcePath({ { "bookart", "textures" } }, resPath, vfs); } std::string Misc::ResourceHelpers::correctBookartPath( diff --git a/components/misc/resourcehelpers.hpp b/components/misc/resourcehelpers.hpp index c98840dd61..bd95f2376b 100644 --- a/components/misc/resourcehelpers.hpp +++ b/components/misc/resourcehelpers.hpp @@ -1,6 +1,7 @@ #ifndef MISC_RESOURCEHELPERS_H #define MISC_RESOURCEHELPERS_H +#include <span> #include <string> #include <string_view> #include <vector> @@ -23,8 +24,8 @@ namespace Misc namespace ResourceHelpers { bool changeExtensionToDds(std::string& path); - std::string correctResourcePath(const std::vector<std::string_view>& topLevelDirectories, - std::string_view resPath, const VFS::Manager* vfs); + std::string correctResourcePath( + std::span<const std::string_view> topLevelDirectories, std::string_view resPath, const VFS::Manager* vfs); std::string correctTexturePath(std::string_view resPath, const VFS::Manager* vfs); std::string correctIconPath(std::string_view resPath, const VFS::Manager* vfs); std::string correctBookartPath(std::string_view resPath, const VFS::Manager* vfs); |