You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw/components/resource/niffilemanager.hpp

37 lines
1013 B
C++

#ifndef OPENMW_COMPONENTS_RESOURCE_NIFFILEMANAGER_H
#define OPENMW_COMPONENTS_RESOURCE_NIFFILEMANAGER_H
#include <components/nif/niffile.hpp>
#include "resourcemanager.hpp"
namespace ToUTF8
{
12 months ago
class StatelessUtf8Encoder;
}
namespace Resource
{
/// @brief Handles caching of NIFFiles.
/// @note May be used from any thread.
class NifFileManager : public ResourceManager
{
12 months ago
const ToUTF8::StatelessUtf8Encoder* mEncoder;
public:
12 months ago
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(const std::string& name);
void reportStats(unsigned int frameNumber, osg::Stats* stats) const override;
};
}
#endif