浏览代码

GuiBitmapCtrl named texture fixes.
Adds StringTableEntry when bitmap is set via setBitmapHandle.
Prevents existing bitmap handles from being dropped in onWake (they are preserved in onSleep).

OTHGMars 3 年之前
父节点
当前提交
bed3be278c
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      Engine/source/gui/controls/guiBitmapCtrl.cpp

+ 3 - 2
Engine/source/gui/controls/guiBitmapCtrl.cpp

@@ -98,7 +98,8 @@ bool GuiBitmapCtrl::onWake()
       return false;
    setActive(true);
 
-   setBitmap(getBitmap());
+   if (mBitmapName != StringTable->insert("texhandle"))
+      setBitmap(getBitmap());
    return true;
 }
 
@@ -152,7 +153,7 @@ void GuiBitmapCtrl::setBitmapHandle(GFXTexHandle handle, bool resize)
 {
    mBitmap = handle;
 
-   mBitmapName = String("texhandle");
+   mBitmapName = StringTable->insert("texhandle");
 
    // Resize the control to fit the bitmap
    if (resize)