mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Issue found with PVS-Studio:
Many instances of a function or expression being used repeatedly, which can lower performance. Fixed it in these cases by creating on local var, reference or pointer that's used instead.
This commit is contained in:
parent
ec63398042
commit
2002d74b78
38 changed files with 465 additions and 371 deletions
|
|
@ -56,6 +56,8 @@ void GuiGameListMenuCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|||
{
|
||||
GuiGameListMenuProfile * profile = (GuiGameListMenuProfile *) mProfile;
|
||||
|
||||
GFXDrawUtil* drawUtil = GFX->getDrawUtil();
|
||||
|
||||
F32 xScale = (float) getWidth() / profile->getRowWidth();
|
||||
|
||||
bool profileHasIcons = profile->hasArrows();
|
||||
|
|
@ -121,19 +123,19 @@ void GuiGameListMenuCtrl::onRender(Point2I offset, const RectI &updateRect)
|
|||
}
|
||||
|
||||
// render the row bitmap
|
||||
GFX->getDrawUtil()->clearBitmapModulation();
|
||||
GFX->getDrawUtil()->drawBitmapStretchSR(profile->mTextureObject, RectI(currentOffset, rowExtent), profile->getBitmapArrayRect(buttonTextureIndex));
|
||||
drawUtil->clearBitmapModulation();
|
||||
drawUtil->drawBitmapStretchSR(profile->mTextureObject, RectI(currentOffset, rowExtent), profile->getBitmapArrayRect(buttonTextureIndex));
|
||||
|
||||
// render the row icon if it has one
|
||||
if ((iconIndex != NO_ICON) && profileHasIcons && (! profile->getBitmapArrayRect((U32)iconIndex).extent.isZero()))
|
||||
{
|
||||
iconIndex += Profile::TEX_FIRST_ICON;
|
||||
GFX->getDrawUtil()->clearBitmapModulation();
|
||||
GFX->getDrawUtil()->drawBitmapStretchSR(profile->mTextureObject, RectI(currentOffset + iconOffset, iconExtent), profile->getBitmapArrayRect(iconIndex));
|
||||
drawUtil->clearBitmapModulation();
|
||||
drawUtil->drawBitmapStretchSR(profile->mTextureObject, RectI(currentOffset + iconOffset, iconExtent), profile->getBitmapArrayRect(iconIndex));
|
||||
}
|
||||
|
||||
// render the row text
|
||||
GFX->getDrawUtil()->setBitmapModulation(fontColor);
|
||||
drawUtil->setBitmapModulation(fontColor);
|
||||
renderJustifiedText(currentOffset + textOffset, textExtent, (*row)->mLabel);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue