Make AbstractAssetDumper use the XAssetInfo instead of the raw asset pointer to be able to access dependencies and scriptstrings

This commit is contained in:
Jan
2020-10-20 12:48:53 +02:00
parent ab217bb1a9
commit d942c5a625
27 changed files with 146 additions and 135 deletions

View File

@ -31,17 +31,19 @@ AssetDumperGfxImage::~AssetDumperGfxImage()
m_writer = nullptr;
}
bool AssetDumperGfxImage::ShouldDump(GfxImage* asset)
bool AssetDumperGfxImage::ShouldDump(XAssetInfo<GfxImage>* asset)
{
return asset->loadedSize > 0;
const auto* image = asset->Asset();
return image->loadedSize > 0;
}
std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, GfxImage* asset)
std::string AssetDumperGfxImage::GetFileNameForAsset(Zone* zone, XAssetInfo<GfxImage>* asset)
{
return "images/" + std::string(asset->name) + m_writer->GetFileExtension();
return "images/" + asset->m_name + m_writer->GetFileExtension();
}
void AssetDumperGfxImage::DumpAsset(Zone* zone, GfxImage* asset, FileAPI::File* out)
void AssetDumperGfxImage::DumpAsset(Zone* zone, XAssetInfo<GfxImage>* asset, FileAPI::File* out)
{
m_writer->DumpImage(out, asset->texture.texture);
const auto* image = asset->Asset();
m_writer->DumpImage(out, image->texture.texture);
}