mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
Update ImageAsset.h
add check for if _in matches the filename that is already set for image asset, this stops the set being called twice when loading the same image asset
This commit is contained in:
parent
26e18cdfe8
commit
45f1447d2b
1 changed files with 9 additions and 1 deletions
|
|
@ -123,7 +123,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
static const String mErrCodeStrings[U32(ImageAssetErrCode::Extended) - U32(Parent::Extended) + 1];
|
static const String mErrCodeStrings[U32(ImageAssetErrCode::Extended) - U32(Parent::Extended) + 1];
|
||||||
static U32 getAssetErrCode(ConcreteAssetPtr checkAsset) { if (checkAsset) return checkAsset->mLoadedState; else return 0; }
|
static U32 getAssetErrCode(ConcreteAssetPtr checkAsset) { if (checkAsset.notNull()) return checkAsset->mLoadedState; else return 0; }
|
||||||
|
|
||||||
static String getAssetErrstrn(U32 errCode)
|
static String getAssetErrstrn(U32 errCode)
|
||||||
{
|
{
|
||||||
|
|
@ -241,6 +241,8 @@ public:
|
||||||
void _set##name(StringTableEntry _in){ \
|
void _set##name(StringTableEntry _in){ \
|
||||||
if(m##name##Asset.getAssetId() == _in) \
|
if(m##name##Asset.getAssetId() == _in) \
|
||||||
return; \
|
return; \
|
||||||
|
if(get##name##File() == _in) \
|
||||||
|
return; \
|
||||||
if(_in == NULL || _in == StringTable->EmptyString()) \
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
||||||
{ \
|
{ \
|
||||||
m##name##Asset = NULL; \
|
m##name##Asset = NULL; \
|
||||||
|
|
@ -296,6 +298,8 @@ public:
|
||||||
void _set##name(StringTableEntry _in){ \
|
void _set##name(StringTableEntry _in){ \
|
||||||
if(m##name##Asset.getAssetId() == _in) \
|
if(m##name##Asset.getAssetId() == _in) \
|
||||||
return; \
|
return; \
|
||||||
|
if(get##name##File() == _in) \
|
||||||
|
return; \
|
||||||
if(_in == NULL || _in == StringTable->EmptyString()) \
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
||||||
{ \
|
{ \
|
||||||
m##name##Asset = NULL; \
|
m##name##Asset = NULL; \
|
||||||
|
|
@ -358,6 +362,8 @@ public:
|
||||||
void _set##name(StringTableEntry _in, const U32& index){ \
|
void _set##name(StringTableEntry _in, const U32& index){ \
|
||||||
if(m##name##Asset[index].getAssetId() == _in) \
|
if(m##name##Asset[index].getAssetId() == _in) \
|
||||||
return; \
|
return; \
|
||||||
|
if(get##name##File(index) == _in) \
|
||||||
|
return; \
|
||||||
if(_in == NULL || _in == StringTable->EmptyString()) \
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
||||||
{ \
|
{ \
|
||||||
m##name##Asset[index] = NULL; \
|
m##name##Asset[index] = NULL; \
|
||||||
|
|
@ -414,6 +420,8 @@ public:
|
||||||
void _set##name(StringTableEntry _in, const U32& index){ \
|
void _set##name(StringTableEntry _in, const U32& index){ \
|
||||||
if(m##name##Asset[index].getAssetId() == _in) \
|
if(m##name##Asset[index].getAssetId() == _in) \
|
||||||
return; \
|
return; \
|
||||||
|
if(get##name##File(index) == _in) \
|
||||||
|
return; \
|
||||||
if(_in == NULL || _in == StringTable->EmptyString()) \
|
if(_in == NULL || _in == StringTable->EmptyString()) \
|
||||||
{ \
|
{ \
|
||||||
m##name##Asset[index] = NULL; \
|
m##name##Asset[index] = NULL; \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue