mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 04:34:48 +00:00
Merge pull request #1455 from marauder2k9-torque/BUGFIX-Reported-by-Wizk-13052025
BUG: Reported by Wizk 13/05/2025
This commit is contained in:
commit
5e2e82bf7a
|
|
@ -249,7 +249,11 @@ public:
|
|||
void _set##name(StringTableEntry _in){ \
|
||||
if(m##name##Asset.getAssetId() == _in) \
|
||||
return; \
|
||||
\
|
||||
if(_in == NULL || _in == StringTable->EmptyString()) \
|
||||
{ \
|
||||
m##name##Asset = NULL; \
|
||||
return; \
|
||||
} \
|
||||
if(!AssetDatabase.isDeclaredAsset(_in)) \
|
||||
{ \
|
||||
StringTableEntry imageAssetId = StringTable->EmptyString(); \
|
||||
|
|
@ -285,7 +289,8 @@ public:
|
|||
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; } \
|
||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data)); return false;}
|
||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data)); return false;} \
|
||||
StringTableEntry get##name##File(){ return m##name##Asset.notNull() ? m##name##Asset->getImageFile() : ""; }
|
||||
|
||||
|
||||
#define DECLARE_IMAGEASSET_NET(className, name, profile, mask) \
|
||||
|
|
@ -295,6 +300,12 @@ public:
|
|||
void _set##name(StringTableEntry _in){ \
|
||||
if(m##name##Asset.getAssetId() == _in) \
|
||||
return; \
|
||||
if(_in == NULL || _in == StringTable->EmptyString()) \
|
||||
{ \
|
||||
m##name##Asset = NULL; \
|
||||
setMaskBits(mask); \
|
||||
return; \
|
||||
} \
|
||||
if(!AssetDatabase.isDeclaredAsset(_in)) \
|
||||
{ \
|
||||
StringTableEntry imageAssetId = StringTable->EmptyString(); \
|
||||
|
|
@ -331,7 +342,8 @@ public:
|
|||
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; } \
|
||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data)); return false;}
|
||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data)); return false;} \
|
||||
StringTableEntry get##name##File(){ return m##name##Asset.notNull() ? m##name##Asset->getImageFile() : ""; }
|
||||
|
||||
|
||||
#define INITPERSISTFIELD_IMAGEASSET(name, consoleClass, docs) \
|
||||
|
|
@ -345,6 +357,11 @@ public:
|
|||
void _set##name(StringTableEntry _in, const U32& index){ \
|
||||
if(m##name##Asset[index].getAssetId() == _in) \
|
||||
return; \
|
||||
if(_in == NULL || _in == StringTable->EmptyString()) \
|
||||
{ \
|
||||
m##name##Asset[index] = NULL; \
|
||||
return; \
|
||||
} \
|
||||
if(!AssetDatabase.isDeclaredAsset(_in)) \
|
||||
{ \
|
||||
StringTableEntry imageAssetId = StringTable->EmptyString(); \
|
||||
|
|
@ -381,7 +398,8 @@ public:
|
|||
GFXTexHandle get##name(const U32& index) { return get##name(&profile, index); } \
|
||||
GFXTexHandle get##name(GFXTextureProfile* requestedProfile, const U32& index) { return m##name##Asset[index].notNull() ? m##name##Asset[index]->getTexture(requestedProfile) : NULL; }\
|
||||
AssetPtr<ImageAsset> get##name##Asset(const U32& index) { return m##name##Asset[index]; } \
|
||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data), dAtoi(index)); return false;}
|
||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data), dAtoi(index)); return false;}\
|
||||
StringTableEntry get##name##File(const U32& idx){ return m##name##Asset[idx].notNull() ? m##name##Asset[idx]->getImageFile() : ""; }
|
||||
|
||||
|
||||
#define DECLARE_IMAGEASSET_ARRAY_NET(className, name, profile, max, mask) \
|
||||
|
|
@ -391,6 +409,12 @@ public:
|
|||
void _set##name(StringTableEntry _in, const U32& index){ \
|
||||
if(m##name##Asset[index].getAssetId() == _in) \
|
||||
return; \
|
||||
if(_in == NULL || _in == StringTable->EmptyString()) \
|
||||
{ \
|
||||
m##name##Asset[index] = NULL; \
|
||||
setMaskBits(mask); \
|
||||
return; \
|
||||
} \
|
||||
if(!AssetDatabase.isDeclaredAsset(_in)) \
|
||||
{ \
|
||||
StringTableEntry imageAssetId = StringTable->EmptyString(); \
|
||||
|
|
@ -428,7 +452,8 @@ public:
|
|||
GFXTexHandle get##name(const U32& index) { return m##name##Asset[index].notNull() ? m##name##Asset[index]->getTexture(&profile) : NULL; } \
|
||||
GFXTexHandle get##name(GFXTextureProfile* requestedProfile, const U32& index) { return m##name##Asset[index].notNull() ? m##name##Asset[index]->getTexture(requestedProfile) : NULL; }\
|
||||
AssetPtr<ImageAsset> get##name##Asset(const U32& index) { return m##name##Asset[index]; } \
|
||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data), dAtoi(index)); return false;}
|
||||
static bool _set##name##Data(void* obj, const char* index, const char* data) { static_cast<className*>(obj)->_set##name(_getStringTable()->insert(data), dAtoi(index)); return false;}\
|
||||
StringTableEntry get##name##File(const U32& idx){ return m##name##Asset[idx].notNull() ? m##name##Asset[idx]->getImageFile() : ""; }
|
||||
|
||||
|
||||
#define INITPERSISTFIELD_IMAGEASSET_ARRAY(name, arraySize, consoleClass, docs) \
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ for (U32 i = 0; i < max; i++)\
|
|||
#define DEF_ASSET_BINDS_REFACTOR(className,name)\
|
||||
DefineEngineMethod(className, get##name, StringTableEntry, (), , "get name")\
|
||||
{\
|
||||
return object->get##name##Asset()->getImageFile(); \
|
||||
return object->get##name##File(); \
|
||||
}\
|
||||
DefineEngineMethod(className, get##name##Asset, StringTableEntry, (), , assetText(name, asset reference))\
|
||||
{\
|
||||
|
|
|
|||
|
|
@ -119,6 +119,8 @@ void AssetManager::onRemove()
|
|||
mAssetTagsManifest->deleteObject();
|
||||
}
|
||||
|
||||
purgeAssets();
|
||||
|
||||
// Call parent.
|
||||
Parent::onRemove();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,6 +138,8 @@ private: AssetPtr<ImageAsset> mBitmapAsset; public: void _setBitmap(StringTableE
|
|||
} static bool _setBitmapData(void* obj, const char* index, const char* data) {
|
||||
static_cast<GuiBitmapButtonCtrl*>(obj)->_setBitmap(_getStringTable()->insert(data)); return false;
|
||||
}
|
||||
StringTableEntry getBitmapFile() { return mBitmapAsset.notNull() ? mBitmapAsset->getImageFile() : ""; }
|
||||
|
||||
protected:
|
||||
|
||||
void onAssetRefreshed(AssetPtrBase* pAssetPtrBase) override
|
||||
|
|
|
|||
|
|
@ -701,7 +701,7 @@ DefineEngineMethod( GuiControlProfile, getStringWidth, S32, (const char* string)
|
|||
|
||||
DefineEngineMethod(GuiControlProfile, getBitmap, const char*, (), , "get name")
|
||||
{
|
||||
return object->getBitmapAsset()->getImageFile();
|
||||
return object->getBitmapFile();
|
||||
}
|
||||
DefineEngineMethod(GuiControlProfile, getBitmapAsset, const char*, (), , "")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -477,9 +477,9 @@ void ProcessedMaterial::_setStageData()
|
|||
inputKey[1] = mMaterial->mRoughnessChan[i];
|
||||
inputKey[2] = mMaterial->mMetalChan[i];
|
||||
inputKey[3] = 0;
|
||||
mStages[i].setTex(MFT_OrmMap, _createCompositeTexture( mMaterial->getAOMapAsset(i)->getImageFile(), mMaterial->getRoughMapAsset(i)->getImageFile(),
|
||||
mMaterial->getMetalMapAsset(i)->getImageFile(), "",
|
||||
inputKey, profile));
|
||||
mStages[i].setTex(MFT_OrmMap,
|
||||
_createCompositeTexture(mMaterial->getAOMapFile(i), mMaterial->getRoughMapFile(i), mMaterial->getMetalMapFile(i),
|
||||
"", inputKey, profile));
|
||||
if (!mStages[i].getTex(MFT_OrmMap))
|
||||
mMaterial->logError("Failed to dynamically create ORM Config map for stage %i", i);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue