Integrate async loading infrastructure
- Initialize FileLoaderThreadPool and TextureCache - Route file requests through thread pool - Handle pre-decoded images from worker threads - Reduce loading delay from 20ms to 1ms - 512MB texture cache (up from 256MB)
This commit is contained in:
@@ -2,11 +2,14 @@
|
||||
|
||||
#include "Resource.h"
|
||||
#include "FileLoaderThread.h"
|
||||
#include "FileLoaderThreadPool.h"
|
||||
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
class CTextureCache;
|
||||
|
||||
class CResourceManager : public CSingleton<CResourceManager>
|
||||
{
|
||||
public:
|
||||
@@ -42,6 +45,9 @@ class CResourceManager : public CSingleton<CResourceManager>
|
||||
void ProcessBackgroundLoading();
|
||||
void PushBackgroundLoadingSet(std::set<std::string> & LoadingSet);
|
||||
|
||||
CTextureCache* GetTextureCache() { return m_pTextureCache; }
|
||||
CFileLoaderThreadPool* GetLoaderThreadPool() { return m_pLoaderThreadPool; }
|
||||
|
||||
protected:
|
||||
void __DestroyDeletingResourceMap();
|
||||
void __DestroyResourceMap();
|
||||
@@ -68,6 +74,8 @@ class CResourceManager : public CSingleton<CResourceManager>
|
||||
TResourceRefDecreaseWaitingMap m_pResRefDecreaseWaitingMap;
|
||||
|
||||
static CFileLoaderThread ms_loadingThread;
|
||||
CFileLoaderThreadPool* m_pLoaderThreadPool;
|
||||
CTextureCache* m_pTextureCache;
|
||||
};
|
||||
|
||||
extern int g_iLoadingDelayTime;
|
||||
Reference in New Issue
Block a user