1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-05 06:40:09 +00:00
This commit is contained in:
AnyOldName3 2024-02-23 01:34:01 +00:00
parent 1717e696b1
commit 6406095bfb
2 changed files with 7 additions and 6 deletions

View File

@ -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(

View File

@ -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);