mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-24 22:59:24 +00:00
Merge branch 'DirectImageFileOption' of https://github.com/Areloch/Torque3D into development
This commit is contained in:
commit
5397c168bc
10 changed files with 65 additions and 149 deletions
|
|
@ -118,7 +118,11 @@ class GuiBitmapButtonCtrl : public GuiButtonCtrl, protected AssetPtrCallback
|
|||
///
|
||||
BitmapMode mBitmapMode;
|
||||
|
||||
private: AssetPtr<ImageAsset> mBitmapAsset; public: void _setBitmap(StringTableEntry _in) {
|
||||
private:
|
||||
AssetPtr<ImageAsset> mBitmapAsset;
|
||||
String mBitmapFile;
|
||||
public:
|
||||
void _setBitmap(StringTableEntry _in) {
|
||||
if (mBitmapAsset.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];
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ void GuiBitmapCtrl::setBitmap(const char* name, bool resize)
|
|||
if (assetId != StringTable->EmptyString())
|
||||
_setBitmap(assetId);
|
||||
else
|
||||
return;
|
||||
_setBitmap(name);
|
||||
}
|
||||
|
||||
mBitmap = mBitmapAsset->getTexture(&GFXDefaultGUIProfile);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue