载入中...
搜索中...
未找到
Resource.h
浏览该文件的文档.
Object is the base class for all game objects. It provides reference counting and dirty flag for upda...
Definition Object.h:18
ResourceManager is a singleton that manages all resources in the game. It provides a way to load,...
Definition Resource.h:87
ResourceManager()=default
void unloadPath(const std::string &path)
Drop every cache entry whose path matches, whatever its parameters.
Definition Resource.cpp:94
bool handlesPath(const std::string &normPath) const override
Definition Resource.cpp:116
void unload(std::string key)
Drop the exact cache entry key (parameters included). The resource stays alive while other holders st...
Definition Resource.cpp:89
Resource * get(std::string key)
Get the cached resource for key; on a miss, load it through the registered IAssetReloader providers a...
Definition Resource.cpp:56
std::map< std::string, ref< Resource > > resources
Definition Resource.h:141
bool reload(const std::string &normPath) override
Definition Resource.cpp:126
static std::string pathOfKey(const std::string &key)
The path part of a cache key (everything before the first '?').
Definition Resource.cpp:39
bool refreshEntry(const std::string &key, std::set< std::string > &visited)
Definition Resource.cpp:146
static std::string normalizePath(std::string path)
Normalize a VFS path: backslashes to '/', strip leading "./" and trailing '/'.
Definition Resource.cpp:21
void clear()
Drop every entry and re-arm lazy registration (tests / teardown).
Definition Resource.cpp:105
static std::string makeKey(const std::string &path, const std::string &query="")
Build a cache key from a path and optional ?query parameters.
Definition Resource.cpp:30
void refreshDependents(Resource *updated, std::set< std::string > &visited)
Definition Resource.cpp:185
Resource is a game object that is managed by the ResourceManager. It can be loaded from a file or gen...
Definition Resource.h:35
virtual void adopt(eve::Resource &replacement)=0
Replace this instance's contents with replacement's. The ResourceManager keeps instance identity stab...
void setUri(std::string value)
Set the resource URI (the cache key). Used by ResourceManager.
Definition Resource.h:58
std::vector< eve::ref< Resource > > getDependencies() const
Definition Resource.h:40
virtual void addDependency(eve::ref< Resource > resource)
Definition Resource.h:42
Definition AssetReloader.h:30
ref is a smart pointer that automatically calls ref() and unref() on the object. Type T must be a sub...
Definition Object.h:54
Definition Build.cpp:11