2014-08-11 18:04:44 +00:00
|
|
|
#ifndef MISC_RESOURCEHELPERS_H
|
|
|
|
#define MISC_RESOURCEHELPERS_H
|
|
|
|
|
|
|
|
#include <string>
|
2021-06-29 01:47:23 +00:00
|
|
|
#include <string_view>
|
2014-08-11 18:04:44 +00:00
|
|
|
|
2015-03-19 00:45:01 +00:00
|
|
|
namespace VFS
|
|
|
|
{
|
|
|
|
class Manager;
|
|
|
|
}
|
|
|
|
|
2022-10-03 17:49:20 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2023-02-15 22:19:51 +00:00
|
|
|
class RefId;
|
2022-10-03 17:49:20 +00:00
|
|
|
}
|
|
|
|
|
2014-08-11 18:04:44 +00:00
|
|
|
namespace Misc
|
|
|
|
{
|
2015-05-01 16:37:24 +00:00
|
|
|
// Workarounds for messy resource handling in vanilla morrowind
|
|
|
|
// The below functions are provided on a opt-in basis, instead of built into the VFS,
|
|
|
|
// so we have the opportunity to use proper resource handling for content created in OpenMW-CS.
|
2014-08-11 18:04:44 +00:00
|
|
|
namespace ResourceHelpers
|
|
|
|
{
|
2014-08-12 10:18:38 +00:00
|
|
|
bool changeExtensionToDds(std::string& path);
|
2022-08-22 14:55:53 +00:00
|
|
|
std::string correctResourcePath(
|
|
|
|
std::string_view topLevelDirectory, 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);
|
|
|
|
std::string correctBookartPath(std::string_view resPath, int width, int height, const VFS::Manager* vfs);
|
2023-01-14 00:35:50 +00:00
|
|
|
/// Use "xfoo.nif" instead of "foo.nif" if "xfoo.kf" is available
|
|
|
|
/// Note that if "xfoo.nif" is actually unavailable, we can't fall back to "foo.nif". :(
|
2015-03-19 00:45:01 +00:00
|
|
|
std::string correctActorModelPath(const std::string& resPath, const VFS::Manager* vfs);
|
2022-05-13 16:45:03 +00:00
|
|
|
std::string correctMeshPath(const std::string& resPath, const VFS::Manager* vfs);
|
2021-06-29 01:47:23 +00:00
|
|
|
|
2022-08-22 14:55:53 +00:00
|
|
|
std::string correctSoundPath(std::string_view resPath, const VFS::Manager* vfs);
|
2021-11-10 22:06:35 +00:00
|
|
|
|
2021-06-29 01:47:23 +00:00
|
|
|
/// marker objects that have a hardcoded function in the game logic, should be hidden from the player
|
2022-10-03 17:49:20 +00:00
|
|
|
bool isHiddenMarker(const ESM::RefId& id);
|
2022-09-03 16:50:38 +00:00
|
|
|
std::string getLODMeshName(int esmVersion, std::string resPath, const VFS::Manager* vfs, unsigned char lod = 0);
|
2014-08-11 18:04:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|