diff --git a/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.cpp b/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.cpp index ef1a98fa..d592ac1b 100644 --- a/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.cpp +++ b/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.cpp @@ -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(m_zone->GetMemory()->Alloc(loadDefSize)); + memcpy(image->texture.loadDef, loadDef, loadDefSize); + } + else + { + image->texture.loadDef = nullptr; + } } diff --git a/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.h b/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.h index 8a7cccf9..ca00fea8 100644 --- a/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.h +++ b/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.h @@ -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; }; \ No newline at end of file