Merge branch 'Preview4_0' into bugfix-crash-variableinspector

This commit is contained in:
Robert MacGregor 2021-11-08 15:42:44 -05:00 committed by GitHub
commit 2c7dc4e783
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 414 additions and 281 deletions

View file

@ -42,7 +42,7 @@ private:
protected:
DECLARE_IMAGEASSET(GuiIconButtonCtrl, Bitmap, onImageChanged, GFXTexturePersistentSRGBProfile);
DECLARE_IMAGEASSET(GuiIconButtonCtrl, Bitmap, onImageChanged, GFXDefaultGUIProfile);
DECLARE_ASSET_SETGET(GuiIconButtonCtrl, Bitmap);
S32 mIconLocation;

View file

@ -39,11 +39,11 @@ private:
protected:
DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, NormalBitmap, onNormalImageChanged, GFXTexturePersistentSRGBProfile);
DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, NormalBitmap, onNormalImageChanged, GFXDefaultGUIProfile);
DECLARE_ASSET_SETGET(GuiToolboxButtonCtrl, NormalBitmap);
DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, LoweredBitmap, onLoweredImageChanged, GFXTexturePersistentSRGBProfile);
DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, LoweredBitmap, onLoweredImageChanged, GFXDefaultGUIProfile);
DECLARE_ASSET_SETGET(GuiToolboxButtonCtrl, LoweredBitmap);
DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, HoverBitmap, onHoverImageChanged, GFXTexturePersistentSRGBProfile);
DECLARE_IMAGEASSET(GuiToolboxButtonCtrl, HoverBitmap, onHoverImageChanged, GFXDefaultGUIProfile);
DECLARE_ASSET_SETGET(GuiToolboxButtonCtrl, HoverBitmap);
void renderButton(GFXTexHandle &texture, Point2I &offset, const RectI& updateRect);

View file

@ -543,7 +543,8 @@ Point2I GuiGameListMenuCtrl::getMinExtent() const
{
Point2I parentMin = Parent::getMinExtent();
GuiGameListMenuProfile * profile = (GuiGameListMenuProfile *) mProfile;
GuiGameListMenuProfile * profile = dynamic_cast<GuiGameListMenuProfile*>(mProfile);
AssertFatal(profile, "Invalid profile for GuiGameListMenuCtrl!");
S32 minHeight = 0;
S32 rowHeight = profile->getRowHeight();
@ -632,10 +633,13 @@ void GuiGameListMenuCtrl::enforceConstraints()
void GuiGameListMenuCtrl::updateHeight()
{
S32 minHeight = getMinExtent().y;
if (getHeight() < minHeight)
if (hasValidProfile())
{
setHeight(minHeight);
S32 minHeight = getMinExtent().y;
if (getHeight() < minHeight)
{
setHeight(minHeight);
}
}
}

View file

@ -278,8 +278,8 @@ GuiPopUpMenuCtrl::GuiPopUpMenuCtrl(void)
mBackgroundCancel = false; // Added
mReverseTextList = false; // Added - Don't reverse text list if displaying up
INIT_ASSET_ARRAY(Bitmap, 0);
INIT_ASSET_ARRAY(Bitmap, 1);
INIT_IMAGEASSET_ARRAY(Bitmap, GFXDefaultGUIProfile, 0);
INIT_IMAGEASSET_ARRAY(Bitmap, GFXDefaultGUIProfile, 1);
mBitmapBounds.set(16, 16); // Added
mIdMax = -1;

View file

@ -126,7 +126,7 @@ protected:
NumBitmapModes = 2
};
DECLARE_IMAGEASSET_ARRAY(GuiPopUpMenuCtrl, Bitmap, GFXDefaultGUIProfile, NumBitmapModes);
DECLARE_IMAGEASSET_ARRAY(GuiPopUpMenuCtrl, Bitmap, NumBitmapModes);
DECLARE_IMAGEASSET_ARRAY_SETGET(GuiPopUpMenuCtrl, Bitmap);
Point2I mBitmapBounds; // Added

View file

@ -329,8 +329,8 @@ GuiPopUpMenuCtrlEx::GuiPopUpMenuCtrlEx(void)
mBackgroundCancel = false; // Added
mReverseTextList = false; // Added - Don't reverse text list if displaying up
INIT_ASSET_ARRAY(Bitmap, Normal);
INIT_ASSET_ARRAY(Bitmap, Depressed);
INIT_IMAGEASSET_ARRAY(Bitmap, GFXDefaultGUIProfile, Normal);
INIT_IMAGEASSET_ARRAY(Bitmap, GFXDefaultGUIProfile, Depressed);
mBitmapBounds.set(16, 16); // Added
mHotTrackItems = false;

