Pārlūkot izejas kodu

Removing unnecessary variable

BearishSun 9 gadi atpakaļ
vecāks
revīzija
cbda1f29ad
1 mainītis faili ar 3 papildinājumiem un 6 dzēšanām
  1. 3 6
      Source/BansheeEditor/Source/BsEditorUtility.cpp

+ 3 - 6
Source/BansheeEditor/Source/BsEditorUtility.cpp

@@ -55,7 +55,6 @@ namespace BansheeEngine
 			return Vector3::ZERO;
 			return Vector3::ZERO;
 
 
 		Vector3 center = Vector3::ZERO;
 		Vector3 center = Vector3::ZERO;
-		bool gotOneMesh = false;
 		UINT32 count = 0;
 		UINT32 count = 0;
 
 
 		for (auto& object : objects)
 		for (auto& object : objects)
@@ -63,17 +62,16 @@ namespace BansheeEngine
 			AABox meshBounds;
 			AABox meshBounds;
 			if (calculateMeshBounds(object, meshBounds))
 			if (calculateMeshBounds(object, meshBounds))
 			{
 			{
-				count++;
 				if (meshBounds.getSize() == Vector3::INF)
 				if (meshBounds.getSize() == Vector3::INF)
 					center += object->getWorldPosition();
 					center += object->getWorldPosition();
 				else
 				else
 					center += meshBounds.getCenter();
 					center += meshBounds.getCenter();
 
 
-				gotOneMesh = true;
+				count++;
 			}
 			}
 		}
 		}
 
 
-		if (!gotOneMesh)
+		if (count == 0)
 		{
 		{
 			for (auto& object : objects)
 			for (auto& object : objects)
 			{
 			{
@@ -82,11 +80,10 @@ namespace BansheeEngine
 
 
 				center += object->getWorldPosition();
 				center += object->getWorldPosition();
 				count++;
 				count++;
-				gotOneMesh = true;
 			}
 			}
 		}
 		}
 
 
-		if (gotOneMesh)
+		if (count > 0)
 			return center / (float)count;
 			return center / (float)count;
 
 
 		return Vector3::ZERO;
 		return Vector3::ZERO;