mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
ZoneLoading: Add implementation for LoadImageData action:
Duplicate any ImageLoadDef that contains data, otherwise discard temporary empty loaddef
This commit is contained in:
parent
b8c2557482
commit
d01f5c49a8
@ -5,6 +5,17 @@ Actions_GfxImage::Actions_GfxImage(Zone* zone)
|
||||
{
|
||||
}
|
||||
|
||||
void Actions_GfxImage::LoadImageData(T6::GfxImageLoadDef* loadDef, T6::GfxImage* image)
|
||||
void Actions_GfxImage::LoadImageData(T6::GfxImageLoadDef* loadDef, T6::GfxImage* image) const
|
||||
{
|
||||
if(loadDef->resourceSize > 0)
|
||||
{
|
||||
const size_t loadDefSize = offsetof(T6::GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||
|
||||
image->texture.loadDef = static_cast<T6::GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
image->texture.loadDef = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -8,5 +8,5 @@ class Actions_GfxImage final : public AssetLoadingActions
|
||||
public:
|
||||
explicit Actions_GfxImage(Zone* zone);
|
||||
|
||||
void LoadImageData(T6::GfxImageLoadDef* loadDef, T6::GfxImage* image);
|
||||
void LoadImageData(T6::GfxImageLoadDef* loadDef, T6::GfxImage* image) const;
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user