View file

@ -127,7 +127,7 @@ class GuiPopUpMenuCtrlEx : public GuiTextCtrl
NumBitmapModes = 2
};
DECLARE_IMAGEASSET_ARRAY(GuiPopUpMenuCtrlEx, Bitmap, GFXDefaultGUIProfile, NumBitmapModes);
DECLARE_IMAGEASSET_ARRAY(GuiPopUpMenuCtrlEx, Bitmap, NumBitmapModes);
DECLARE_IMAGEASSET_ARRAY_SETGET(GuiPopUpMenuCtrlEx, Bitmap);
Point2I mBitmapBounds; // Added

View file

@ -1880,7 +1880,7 @@ bool GuiTreeViewCtrl::buildIconTable(const char * icons)
dStrncpy( buf, start, getMin( sizeof( buf ) / sizeof( buf[ 0 ] ) - 1, len ) );
buf[ len ] = '\0';
mIconTable[ numIcons ] = GFXTexHandle( buf, &GFXTexturePersistentProfile, avar( "%s() - mIconTable[%d] (line %d)", __FUNCTION__, numIcons, __LINE__ ) );
mIconTable[ numIcons ] = GFXTexHandle( buf, &GFXDefaultGUIProfile, avar( "%s() - mIconTable[%d] (line %d)", __FUNCTION__, numIcons, __LINE__ ) );
}
else
mIconTable[ numIcons ] = GFXTexHandle();

View file

@ -68,7 +68,7 @@ GFX_ImplementTextureProfile(GFXGuiCursorProfile,
GFX_ImplementTextureProfile(GFXDefaultGUIProfile,
GFXTextureProfile::DiffuseMap,
GFXTextureProfile::PreserveSize |
GFXTextureProfile::Static | GFXTextureProfile::SRGB |
GFXTextureProfile::Static | GFXTextureProfile::KeepBitmap | GFXTextureProfile::SRGB |
GFXTextureProfile::NoPadding,
GFXTextureProfile::NONE);

View file

@ -455,7 +455,7 @@ public:
StringTableEntry mBitmapName;
StringTableEntry mBitmapAssetId;
AssetPtr<ImageAsset> mBitmapAsset;
GFXTextureProfile* mBitmapProfile = &GFXTexturePersistentSRGBProfile;
GFXTextureProfile* mBitmapProfile = &GFXDefaultGUIProfile;
public:
const StringTableEntry getBitmapFile() const { return mBitmapName; }
void setBitmapFile(const FileName& _in) { mBitmapName = StringTable->insert(_in.c_str()); }

View file

@ -25,7 +25,7 @@
#include "console/engineAPI.h"
#include "console/simBase.h"
#include "gui/core/guiTypes.h"
EditorIconRegistry gEditorIcons;
@ -60,7 +60,7 @@ void EditorIconRegistry::loadFromPath( const String &path, bool overwrite )
String defaultIconFile = path + "default";
mDefaultIcon.set( defaultIconFile,
&GFXTexturePersistentSRGBProfile,
&GFXDefaultGUIProfile,
avar("%s() - mIcons[] (line %d)",
__FUNCTION__, __LINE__) );
}
@ -68,7 +68,7 @@ void EditorIconRegistry::loadFromPath( const String &path, bool overwrite )
void EditorIconRegistry::add( const String &className, const String &imageFile, bool overwrite )
{
// First see if we can load the image.
GFXTexHandle icon( imageFile, &GFXTexturePersistentSRGBProfile,
GFXTexHandle icon( imageFile, &GFXDefaultGUIProfile,
avar("%s() - mIcons[] (line %d)", __FUNCTION__, __LINE__) );
if ( icon.isNull() )
return;

View file

@ -63,7 +63,7 @@ protected:
GFXStateBlockRef mBlendStateBlock;
GFXStateBlockRef mSolidStateBlock;
DECLARE_IMAGEASSET(GuiMissionAreaCtrl, HandleBitmap, onHandleBitmapChanged, GFXTexturePersistentSRGBProfile);
DECLARE_IMAGEASSET(GuiMissionAreaCtrl, HandleBitmap, onHandleBitmapChanged, GFXDefaultGUIProfile);
DECLARE_ASSET_SETGET(GuiMissionAreaCtrl, HandleBitmap);
Point2I mHandleTextureSize;