Make asset dumpers not provide different implementations for dumping to gdt and raw so any dumper can decide itself how many raw files and gdt entries it wants to make use of

This commit is contained in:
Jan
2021-07-31 12:34:22 +02:00
parent e544d043bd
commit e324c20641
79 changed files with 667 additions and 979 deletions

View File

@ -7,18 +7,14 @@ bool AssetDumperRawFile::ShouldDump(XAssetInfo<RawFile>* asset)
return true;
}
bool AssetDumperRawFile::CanDumpAsRaw()
{
return true;
}
std::string AssetDumperRawFile::GetFileNameForAsset(Zone* zone, XAssetInfo<RawFile>* asset)
{
return asset->m_name;
}
void AssetDumperRawFile::DumpRaw(AssetDumpingContext& context, XAssetInfo<RawFile>* asset, std::ostream& stream)
void AssetDumperRawFile::DumpAsset(AssetDumpingContext& context, XAssetInfo<RawFile>* asset)
{
const auto* rawFile = asset->Asset();
const auto assetFile = context.OpenAssetFile(asset->m_name);
if (!assetFile)
return;
auto& stream = *assetFile;
stream.write(rawFile->buffer, rawFile->len);
}