mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 16:15:43 +00:00
Always duplicate temp loaddef for T6 instead of only duplicating it if resource size is bigger than 0
This commit is contained in:
parent
1058ee7881
commit
6f6d25da4a
@ -17,15 +17,16 @@ void Actions_GfxImage::OnImageLoaded(GfxImage* image) const
|
||||
|
||||
void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, GfxImage* image) const
|
||||
{
|
||||
if(loadDef->resourceSize > 0)
|
||||
{
|
||||
const size_t loadDefSize = offsetof(T6::GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||
// if(loadDef->resourceSize > 0)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// image->texture.loadDef = nullptr;
|
||||
// }
|
||||
const size_t loadDefSize = offsetof(T6::GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
||||
}
|
||||
else
|
||||
{
|
||||
image->texture.loadDef = nullptr;
|
||||
}
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user