Load GfxImageLoadDef for all supported games

This commit is contained in:
Jan 2021-04-28 18:19:30 +02:00
parent 156d7aa5cd
commit 843b861b1b
3 changed files with 6 additions and 28 deletions

View File

@ -17,15 +17,8 @@ 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(IW3::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;
}
}

View File

@ -17,15 +17,8 @@ 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(IW4::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;
}
}

View File

@ -17,14 +17,6 @@ void Actions_GfxImage::OnImageLoaded(GfxImage* image) const
void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, GfxImage* image) const
{
// 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));