mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-03 04:20:30 +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
|
|
@ -1449,14 +1449,15 @@ void TerrainEditor::renderSelection( const Selection & sel, const ColorF & inCol
|
|||
// walk the points in the selection
|
||||
for(U32 i = 0; i < sel.size(); i++)
|
||||
{
|
||||
Point2I gPos = sel[i].mGridPoint.gridPos;
|
||||
GridPoint selectedGridPoint = sel[i].mGridPoint;
|
||||
Point2I gPos = selectedGridPoint.gridPos;
|
||||
|
||||
GFXVertexPC *verts = &(vertexBuffer[i * 5]);
|
||||
|
||||
bool center = gridToWorld(sel[i].mGridPoint, verts[0].point);
|
||||
gridToWorld(Point2I(gPos.x + 1, gPos.y), verts[1].point, sel[i].mGridPoint.terrainBlock);
|
||||
gridToWorld(Point2I(gPos.x + 1, gPos.y + 1), verts[2].point, sel[i].mGridPoint.terrainBlock);
|
||||
gridToWorld(Point2I(gPos.x, gPos.y + 1), verts[3].point, sel[i].mGridPoint.terrainBlock);
|
||||
bool center = gridToWorld(selectedGridPoint, verts[0].point);
|
||||
gridToWorld(Point2I(gPos.x + 1, gPos.y), verts[1].point, selectedGridPoint.terrainBlock);
|
||||
gridToWorld(Point2I(gPos.x + 1, gPos.y + 1), verts[2].point, selectedGridPoint.terrainBlock);
|
||||
gridToWorld(Point2I(gPos.x, gPos.y + 1), verts[3].point, selectedGridPoint.terrainBlock);
|
||||
verts[4].point = verts[0].point;
|
||||
|
||||
F32 weight = sel[i].mWeight;
|
||||
|
|
|
|||
|
|
@ -1631,10 +1631,11 @@ void WorldEditor::renderScreenObj( SceneObject *obj, const Point3F& projPos, con
|
|||
// Save an IconObject for performing icon-click testing later.
|
||||
|
||||
mIcons.increment();
|
||||
mIcons.last().object = obj;
|
||||
mIcons.last().rect = renderRect;
|
||||
mIcons.last().dist = projPos.z;
|
||||
mIcons.last().alpha = iconAlpha;
|
||||
IconObject& lastIcon = mIcons.last();
|
||||
lastIcon.object = obj;
|
||||
lastIcon.rect = renderRect;
|
||||
lastIcon.dist = projPos.z;
|
||||
lastIcon.alpha = iconAlpha;
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue