metaforce/Runtime/CResLoader.hpp

52 lines
2.0 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CRESLOADER_HPP__
#define __URDE_CRESLOADER_HPP__
2015-08-23 06:42:29 +00:00
#include <memory>
#include <string>
#include "RetroTypes.hpp"
#include "CPakFile.hpp"
2015-08-23 23:58:07 +00:00
#include "IOStreams.hpp"
2015-08-23 06:42:29 +00:00
2016-03-04 23:04:53 +00:00
namespace urde
2015-08-23 06:42:29 +00:00
{
2015-08-31 03:44:42 +00:00
struct SObjectTag;
class IDvdRequest;
2015-08-23 06:42:29 +00:00
class CResLoader
{
std::string m_loaderPath;
2017-02-08 06:48:43 +00:00
//std::list<std::unique_ptr<CPakFile>> x0_aramList;
std::list<std::unique_ptr<CPakFile>> x18_pakLoadedList;
std::list<std::unique_ptr<CPakFile>> x30_pakLoadingList;
2015-08-23 06:42:29 +00:00
u32 x44_pakLoadingCount = 0;
u32 x4c_cachedResId = -1;
const CPakFile::SResInfo* x50_cachedResInfo = nullptr;
public:
2015-08-23 23:58:07 +00:00
const std::vector<u32>* GetTagListForFile(const std::string& name) const;
2017-02-08 06:48:43 +00:00
void AddPakFileAsync(const std::string& name, bool samusPak, bool worldPak);
void AddPakFile(const std::string& name, bool samusPak, bool worldPak);
2015-08-23 23:58:07 +00:00
CInputStream* LoadNewResourcePartSync(const SObjectTag& tag, int offset, int length, void* extBuf);
void LoadMemResourceSync(const SObjectTag& tag, void** bufOut, int* sizeOut);
CInputStream* LoadResourceFromMemorySync(const SObjectTag& tag, const void* buf);
CInputStream* LoadNewResourceSync(const SObjectTag& tag, void* extBuf=nullptr);
2016-03-07 03:12:32 +00:00
std::shared_ptr<IDvdRequest> LoadResourcePartAsync(const SObjectTag& tag, int offset, int length, void* buf);
std::shared_ptr<IDvdRequest> LoadResourceAsync(const SObjectTag& tag, void* buf);
2015-08-23 23:58:07 +00:00
bool GetResourceCompression(const SObjectTag& tag);
u32 ResourceSize(const SObjectTag& tag);
bool ResourceExists(const SObjectTag& tag);
2016-04-14 21:42:47 +00:00
FourCC GetResourceTypeById(u32 id) const;
2015-08-28 00:11:31 +00:00
const SObjectTag* GetResourceIdByName(const char* name) const;
2015-08-23 23:58:07 +00:00
bool AreAllPaksLoaded() const;
void AsyncIdlePakLoading();
2016-04-14 21:42:47 +00:00
bool FindResource(u32 id) const;
2015-08-23 23:58:07 +00:00
CPakFile* FindResourceForLoad(u32 id);
CPakFile* FindResourceForLoad(const SObjectTag& tag);
bool CacheFromPakForLoad(CPakFile& file, u32 id);
bool CacheFromPak(const CPakFile& file, u32 id);
void MoveToCorrectLoadedList(std::unique_ptr<CPakFile>&& file);
2015-08-23 06:42:29 +00:00
};
}
2016-04-13 06:07:23 +00:00
#endif // __URDE_CRESLOADER_HPP__