diff --git a/src/ZoneCode/Game/T6/T6_Commands.txt b/src/ZoneCode/Game/T6/T6_Commands.txt index c710bda0..1b01fcf0 100644 --- a/src/ZoneCode/Game/T6/T6_Commands.txt +++ b/src/ZoneCode/Game/T6/T6_Commands.txt @@ -363,6 +363,7 @@ set reusable u::literalConst; // GfxImage // ========================================= use GfxImage; +set action OnImageLoaded(GfxImage); set string name; set name name; set condition pixels never; diff --git a/src/ZoneCodeGenerator/Generating/Templates/ZoneLoad.stg b/src/ZoneCodeGenerator/Generating/Templates/ZoneLoad.stg index cd4df5ec..85c5feba 100644 --- a/src/ZoneCodeGenerator/Generating/Templates/ZoneLoad.stg +++ b/src/ZoneCodeGenerator/Generating/Templates/ZoneLoad.stg @@ -206,6 +206,10 @@ void $LoaderClassName(context.Asset)$::LoadPtr_$structure.Type.Name$(const bool Load_$structure.Type.Name$(true); $endif$ + $if(structure.PostLoadAction)$ + $CustomAction(structure.PostLoadAction)$ + $endif$ + $if(structure.IsAsset)$ LoadAsset_$structure.Type.Name$($TypePtrVarName(structure.Type)$); $endif$ diff --git a/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.cpp b/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.cpp index d592ac1b..2b3ae020 100644 --- a/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.cpp +++ b/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.cpp @@ -1,10 +1,16 @@ #include "gfximage_actions.h" +#include Actions_GfxImage::Actions_GfxImage(Zone* zone) : AssetLoadingActions(zone) { } +void Actions_GfxImage::OnImageLoaded(T6::GfxImage* image) const +{ + image->loadedSize = 0; +} + void Actions_GfxImage::LoadImageData(T6::GfxImageLoadDef* loadDef, T6::GfxImage* image) const { if(loadDef->resourceSize > 0) diff --git a/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.h b/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.h index ca00fea8..71ff3f29 100644 --- a/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.h +++ b/src/ZoneLoading/Game/T6/XAssets/gfximage/gfximage_actions.h @@ -8,5 +8,6 @@ class Actions_GfxImage final : public AssetLoadingActions public: explicit Actions_GfxImage(Zone* zone); + void OnImageLoaded(T6::GfxImage* image) const; void LoadImageData(T6::GfxImageLoadDef* loadDef, T6::GfxImage* image) const; }; \ No newline at end of file