code duplication prune. should aid in stability

This commit is contained in:
AzaezelX 2021-10-03 02:56:26 -05:00
parent 10f2453cee
commit 98a079a797
123 changed files with 632 additions and 966 deletions

View file

@ -129,7 +129,7 @@ GuiBitmapButtonCtrl::GuiBitmapButtonCtrl()
setExtent( 140, 30 );
mMasked = false;
INIT_IMAGEASSET(Bitmap);
INIT_ASSET(Bitmap);
}
//-----------------------------------------------------------------------------
@ -668,4 +668,4 @@ bool GuiBitmapButtonCtrl::pointInControl(const Point2I& parentCoordPoint)
return Parent::pointInControl(parentCoordPoint);
}
DEF_IMAGEASSET_BINDS(GuiBitmapButtonCtrl, Bitmap);
DEF_ASSET_BINDS(GuiBitmapButtonCtrl, Bitmap);

View file

@ -119,7 +119,7 @@ class GuiBitmapButtonCtrl : public GuiButtonCtrl
BitmapMode mBitmapMode;
DECLARE_IMAGEASSET(GuiBitmapButtonCtrl, Bitmap, onBitmapChange, GFXDefaultGUIProfile);
DECLARE_IMAGEASSET_SETGET(GuiBitmapButtonCtrl, Bitmap);
DECLARE_ASSET_SETGET(GuiBitmapButtonCtrl, Bitmap);
/// alpha masking
bool mMasked;

View file

@ -85,7 +85,7 @@ ConsoleDocClass( GuiIconButtonCtrl,
GuiIconButtonCtrl::GuiIconButtonCtrl()
{
INIT_IMAGEASSET(Bitmap);
INIT_ASSET(Bitmap);
mTextLocation = TextLocLeft;
mIconLocation = IconLocLeft;
mTextMargin = 4;
@ -412,4 +412,4 @@ void GuiIconButtonCtrl::renderBitmapArray(RectI &bounds, S32 state)
}
}
DEF_IMAGEASSET_BINDS(GuiIconButtonCtrl, Bitmap);
DEF_ASSET_BINDS(GuiIconButtonCtrl, Bitmap);

View file

@ -43,7 +43,7 @@ private:
protected:
DECLARE_IMAGEASSET(GuiIconButtonCtrl, Bitmap, onImageChanged, GFXTexturePersistentSRGBProfile);
DECLARE_IMAGEASSET_SETGET(GuiIconButtonCtrl, Bitmap);
DECLARE_ASSET_SETGET(GuiIconButtonCtrl, Bitmap);
S32 mIconLocation;
S32 mTextLocation;

View file

@ -43,9 +43,9 @@ ConsoleDocClass( GuiToolboxButtonCtrl,
//-------------------------------------
GuiToolboxButtonCtrl::GuiToolboxButtonCtrl()
{
INIT_IMAGEASSET(NormalBitmap);
INIT_IMAGEASSET(LoweredBitmap);
INIT_IMAGEASSET(HoverBitmap);
INIT_ASSET(NormalBitmap);
INIT_ASSET(LoweredBitmap);
INIT_ASSET(HoverBitmap);
setMinExtent(Point2I(16,16));
setExtent(48, 48);
@ -193,6 +193,6 @@ void GuiToolboxButtonCtrl::renderButton(GFXTexHandle &texture, Point2I &offset,
}
}
DEF_IMAGEASSET_BINDS(GuiToolboxButtonCtrl, NormalBitmap);
DEF_IMAGEASSET_BINDS(GuiToolboxButtonCtrl, LoweredBitmap);
DEF_IMAGEASSET_BINDS(GuiToolboxButtonCtrl, HoverBitmap);
DEF_ASSET_BINDS(GuiToolboxButtonCtrl, NormalBitmap);
DEF_ASSET_BINDS(GuiToolboxButtonCtrl, LoweredBitmap);
DEF_ASSET_BINDS(GuiToolboxButtonCtrl, HoverBitmap);

View file

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

View file

@ -60,7 +60,7 @@ GuiBitmapCtrl::GuiBitmapCtrl(void)
mColor(ColorI::WHITE),
mWrap( false )
{
INIT_IMAGEASSET(Bitmap);
INIT_ASSET(Bitmap);
}
bool GuiBitmapCtrl::setBitmapName( void *object, const char *index, const char *data )

View file

@ -40,7 +40,7 @@ class GuiBitmapCtrl : public GuiControl
/// Name of the bitmap file. If this is 'texhandle' the bitmap is not loaded
/// from a file but rather set explicitly on the control.
DECLARE_IMAGEASSET(GuiBitmapCtrl, Bitmap, onImageChanged, GFXDefaultGUIProfile);
DECLARE_IMAGEASSET_SETGET(GuiBitmapCtrl, Bitmap);
DECLARE_ASSET_SETGET(GuiBitmapCtrl, Bitmap);
Point2I mStartPoint;
ColorI mColor;

View file

@ -45,7 +45,7 @@ ConsoleDocClass( GuiMaterialCtrl,
GuiMaterialCtrl::GuiMaterialCtrl()
: mMaterialInst( NULL )
{
INIT_MATERIALASSET(Material);
INIT_ASSET(Material);
}
void GuiMaterialCtrl::initPersistFields()

View file

@ -41,7 +41,7 @@ private:
protected:
DECLARE_MATERIALASSET(GuiMaterialCtrl, Material);
DECLARE_MATERIALASSET_SETGET(GuiMaterialCtrl, Material);
DECLARE_ASSET_SETGET(GuiMaterialCtrl, Material);
BaseMatInstance *mMaterialInst;

View file

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

View file

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

View file

@ -2898,7 +2898,7 @@ static ConsoleDocFragment _sGuiControlSetExtent2(
"GuiControl", // The class to place the method in; use NULL for functions.
"void setExtent( Point2I p );" ); // The definition string.
DefineEngineMethod( GuiControl, setExtent, void, ( const char* extOrX, const char* y ), (""),
DefineEngineMethod( GuiControl, setExtent, void, ( const char* extOrX, const char* y ), ("", nullAsType<const char*>()),
"( Point2I p | int x, int y ) Set the width and height of the control.\n\n"
"@hide" )
{

View file

@ -79,7 +79,7 @@ GuiCursor::GuiCursor()
mRenderOffset.set(0.0f,0.0f);
mExtent.set(1,1);
INIT_IMAGEASSET(Bitmap);
INIT_ASSET(Bitmap);
}
GuiCursor::~GuiCursor()
@ -324,7 +324,7 @@ GuiControlProfile::GuiControlProfile(void) :
mMouseOverSelected = false;
// bitmap members
INIT_IMAGEASSET(Bitmap);
INIT_ASSET(Bitmap);
mUseBitmapArray = false;
mChildrenProfileName = NULL;

View file

@ -345,7 +345,7 @@ private:
typedef SimObject Parent;
DECLARE_IMAGEASSET(GuiCursor, Bitmap, onImageChanged, GFXGuiCursorProfile);
DECLARE_IMAGEASSET_SETGET(GuiCursor, Bitmap);
DECLARE_ASSET_SETGET(GuiCursor, Bitmap);
Point2I mHotSpot;
Point2F mRenderOffset;
@ -555,7 +555,7 @@ public:
{
return mBitmap;
}
DECLARE_IMAGEASSET_SETGET(GuiControlProfile, Bitmap);
DECLARE_ASSET_SETGET(GuiControlProfile, Bitmap);
void onBitmapChanged() {}

View file

@ -87,7 +87,7 @@ DefineEngineMethod( GuiChunkedBitmapCtrl, setBitmap, void, (const char* filename
GuiChunkedBitmapCtrl::GuiChunkedBitmapCtrl()
{
INIT_IMAGEASSET(Bitmap);
INIT_ASSET(Bitmap);
mUseVariable = false;
mTile = false;

View file

@ -18,7 +18,7 @@ private:
protected:
DECLARE_IMAGEASSET(GuiChunkedBitmapCtrl, Bitmap, onImageChanged, GFXDefaultGUIProfile);
DECLARE_IMAGEASSET_SETGET(GuiChunkedBitmapCtrl, Bitmap);
DECLARE_ASSET_SETGET(GuiChunkedBitmapCtrl, Bitmap);
bool mUseVariable;
bool mTile;

View file

@ -124,7 +124,7 @@ GuiProgressBitmapCtrl::GuiProgressBitmapCtrl()
mNumberOfBitmaps(0),
mDim(0)
{
INIT_IMAGEASSET(Bitmap);
INIT_ASSET(Bitmap);
}
//-----------------------------------------------------------------------------

View file

@ -48,7 +48,7 @@ class GuiProgressBitmapCtrl : public GuiTextCtrl
F32 mProgress;
DECLARE_IMAGEASSET(GuiProgressBitmapCtrl, Bitmap, onImageChanged, GFXDefaultGUIProfile);
DECLARE_IMAGEASSET_SETGET(GuiProgressBitmapCtrl, Bitmap);
DECLARE_ASSET_SETGET(GuiProgressBitmapCtrl, Bitmap);
bool mUseVariable;
bool mTile;

View file

@ -59,7 +59,7 @@ ConsoleDocClass( GuiMissionAreaCtrl,
GuiMissionAreaCtrl::GuiMissionAreaCtrl()
{
INIT_IMAGEASSET(HandleBitmap);
INIT_ASSET(HandleBitmap);
mHandleTextureSize = Point2I::Zero;
mHandleTextureHalfSize = Point2F::Zero;

View file

@ -64,7 +64,7 @@ protected:
GFXStateBlockRef mSolidStateBlock;
DECLARE_IMAGEASSET(GuiMissionAreaCtrl, HandleBitmap, onHandleBitmapChanged, GFXTexturePersistentSRGBProfile);
DECLARE_IMAGEASSET_SETGET(GuiMissionAreaCtrl, HandleBitmap);
DECLARE_ASSET_SETGET(GuiMissionAreaCtrl, HandleBitmap);
Point2I mHandleTextureSize;
Point2F mHandleTextureHalfSize;

View file

@ -329,11 +329,11 @@ class WorldEditor : public EditTSCtrl
ColorI mPopupTextColor;
DECLARE_IMAGEASSET(WorldEditor, SelectHandle, onSelectHandleChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_SETGET(WorldEditor, SelectHandle);
DECLARE_ASSET_SETGET(WorldEditor, SelectHandle);
DECLARE_IMAGEASSET(WorldEditor, DefaultHandle, onDefaultHandleChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_SETGET(WorldEditor, DefaultHandle);
DECLARE_ASSET_SETGET(WorldEditor, DefaultHandle);
DECLARE_IMAGEASSET(WorldEditor, LockedHandle, onLockedHandleChanged, GFXStaticTextureSRGBProfile);
DECLARE_IMAGEASSET_SETGET(WorldEditor, LockedHandle);
DECLARE_ASSET_SETGET(WorldEditor, LockedHandle);
ColorI mObjectTextColor;
bool mObjectsUseBoxCenter;