mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 00:25:44 +00:00
Load GfxImageLoadDef for all supported games
This commit is contained in:
parent
156d7aa5cd
commit
843b861b1b
@ -17,15 +17,8 @@ void Actions_GfxImage::OnImageLoaded(GfxImage* image) const
|
|||||||
|
|
||||||
void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, 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;
|
const size_t loadDefSize = offsetof(IW3::GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||||
|
|
||||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||||
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
image->texture.loadDef = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -17,15 +17,8 @@ void Actions_GfxImage::OnImageLoaded(GfxImage* image) const
|
|||||||
|
|
||||||
void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, 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;
|
const size_t loadDefSize = offsetof(IW4::GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||||
|
|
||||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||||
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
image->texture.loadDef = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,6 @@ void Actions_GfxImage::OnImageLoaded(GfxImage* image) const
|
|||||||
|
|
||||||
void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, 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;
|
const size_t loadDefSize = offsetof(T6::GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||||
|
|
||||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user