2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-11-30 16:27:47 +00:00

refactor: image and obj data loading

This commit is contained in:
Jan
2024-09-24 12:01:42 +01:00
parent 5fee875495
commit 5cc52c42cd
97 changed files with 1784 additions and 1878 deletions

View File

@@ -35,10 +35,8 @@ bool AssetLoaderGfxImage::LoadFromRaw(
const auto fileData = std::make_unique<char[]>(fileSize);
file.m_stream->read(fileData.get(), fileSize);
MemoryManager tempMemory;
IwiLoader iwiLoader(&tempMemory);
std::istringstream ss(std::string(fileData.get(), fileSize));
const auto texture = iwiLoader.LoadIwi(ss);
const auto texture = iwi::LoadIwi(ss);
if (!texture)
{
std::cerr << std::format("Failed to load texture from: {}\n", fileName);

View File

@@ -227,7 +227,7 @@ bool AssetLoaderMenuList::LoadFromRaw(
return true;
}
void AssetLoaderMenuList::FinalizeAssetsForZone(AssetLoadingContext* context) const
void AssetLoaderMenuList::FinalizeAssetsForZone(AssetLoadingContext& context) const
{
context->GetZoneAssetLoaderState<MenuConversionZoneState>()->FinalizeSupportingData();
context.GetZoneAssetLoaderState<MenuConversionZoneState>()->FinalizeSupportingData();
}

View File

@@ -14,6 +14,6 @@ namespace IW5
_NODISCARD bool CanLoadFromRaw() const override;
bool
LoadFromRaw(const std::string& assetName, ISearchPath* searchPath, MemoryManager* memory, IAssetLoadingManager* manager, Zone* zone) const override;
void FinalizeAssetsForZone(AssetLoadingContext* context) const override;
void FinalizeAssetsForZone(AssetLoadingContext& context) const override;
};
} // namespace IW5