mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
roll back _setitmap macro-mirroring. seems there was somethin off there
This commit is contained in:
parent
d50161d296
commit
0e4b08ead1
2 changed files with 18 additions and 47 deletions
|
|
@ -262,51 +262,6 @@ void GuiBitmapButtonCtrl::setAutoFitExtents( bool state )
|
|||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void GuiBitmapButtonCtrl::_setBitmap(StringTableEntry _in)
|
||||
{
|
||||
if (mBitmapAsset.getAssetId() == _in)
|
||||
return;
|
||||
|
||||
if (getBitmapFile() == _in)
|
||||
return;
|
||||
|
||||
if (_in == 0 || !String::compare(_in, _getStringTable()->EmptyString()))
|
||||
{
|
||||
mBitmapAsset = 0;
|
||||
mBitmapFile = "";
|
||||
return;
|
||||
}
|
||||
if (!AssetDatabase.isDeclaredAsset(_in))
|
||||
{
|
||||
StringTableEntry imageAssetId = _getStringTable()->EmptyString();
|
||||
AssetQuery query;
|
||||
S32 foundAssetcount = AssetDatabase.findAssetLooseFile(&query, _in);
|
||||
if (foundAssetcount != 0)
|
||||
{
|
||||
imageAssetId = query.mAssetList[0];
|
||||
}
|
||||
else if (Torque::FS::IsFile(_in) || (_in[0] == '$' || _in[0] == '#'))
|
||||
{
|
||||
imageAssetId = ImageAsset::getAssetIdByFilename(_in);
|
||||
if (imageAssetId == ImageAsset::smNoImageAssetFallback)
|
||||
{
|
||||
ImageAsset* privateImage = new ImageAsset();
|
||||
privateImage->setImageFile(_in);
|
||||
imageAssetId = AssetDatabase.addPrivateAsset(privateImage);
|
||||
}
|
||||
}
|
||||
else {
|
||||
Con::warnf("%s::%s: Could not find asset for: %s using fallback", "GuiBitmapButtonCtrl", "Bitmap", _in);
|
||||
imageAssetId = ImageAsset::smNoImageAssetFallback;
|
||||
} mBitmapAsset = imageAssetId;
|
||||
mBitmapFile = _in;
|
||||
}
|
||||
else
|
||||
{
|
||||
mBitmapAsset = _in;
|
||||
mBitmapFile = getBitmapFile();
|
||||
}
|
||||
}
|
||||
|
||||
void GuiBitmapButtonCtrl::setBitmap( StringTableEntry name )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue