资源管理器 单例懒汉模式
更多...
#include <ResourceManager.h>
|
| | ResourceManager () |
| |
| | ~ResourceManager () |
| |
| void | Load (std::string name, std::string path, int wid, int hei) |
| | 加载单张图片
|
| |
| void | Load (std::string name, std::string path, int wid, int hei, int num) |
| | 加载多张动画图片
|
| |
| void | Load (std::string name, std::string path, const std::vector< Pair > &arr) |
| | 加载多张动画图片
|
| |
| void | Load (std::string name, std::string path, int wid, int hei, int num, int row, int col) |
| | 加载Springsheet动画图片
|
| |
| void | Load (std::string name, std::string path) |
| | 加载音频媒体资源
|
| |
资源管理器 单例懒汉模式
- 参见
- AudioManager
◆ ResourceManager()
| ResourceManager::ResourceManager |
( |
| ) |
|
|
inlineprivate |
◆ ~ResourceManager()
| ResourceManager::~ResourceManager |
( |
| ) |
|
|
inlineprivate |
◆ AnimationFetch()
◆ Fetch()
| IMAGE * ResourceManager::Fetch |
( |
std::string | name | ) |
|
◆ Initialize()
| void ResourceManager::Initialize |
( |
| ) |
|
◆ instance()
◆ IsAudio()
| bool ResourceManager::IsAudio |
( |
std::string | name | ) |
|
◆ Load() [1/5]
| void ResourceManager::Load |
( |
std::string | name, |
|
|
std::string | path ) |
|
private |
加载音频媒体资源
给音频路径一个别名
- 参数
-
| [in] | name | 音频名字 |
| [in] | path | 音频路径 |
◆ Load() [2/5]
| void ResourceManager::Load |
( |
std::string | name, |
|
|
std::string | path, |
|
|
const std::vector< Pair > & | arr ) |
|
private |
加载多张动画图片
- 参数
-
| [in] | name | 动画名字 |
| [in] | path | 动画路径 |
| [in] | arr | 每一张图片大小容器 |
◆ Load() [3/5]
| void ResourceManager::Load |
( |
std::string | name, |
|
|
std::string | path, |
|
|
int | wid, |
|
|
int | hei ) |
|
private |
加载单张图片
加载单张图像资源,放在资源库
- 参数
-
| [in] | name | 图像名字 |
| [in] | path | 图像资源路径 |
| [in] | wid | 图像宽 |
| [in] | hei | 图像高 |
◆ Load() [4/5]
| void ResourceManager::Load |
( |
std::string | name, |
|
|
std::string | path, |
|
|
int | wid, |
|
|
int | hei, |
|
|
int | num ) |
|
private |
加载多张动画图片
- 参数
-
| [in] | name | 动画名字 |
| [in] | path | 动画路径 |
| [in] | wid | 图像宽 |
| [in] | hei | 图像高 |
| [in] | num | 数量 |
◆ Load() [5/5]
| void ResourceManager::Load |
( |
std::string | name, |
|
|
std::string | path, |
|
|
int | wid, |
|
|
int | hei, |
|
|
int | num, |
|
|
int | row, |
|
|
int | col ) |
|
private |
加载Springsheet动画图片
- 参数
-
| [in] | name | 动画名字 |
| [in] | path | 动画路径 |
| [in] | wid | 图像宽 |
| [in] | hei | 图像高 |
| [in] | num | 总共数量 |
| [in] | row | 最大多少行 |
| [in] | col | 最大多少列 |
◆ AudioManager
◆ World
◆ animationPool
◆ AudioPool
| std::unordered_map<std::string,std::string> ResourceManager::AudioPool |
|
private |
◆ ImagePool
| std::unordered_map<std::string, IMAGE*> ResourceManager::ImagePool |
|
private |
◆ m_Mutex
| std::mutex ResourceManager::m_Mutex |
|
staticprivate |
◆ manager