1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-09 03:39:14 +00:00
OpenMW/components/resource/niffilemanager.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
1020 B
C++
Raw Normal View History

#ifndef OPENMW_COMPONENTS_RESOURCE_NIFFILEMANAGER_H
#define OPENMW_COMPONENTS_RESOURCE_NIFFILEMANAGER_H
#include <components/nif/niffile.hpp>
#include "resourcemanager.hpp"
2024-01-16 19:56:58 +00:00
namespace ToUTF8
{
2024-01-17 17:10:42 +00:00
class StatelessUtf8Encoder;
2024-01-16 19:56:58 +00:00
}
namespace Resource
{
/// @brief Handles caching of NIFFiles.
/// @note May be used from any thread.
class NifFileManager : public ResourceManager
{
2024-01-17 17:10:42 +00:00
const ToUTF8::StatelessUtf8Encoder* mEncoder;
2024-01-16 19:56:58 +00:00
public:
2024-01-17 17:10:42 +00:00
NifFileManager(const VFS::Manager* vfs, const ToUTF8::StatelessUtf8Encoder* encoder);
~NifFileManager();
/// Retrieve a NIF file from the cache, or load it from the VFS if not cached yet.
/// @note For performance reasons the NifFileManager does not handle case folding, needs
/// to be done in advance by other managers accessing the NifFileManager.
Nif::NIFFilePtr get(VFS::Path::NormalizedView name);
void reportStats(unsigned int frameNumber, osg::Stats* stats) const override;
};
}
#endif