#pragma once #include "Resource.h" #include "FileLoaderThread.h" #include #include #include class CResourceManager : public CSingleton { public: CResourceManager(); virtual ~CResourceManager(); void LoadStaticCache(const char* c_szFileName); void DestroyDeletingList(); void Destroy(); void BeginThreadLoading(); void EndThreadLoading(); CResource * InsertResourcePointer(DWORD dwFileCRC, CResource* pResource); CResource * FindResourcePointer(DWORD dwFileCRC); CResource * GetResourcePointer(const char * c_szFileName); CResource * GetTypeResourcePointer(const char * c_szFileName, int iType=-1); // Ãß°¡ bool isResourcePointerData(DWORD dwFileCRC); void RegisterResourceNewFunctionPointer(const char* c_szFileExt, CResource* (*pResNewFunc)(const char* c_szFileName)); void RegisterResourceNewFunctionByTypePointer(int iType, CResource* (*pNewFunc) (const char* c_szFileName)); void DumpFileListToTextFile(const char* c_szFileName); bool IsFileExist(const char * c_szFileName); void Update(); void ReserveDeletingResource(CResource * pResource); public: void ProcessBackgroundLoading(); void PushBackgroundLoadingSet(std::set & LoadingSet); protected: void __DestroyDeletingResourceMap(); void __DestroyResourceMap(); void __DestroyCacheMap(); DWORD __GetFileCRC(const char * c_szFileName, const char ** c_pszLowerFile = NULL); protected: typedef std::map TResourcePointerMap; typedef std::map TResourceNewFunctionPointerMap; typedef std::map TResourceNewFunctionByTypePointerMap; typedef std::map TResourceDeletingMap; typedef std::map TResourceRequestMap; typedef std::map TResourceRefDecreaseWaitingMap; protected: TResourcePointerMap m_pCacheMap; TResourcePointerMap m_pResMap; TResourceNewFunctionPointerMap m_pResNewFuncMap; TResourceNewFunctionByTypePointerMap m_pResNewFuncByTypeMap; TResourceDeletingMap m_ResourceDeletingMap; TResourceRequestMap m_RequestMap; // ¾²·¹µå·Î ·Îµù ¿äûÇÑ ¸®½ºÆ® TResourceRequestMap m_WaitingMap; TResourceRefDecreaseWaitingMap m_pResRefDecreaseWaitingMap; static CFileLoaderThread ms_loadingThread; }; extern int g_iLoadingDelayTime;