mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
ZoneCode: Add Action on loading a GfxImage to set the loadedSize property to 0 to indicate Texture data has not yet been loaded
This commit is contained in:
parent
75f6caab54
commit
55d5746650
@ -363,6 +363,7 @@ set reusable u::literalConst;
|
|||||||
// GfxImage
|
// GfxImage
|
||||||
// =========================================
|
// =========================================
|
||||||
use GfxImage;
|
use GfxImage;
|
||||||
|
set action OnImageLoaded(GfxImage);
|
||||||
set string name;
|
set string name;
|
||||||
set name name;
|
set name name;
|
||||||
set condition pixels never;
|
set condition pixels never;
|
||||||
|
@ -206,6 +206,10 @@ void $LoaderClassName(context.Asset)$::LoadPtr_$structure.Type.Name$(const bool
|
|||||||
Load_$structure.Type.Name$(true);
|
Load_$structure.Type.Name$(true);
|
||||||
$endif$
|
$endif$
|
||||||
|
|
||||||
|
$if(structure.PostLoadAction)$
|
||||||
|
$CustomAction(structure.PostLoadAction)$
|
||||||
|
$endif$
|
||||||
|
|
||||||
$if(structure.IsAsset)$
|
$if(structure.IsAsset)$
|
||||||
LoadAsset_$structure.Type.Name$($TypePtrVarName(structure.Type)$);
|
LoadAsset_$structure.Type.Name$($TypePtrVarName(structure.Type)$);
|
||||||
$endif$
|
$endif$
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
#include "gfximage_actions.h"
|
#include "gfximage_actions.h"
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
Actions_GfxImage::Actions_GfxImage(Zone* zone)
|
Actions_GfxImage::Actions_GfxImage(Zone* zone)
|
||||||
: AssetLoadingActions(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
|
void Actions_GfxImage::LoadImageData(T6::GfxImageLoadDef* loadDef, T6::GfxImage* image) const
|
||||||
{
|
{
|
||||||
if(loadDef->resourceSize > 0)
|
if(loadDef->resourceSize > 0)
|
||||||
|
@ -8,5 +8,6 @@ class Actions_GfxImage final : public AssetLoadingActions
|
|||||||
public:
|
public:
|
||||||
explicit Actions_GfxImage(Zone* zone);
|
explicit Actions_GfxImage(Zone* zone);
|
||||||
|
|
||||||
|
void OnImageLoaded(T6::GfxImage* image) const;
|
||||||
void LoadImageData(T6::GfxImageLoadDef* loadDef, T6::GfxImage* image) const;
|
void LoadImageData(T6::GfxImageLoadDef* loadDef, T6::GfxImage* image) const;
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user