From bed3be278c5d6395e34fb15b81b38a71bf25cc7e Mon Sep 17 00:00:00 2001 From: OTHGMars Date: Fri, 21 Jan 2022 19:47:41 -0500 Subject: [PATCH] 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). --- Engine/source/gui/controls/guiBitmapCtrl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Engine/source/gui/controls/guiBitmapCtrl.cpp b/Engine/source/gui/controls/guiBitmapCtrl.cpp index 82a106bcf..499311831 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.cpp +++ b/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)