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:
savis
2026-01-03 20:38:02 +01:00
parent f702b4953d
commit 6984fef736
2 changed files with 82 additions and 1 deletions

View File

@@ -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;