mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-19 09:55:40 +00:00
Initial commit of current work on Prime World Editor
This commit is contained in:
40
Core/CResCache.h
Normal file
40
Core/CResCache.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef CRESCACHE_H
|
||||
#define CRESCACHE_H
|
||||
|
||||
#include <Common/types.h>
|
||||
#include <Resource/CPakFile.h>
|
||||
#include <Resource/CResource.h>
|
||||
#include <unordered_map>
|
||||
|
||||
struct SResSource
|
||||
{
|
||||
std::string Path;
|
||||
enum {
|
||||
Folder, PakFile
|
||||
} Source;
|
||||
};
|
||||
|
||||
class CResCache
|
||||
{
|
||||
std::unordered_map<u64, CResource*> mResourceCache;
|
||||
CPakFile *mpPak;
|
||||
SResSource mResSource;
|
||||
|
||||
public:
|
||||
CResCache();
|
||||
~CResCache();
|
||||
void Clean();
|
||||
void SetFolder(std::string path);
|
||||
void SetPak(std::string path);
|
||||
void SetResSource(SResSource& ResSource);
|
||||
SResSource GetResSource();
|
||||
std::string GetSourcePath();
|
||||
CResource* GetResource(CUniqueID ResID, CFourCC type);
|
||||
CResource* GetResource(std::string res);
|
||||
void CacheResource(CResource *pRes);
|
||||
void DeleteResource(CUniqueID ResID);
|
||||
};
|
||||
|
||||
extern CResCache gResCache;
|
||||
|
||||
#endif // CRESCACHE_H
|
||||
Reference in New Issue
Block a user