2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CRESFACTORY
|
|
|
|
#define _CRESFACTORY
|
2022-04-10 00:17:06 +00:00
|
|
|
|
2023-10-17 18:26:21 +00:00
|
|
|
#include "Kyoto/Streams/CInputStream.hpp"
|
2022-04-10 00:17:06 +00:00
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "rstl/list.hpp"
|
|
|
|
|
2024-10-28 04:17:36 +00:00
|
|
|
#include <Kyoto/IFactory.hpp>
|
2022-08-09 23:03:51 +00:00
|
|
|
#include "Kyoto/CFactoryMgr.hpp"
|
|
|
|
#include "Kyoto/CResLoader.hpp"
|
2022-04-10 00:17:06 +00:00
|
|
|
|
2022-09-13 04:26:54 +00:00
|
|
|
class CResFactory : public IFactory {
|
2022-04-10 00:17:06 +00:00
|
|
|
public:
|
2022-09-13 04:26:54 +00:00
|
|
|
CResFactory();
|
2022-10-01 06:19:09 +00:00
|
|
|
|
2023-01-14 06:27:43 +00:00
|
|
|
~CResFactory() {}
|
|
|
|
CFactoryFnReturn Build(const SObjectTag&, const CVParamTransfer&);
|
|
|
|
void BuildAsync(const SObjectTag&, const CVParamTransfer&, IObj**);
|
|
|
|
void CancelBuild(const SObjectTag&);
|
|
|
|
bool CanBuild(const SObjectTag&);
|
|
|
|
const SObjectTag* GetResourceIdByName(const char* name) const;
|
|
|
|
|
2022-12-05 15:43:31 +00:00
|
|
|
uint ResourceSize(const SObjectTag& tag) const { return x4_resLoader.ResourceSize(tag); }
|
2022-04-10 00:17:06 +00:00
|
|
|
|
2022-09-05 04:01:13 +00:00
|
|
|
void AsyncIdle(uint time);
|
2022-04-10 00:17:06 +00:00
|
|
|
|
|
|
|
CResLoader& GetResLoader() { return x4_resLoader; }
|
2022-11-14 14:16:52 +00:00
|
|
|
FourCC GetResourceTypeById(CAssetId id) { return GetResLoader().GetResourceTypeById(id); }
|
2023-10-17 18:26:21 +00:00
|
|
|
CInputStream* LoadResourceFromMemorySync(const SObjectTag& tag, const void* extBuf) {
|
|
|
|
return x4_resLoader.LoadResourceFromMemorySync(tag, extBuf);
|
|
|
|
}
|
2022-04-10 00:17:06 +00:00
|
|
|
private:
|
|
|
|
CResLoader x4_resLoader;
|
|
|
|
CFactoryMgr x5c_factoryMgr;
|
2022-09-05 04:01:13 +00:00
|
|
|
uint x94_;
|
|
|
|
uint x98_;
|
|
|
|
uint x9c_;
|
|
|
|
uint xa0_;
|
|
|
|
uint xa4_;
|
|
|
|
uint xa8_;
|
|
|
|
uint xac_;
|
2022-10-19 03:35:06 +00:00
|
|
|
rstl::list< unkptr > xb0_;
|
2022-04-10 00:17:06 +00:00
|
|
|
};
|
2022-09-13 04:26:54 +00:00
|
|
|
CHECK_SIZEOF(CResFactory, 0xc8);
|
2022-04-10 00:17:06 +00:00
|
|
|
|
|
|
|
extern CResFactory* gpResourceFactory;
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CRESFACTORY
|