mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
cloud layer example
This commit is contained in:
parent
eca0820134
commit
24b374f545
4 changed files with 45 additions and 18 deletions
|
|
@ -592,7 +592,26 @@ if (m##name##AssetId[index] != StringTable->EmptyString())\
|
|||
private: \
|
||||
AssetPtr<ImageAsset> m##name##Asset; \
|
||||
public: \
|
||||
void _set##name(StringTableEntry _in); \
|
||||
void _set##name(StringTableEntry _in){ \
|
||||
if(m##name##Asset.getAssetId() == _in) \
|
||||
return; \
|
||||
\
|
||||
if(!AssetDatabase.isDeclaredAsset(_in)) \
|
||||
{ \
|
||||
StringTableEntry imageAssetId = ImageAsset::smNoImageAssetFallback; \
|
||||
AssetQuery query; \
|
||||
S32 foundAssetcount = AssetDatabase.findAssetLooseFile(&query, _in); \
|
||||
if (foundAssetcount != 0) \
|
||||
{ \
|
||||
imageAssetId = query.mAssetList[0]; \
|
||||
} \
|
||||
m##name##Asset = imageAssetId; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
m##name##Asset = _in; \
|
||||
} \
|
||||
}; \
|
||||
inline StringTableEntry _get##name(void) const { return m##name##Asset.getAssetId(); } \
|
||||
GFXTexHandle get##name() { return m##name##Asset.notNull() ? m##name##Asset->getTexture(&profile) : NULL; } \
|
||||
AssetPtr<ImageAsset> get##name##Asset(void) { return m##name##Asset; } \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue