mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-12 19:31:41 +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
|
|
@ -1041,7 +1041,8 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height,
|
|||
}
|
||||
|
||||
// inOutFormat is not modified by this method
|
||||
bool chekFmt = GFX->getCardProfiler()->checkFormat( testingFormat, profile, autoGenSupp );
|
||||
GFXCardProfiler* cardProfiler = GFX->getCardProfiler();
|
||||
bool chekFmt = cardProfiler->checkFormat(testingFormat, profile, autoGenSupp);
|
||||
|
||||
if( !chekFmt )
|
||||
{
|
||||
|
|
@ -1057,16 +1058,16 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height,
|
|||
{
|
||||
case GFXFormatR8G8B8:
|
||||
testingFormat = GFXFormatR8G8B8X8;
|
||||
chekFmt = GFX->getCardProfiler()->checkFormat( testingFormat, profile, autoGenSupp );
|
||||
chekFmt = cardProfiler->checkFormat(testingFormat, profile, autoGenSupp);
|
||||
break;
|
||||
|
||||
case GFXFormatA8:
|
||||
testingFormat = GFXFormatR8G8B8A8;
|
||||
chekFmt = GFX->getCardProfiler()->checkFormat( testingFormat, profile, autoGenSupp );
|
||||
chekFmt = cardProfiler->checkFormat(testingFormat, profile, autoGenSupp);
|
||||
break;
|
||||
|
||||
default:
|
||||
chekFmt = GFX->getCardProfiler()->checkFormat( testingFormat, profile, autoGenSupp );
|
||||
chekFmt = cardProfiler->checkFormat(testingFormat, profile, autoGenSupp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue