mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
check wether or not mBitmapArrayRects.empty(). not simply if size()
(cherry picked from commit fea81a4d57edff9c05bf397a5b21d8422838cc1c)
This commit is contained in:
parent
f1d42d3867
commit
d6480cb63c
7 changed files with 26 additions and 26 deletions
|
|
@ -82,7 +82,7 @@ bool GuiCheckBoxCtrl::onWake()
|
||||||
|
|
||||||
// make sure there is a bitmap array for this control type
|
// make sure there is a bitmap array for this control type
|
||||||
// if it is declared as such in the control
|
// if it is declared as such in the control
|
||||||
if( !mProfile->mBitmapArrayRects.size() && !mProfile->constructBitmapArray() )
|
if(mProfile->mBitmapArrayRects.empty() && !mProfile->constructBitmapArray() )
|
||||||
{
|
{
|
||||||
Con::errorf( "GuiCheckBoxCtrl::onWake - failed to create bitmap array from profile '%s'", mProfile->getName() );
|
Con::errorf( "GuiCheckBoxCtrl::onWake - failed to create bitmap array from profile '%s'", mProfile->getName() );
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -159,9 +159,9 @@ void GuiCheckBoxCtrl::autoSize()
|
||||||
{
|
{
|
||||||
mProfile->incLoadCount();
|
mProfile->incLoadCount();
|
||||||
|
|
||||||
if( !mProfile->mBitmapArrayRects.size() )
|
if(mProfile->mBitmapArrayRects.empty())
|
||||||
mProfile->constructBitmapArray();
|
mProfile->constructBitmapArray();
|
||||||
if( mProfile->mBitmapArrayRects.size() )
|
if(!mProfile->mBitmapArrayRects.empty())
|
||||||
bmpArrayRect0Width = mProfile->mBitmapArrayRects[ 0 ].extent.x;
|
bmpArrayRect0Width = mProfile->mBitmapArrayRects[ 0 ].extent.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,7 @@ void GuiIconButtonCtrl::renderButton( Point2I &offset, const RectI& updateRect )
|
||||||
{
|
{
|
||||||
// If there is a bitmap array then render using it.
|
// If there is a bitmap array then render using it.
|
||||||
// Otherwise use a standard fill.
|
// Otherwise use a standard fill.
|
||||||
if(mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size())
|
if(mProfile->mUseBitmapArray && !mProfile->mBitmapArrayRects.empty())
|
||||||
renderBitmapArray(boundsRect, statePressed);
|
renderBitmapArray(boundsRect, statePressed);
|
||||||
else
|
else
|
||||||
renderSlightlyLoweredBox(boundsRect, mProfile);
|
renderSlightlyLoweredBox(boundsRect, mProfile);
|
||||||
|
|
@ -241,7 +241,7 @@ void GuiIconButtonCtrl::renderButton( Point2I &offset, const RectI& updateRect )
|
||||||
{
|
{
|
||||||
// If there is a bitmap array then render using it.
|
// If there is a bitmap array then render using it.
|
||||||
// Otherwise use a standard fill.
|
// Otherwise use a standard fill.
|
||||||
if (mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size())
|
if (mProfile->mUseBitmapArray && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
renderBitmapArray(boundsRect, stateMouseOver);
|
renderBitmapArray(boundsRect, stateMouseOver);
|
||||||
}
|
}
|
||||||
|
|
@ -257,7 +257,7 @@ void GuiIconButtonCtrl::renderButton( Point2I &offset, const RectI& updateRect )
|
||||||
{
|
{
|
||||||
// If there is a bitmap array then render using it.
|
// If there is a bitmap array then render using it.
|
||||||
// Otherwise use a standard fill.
|
// Otherwise use a standard fill.
|
||||||
if(mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size())
|
if(mProfile->mUseBitmapArray && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
if(mActive)
|
if(mActive)
|
||||||
renderBitmapArray(boundsRect, stateNormal);
|
renderBitmapArray(boundsRect, stateNormal);
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ bool GuiFormCtrl::onWake()
|
||||||
|
|
||||||
mProfile->constructBitmapArray();
|
mProfile->constructBitmapArray();
|
||||||
|
|
||||||
if(mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size())
|
if(mProfile->mUseBitmapArray && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
mThumbSize.set( mProfile->mBitmapArrayRects[0].extent.x, mProfile->mBitmapArrayRects[0].extent.y );
|
mThumbSize.set( mProfile->mBitmapArrayRects[0].extent.x, mProfile->mBitmapArrayRects[0].extent.y );
|
||||||
mThumbSize.setMax( mProfile->mBitmapArrayRects[1].extent );
|
mThumbSize.setMax( mProfile->mBitmapArrayRects[1].extent );
|
||||||
|
|
@ -204,7 +204,7 @@ bool GuiFormCtrl::resize(const Point2I &newPosition, const Point2I &newExtent)
|
||||||
if( !Parent::resize(newPosition, newExtent) )
|
if( !Parent::resize(newPosition, newExtent) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( !mAwake || !mProfile->mBitmapArrayRects.size() )
|
if( !mAwake || mProfile->mBitmapArrayRects.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Should the caption be modified because the title bar is too small?
|
// Should the caption be modified because the title bar is too small?
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ bool GuiPaneControl::onWake()
|
||||||
setCaptionID(mCaptionID);
|
setCaptionID(mCaptionID);
|
||||||
|
|
||||||
mProfile->constructBitmapArray();
|
mProfile->constructBitmapArray();
|
||||||
if(mProfile->mUseBitmapArray && mProfile->mBitmapArrayRects.size())
|
if(mProfile->mUseBitmapArray && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
mThumbSize.set( mProfile->mBitmapArrayRects[0].extent.x, mProfile->mBitmapArrayRects[0].extent.y );
|
mThumbSize.set( mProfile->mBitmapArrayRects[0].extent.x, mProfile->mBitmapArrayRects[0].extent.y );
|
||||||
mThumbSize.setMax( mProfile->mBitmapArrayRects[1].extent );
|
mThumbSize.setMax( mProfile->mBitmapArrayRects[1].extent );
|
||||||
|
|
|
||||||
|
|
@ -879,7 +879,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
||||||
S32 top = baseRect.point.y, bottom = baseRect.point.y + baseRect.extent.y - 1;
|
S32 top = baseRect.point.y, bottom = baseRect.point.y + baseRect.extent.y - 1;
|
||||||
|
|
||||||
// Do we render a bitmap border or lines?
|
// Do we render a bitmap border or lines?
|
||||||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
if ( mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
|
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
|
||||||
{
|
{
|
||||||
|
|
@ -912,7 +912,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do we render a bitmap border or lines?
|
// Do we render a bitmap border or lines?
|
||||||
if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) )
|
if (!mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
drawUtil->drawLine(left, top, left, bottom, colorWhite );
|
drawUtil->drawLine(left, top, left, bottom, colorWhite );
|
||||||
drawUtil->drawLine(left, top, right, top, colorWhite );
|
drawUtil->drawLine(left, top, right, top, colorWhite );
|
||||||
|
|
@ -930,7 +930,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
||||||
S32 top = baseRect.point.y, bottom = baseRect.point.y + baseRect.extent.y - 1;
|
S32 top = baseRect.point.y, bottom = baseRect.point.y + baseRect.extent.y - 1;
|
||||||
|
|
||||||
// Do we render a bitmap border or lines?
|
// Do we render a bitmap border or lines?
|
||||||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
if ( mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
|
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
|
||||||
{
|
{
|
||||||
|
|
@ -956,7 +956,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do we render a bitmap border or lines?
|
// Do we render a bitmap border or lines?
|
||||||
if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) )
|
if (!mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
drawUtil->drawLine(left, top, left, bottom, colorWhite);
|
drawUtil->drawLine(left, top, left, bottom, colorWhite);
|
||||||
drawUtil->drawLine(left, top, right, top, colorWhite);
|
drawUtil->drawLine(left, top, right, top, colorWhite);
|
||||||
|
|
@ -967,7 +967,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Do we render a bitmap border or lines?
|
// Do we render a bitmap border or lines?
|
||||||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
if ( mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
|
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
|
||||||
{
|
{
|
||||||
|
|
@ -992,7 +992,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do we render a bitmap border or lines?
|
// Do we render a bitmap border or lines?
|
||||||
if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) )
|
if (!mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
|
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
|
||||||
{
|
{
|
||||||
|
|
@ -1013,7 +1013,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
||||||
switch (mProfile->mAlignment)
|
switch (mProfile->mAlignment)
|
||||||
{
|
{
|
||||||
case GuiControlProfile::RightJustify:
|
case GuiControlProfile::RightJustify:
|
||||||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
if ( mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
// We're making use of a bitmap border, so take into account the
|
// We're making use of a bitmap border, so take into account the
|
||||||
// right cap of the border.
|
// right cap of the border.
|
||||||
|
|
@ -1026,7 +1026,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GuiControlProfile::CenterJustify:
|
case GuiControlProfile::CenterJustify:
|
||||||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
if ( mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
// We're making use of a bitmap border, so take into account the
|
// We're making use of a bitmap border, so take into account the
|
||||||
// right cap of the border.
|
// right cap of the border.
|
||||||
|
|
@ -1045,7 +1045,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
||||||
// The width of the text is greater than the width of the control.
|
// The width of the text is greater than the width of the control.
|
||||||
// In this case we will right justify the text and leave some space
|
// In this case we will right justify the text and leave some space
|
||||||
// for the down arrow.
|
// for the down arrow.
|
||||||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
if ( mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
// We're making use of a bitmap border, so take into account the
|
// We're making use of a bitmap border, so take into account the
|
||||||
// right cap of the border.
|
// right cap of the border.
|
||||||
|
|
@ -1097,7 +1097,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
||||||
// Draw the second column to the right
|
// Draw the second column to the right
|
||||||
getColumn( mText, buff, 1, "\t" );
|
getColumn( mText, buff, 1, "\t" );
|
||||||
S32 colTxt_w = mProfile->mFont->getStrWidth( buff );
|
S32 colTxt_w = mProfile->mFont->getStrWidth( buff );
|
||||||
if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() )
|
if ( mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
// We're making use of a bitmap border, so take into account the
|
// We're making use of a bitmap border, so take into account the
|
||||||
// right cap of the border.
|
// right cap of the border.
|
||||||
|
|
@ -1117,7 +1117,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect )
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're rendering a bitmap border, then it will take care of the arrow.
|
// If we're rendering a bitmap border, then it will take care of the arrow.
|
||||||
if ( !(mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size()) )
|
if (!mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
|
if (mProfile->mBitmapArrayRects[0].extent.y < baseRect.extent.y)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1088,7 +1088,7 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do we render a bitmap border or lines?
|
// Do we render a bitmap border or lines?
|
||||||
if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) )
|
if (!mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
drawUtil->drawLine( l, t, l, b, colorWhite );
|
drawUtil->drawLine( l, t, l, b, colorWhite );
|
||||||
drawUtil->drawLine( l, t, r2, t, colorWhite );
|
drawUtil->drawLine( l, t, r2, t, colorWhite );
|
||||||
|
|
@ -1126,7 +1126,7 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do we render a bitmap border or lines?
|
// Do we render a bitmap border or lines?
|
||||||
if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) )
|
if (!mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
drawUtil->drawLine( l, t, l, b, colorWhite );
|
drawUtil->drawLine( l, t, l, b, colorWhite );
|
||||||
drawUtil->drawLine( l, t, r2, t, colorWhite );
|
drawUtil->drawLine( l, t, r2, t, colorWhite );
|
||||||
|
|
@ -1156,7 +1156,7 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do we render a bitmap border or lines?
|
// Do we render a bitmap border or lines?
|
||||||
if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) )
|
if (!mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
drawUtil->drawRect( r, mProfile->mBorderColorNA );
|
drawUtil->drawRect( r, mProfile->mBorderColorNA );
|
||||||
}
|
}
|
||||||
|
|
@ -1275,7 +1275,7 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're rendering a bitmap border, then it will take care of the arrow.
|
// If we're rendering a bitmap border, then it will take care of the arrow.
|
||||||
if ( !(mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size()) )
|
if (!mProfile->getChildrenProfile() && !mProfile->mBitmapArrayRects.empty())
|
||||||
{
|
{
|
||||||
// Draw a triangle (down arrow)
|
// Draw a triangle (down arrow)
|
||||||
S32 left = r.point.x + r.extent.x - 12;
|
S32 left = r.point.x + r.extent.x - 12;
|
||||||
|
|
|
||||||
|
|
@ -524,7 +524,7 @@ void GuiControlProfile::setChildrenProfile(GuiControlProfile *prof)
|
||||||
|
|
||||||
RectI GuiControlProfile::getBitmapArrayRect(U32 i)
|
RectI GuiControlProfile::getBitmapArrayRect(U32 i)
|
||||||
{
|
{
|
||||||
if(!mBitmapArrayRects.size())
|
if(mBitmapArrayRects.empty())
|
||||||
constructBitmapArray();
|
constructBitmapArray();
|
||||||
|
|
||||||
if( i >= mBitmapArrayRects.size())
|
if( i >= mBitmapArrayRects.size())
|
||||||
|
|
@ -535,7 +535,7 @@ RectI GuiControlProfile::getBitmapArrayRect(U32 i)
|
||||||
|
|
||||||
S32 GuiControlProfile::constructBitmapArray()
|
S32 GuiControlProfile::constructBitmapArray()
|
||||||
{
|
{
|
||||||
if(mBitmapArrayRects.size())
|
if(!mBitmapArrayRects.empty())
|
||||||
return mBitmapArrayRects.size();
|
return mBitmapArrayRects.size();
|
||||||
|
|
||||||
if( mBitmap.isNull() )
|
if( mBitmap.isNull() )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue