mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-12 07:48:16 -05:00
ObjLoading: Add basis for IPakEntryReadStream to read ipak entries
This commit is contained in:
@ -7,18 +7,35 @@ IwiLoader::IwiLoader(MemoryManager* memoryManager)
|
||||
|
||||
Texture* IwiLoader::LoadIwi(FileAPI::IFile* file)
|
||||
{
|
||||
struct
|
||||
struct IWIHeaderMeta
|
||||
{
|
||||
char tag[3];
|
||||
char version;
|
||||
} iwiHeaderMeta{};
|
||||
|
||||
if (file->Read(&iwiHeaderMeta, sizeof iwiHeaderMeta, 1) != 1)
|
||||
return nullptr;
|
||||
file->GotoEnd();
|
||||
auto iwiSize = static_cast<size_t>(file->Pos());
|
||||
file->Goto(0);
|
||||
|
||||
printf("Read IWI with version %i\n", iwiHeaderMeta.version);
|
||||
auto* buffer = new uint8_t[iwiSize];
|
||||
if(file->Read(buffer, 1, iwiSize) != iwiSize)
|
||||
{
|
||||
delete[] buffer;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto* meta = reinterpret_cast<IWIHeaderMeta*>(buffer);
|
||||
|
||||
printf("Read IWI with version %i\n", meta->version);
|
||||
|
||||
// TODO: Read iwi based on version
|
||||
|
||||
return nullptr;
|
||||
|
||||
// if (file->Read(&iwiHeaderMeta, sizeof iwiHeaderMeta, 1) != 1)
|
||||
// return nullptr;
|
||||
//
|
||||
// printf("Read IWI with version %i\n", iwiHeaderMeta.version);
|
||||
//
|
||||
// return nullptr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user