2
0
Эх сурвалжийг харах

Use the variable name uintColor throughout.

Lasse Öörni 14 жил өмнө
parent
commit
387ac00631

+ 39 - 39
Engine/Graphics/DebugRenderer.cpp

@@ -92,24 +92,24 @@ void DebugRenderer::AddBoundingBox(const BoundingBox& box, const Color& color, b
     Vector3 v4(max.x_, min.y_, max.z_);
     Vector3 v5(min.x_, max.y_, max.z_);
     
-    unsigned d3dColor = color.ToUInt();
+    unsigned uintColor = color.ToUInt();
     
     PODVector<DebugLine>* dest = &lines_;
     if (!depthTest)
         dest = &noDepthLines_;
     
-    dest->Push(DebugLine(min, v0, d3dColor));
-    dest->Push(DebugLine(v0, v1, d3dColor));
-    dest->Push(DebugLine(v1, v2, d3dColor));
-    dest->Push(DebugLine(v2, min, d3dColor));
-    dest->Push(DebugLine(v3, v4, d3dColor));
-    dest->Push(DebugLine(v4, max, d3dColor));
-    dest->Push(DebugLine(max, v5, d3dColor));
-    dest->Push(DebugLine(v5, v3, d3dColor));
-    dest->Push(DebugLine(min, v3, d3dColor));
-    dest->Push(DebugLine(v0, v4, d3dColor));
-    dest->Push(DebugLine(v1, max, d3dColor));
-    dest->Push(DebugLine(v2, v5, d3dColor));
+    dest->Push(DebugLine(min, v0, uintColor));
+    dest->Push(DebugLine(v0, v1, uintColor));
+    dest->Push(DebugLine(v1, v2, uintColor));
+    dest->Push(DebugLine(v2, min, uintColor));
+    dest->Push(DebugLine(v3, v4, uintColor));
+    dest->Push(DebugLine(v4, max, uintColor));
+    dest->Push(DebugLine(max, v5, uintColor));
+    dest->Push(DebugLine(v5, v3, uintColor));
+    dest->Push(DebugLine(min, v3, uintColor));
+    dest->Push(DebugLine(v0, v4, uintColor));
+    dest->Push(DebugLine(v1, max, uintColor));
+    dest->Push(DebugLine(v2, v5, uintColor));
 }
 
 void DebugRenderer::AddBoundingBox(const BoundingBox& box, const Matrix3x4& transform, const Color& color, bool depthTest)
@@ -126,47 +126,47 @@ void DebugRenderer::AddBoundingBox(const BoundingBox& box, const Matrix3x4& tran
     Vector3 v6(transform * Vector3(max.x_, max.y_, max.z_));
     Vector3 v7(transform * Vector3(min.x_, max.y_, max.z_));
     
-    unsigned d3dColor = color.ToUInt();
+    unsigned uintColor = color.ToUInt();
     
     PODVector<DebugLine>* dest = &lines_;
     if (!depthTest)
         dest = &noDepthLines_;
     
-    dest->Push(DebugLine(v0, v1, d3dColor));
-    dest->Push(DebugLine(v1, v2, d3dColor));
-    dest->Push(DebugLine(v2, v3, d3dColor));
-    dest->Push(DebugLine(v3, v0, d3dColor));
-    dest->Push(DebugLine(v4, v5, d3dColor));
-    dest->Push(DebugLine(v5, v6, d3dColor));
-    dest->Push(DebugLine(v6, v7, d3dColor));
-    dest->Push(DebugLine(v7, v4, d3dColor));
-    dest->Push(DebugLine(v0, v4, d3dColor));
-    dest->Push(DebugLine(v1, v5, d3dColor));
-    dest->Push(DebugLine(v2, v6, d3dColor));
-    dest->Push(DebugLine(v3, v7, d3dColor));
+    dest->Push(DebugLine(v0, v1, uintColor));
+    dest->Push(DebugLine(v1, v2, uintColor));
+    dest->Push(DebugLine(v2, v3, uintColor));
+    dest->Push(DebugLine(v3, v0, uintColor));
+    dest->Push(DebugLine(v4, v5, uintColor));
+    dest->Push(DebugLine(v5, v6, uintColor));
+    dest->Push(DebugLine(v6, v7, uintColor));
+    dest->Push(DebugLine(v7, v4, uintColor));
+    dest->Push(DebugLine(v0, v4, uintColor));
+    dest->Push(DebugLine(v1, v5, uintColor));
+    dest->Push(DebugLine(v2, v6, uintColor));
+    dest->Push(DebugLine(v3, v7, uintColor));
 }
 
 void DebugRenderer::AddFrustum(const Frustum& frustum, const Color& color, bool depthTest)
 {
     const Vector3* vertices = frustum.vertices_;
-    unsigned d3dColor = color.ToUInt();
+    unsigned uintColor = color.ToUInt();
     
     PODVector<DebugLine>* dest = &lines_;
     if (!depthTest)
         dest = &noDepthLines_;
     
-    dest->Push(DebugLine(vertices[0], vertices[1], d3dColor));
-    dest->Push(DebugLine(vertices[1], vertices[2], d3dColor));
-    dest->Push(DebugLine(vertices[2], vertices[3], d3dColor));
-    dest->Push(DebugLine(vertices[3], vertices[0], d3dColor));
-    dest->Push(DebugLine(vertices[4], vertices[5], d3dColor));
-    dest->Push(DebugLine(vertices[5], vertices[6], d3dColor));
-    dest->Push(DebugLine(vertices[6], vertices[7], d3dColor));
-    dest->Push(DebugLine(vertices[7], vertices[4], d3dColor));
-    dest->Push(DebugLine(vertices[0], vertices[4], d3dColor));
-    dest->Push(DebugLine(vertices[1], vertices[5], d3dColor));
-    dest->Push(DebugLine(vertices[2], vertices[6], d3dColor));
-    dest->Push(DebugLine(vertices[3], vertices[7], d3dColor));
+    dest->Push(DebugLine(vertices[0], vertices[1], uintColor));
+    dest->Push(DebugLine(vertices[1], vertices[2], uintColor));
+    dest->Push(DebugLine(vertices[2], vertices[3], uintColor));
+    dest->Push(DebugLine(vertices[3], vertices[0], uintColor));
+    dest->Push(DebugLine(vertices[4], vertices[5], uintColor));
+    dest->Push(DebugLine(vertices[5], vertices[6], uintColor));
+    dest->Push(DebugLine(vertices[6], vertices[7], uintColor));
+    dest->Push(DebugLine(vertices[7], vertices[4], uintColor));
+    dest->Push(DebugLine(vertices[0], vertices[4], uintColor));
+    dest->Push(DebugLine(vertices[1], vertices[5], uintColor));
+    dest->Push(DebugLine(vertices[2], vertices[6], uintColor));
+    dest->Push(DebugLine(vertices[3], vertices[7], uintColor));
 }
 
 void DebugRenderer::AddSkeleton(const Skeleton& skeleton, const Color& color, bool depthTest)

+ 21 - 21
Engine/Physics/CollisionShape.cpp

@@ -583,7 +583,7 @@ void CollisionShape::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
         color = &Color::WHITE;
     else
         color = &Color::GREEN;
-    unsigned colorUInt = color->ToUInt();
+    unsigned uintColor = color->ToUInt();
     
     // Drawing all the debug geometries of a large world may be expensive (especially triangle meshes)
     // so check the geometry AABB against the debug geometry frustum first
@@ -621,13 +621,13 @@ void CollisionShape::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
                 
                 start = transform * Vector3(a, b, 0.0f);
                 end = transform * Vector3(c, d, 0.0f);
-                debug->AddLine(start, end, colorUInt, depthTest);
+                debug->AddLine(start, end, uintColor, depthTest);
                 start = transform * Vector3(a, 0.0f, b);
                 end = transform * Vector3(c, 0.0f, d);
-                debug->AddLine(start, end, colorUInt, depthTest);
+                debug->AddLine(start, end, uintColor, depthTest);
                 start = transform * Vector3(0.0f, a, b);
                 end = transform * Vector3(0.0f, c, d);
-                debug->AddLine(start, end, colorUInt, depthTest);
+                debug->AddLine(start, end, uintColor, depthTest);
             }
         }
         break;
@@ -658,30 +658,30 @@ void CollisionShape::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
                 
                 start = transform * Vector3(a, b, 0.5f * length);
                 end = transform * Vector3(c, d, 0.5f * length);
-                debug->AddLine(start, end, colorUInt, depthTest);
+                debug->AddLine(start, end, uintColor, depthTest);
                 start = transform * Vector3(a, b, -0.5f * length);
                 end = transform * Vector3(c, d, -0.5f * length);
-                debug->AddLine(start, end, colorUInt, depthTest);
+                debug->AddLine(start, end, uintColor, depthTest);
                 if (!(i & 1))
                 {
                     start = transform * Vector3(a, b, 0.5f * length);
                     end = transform * Vector3(a, b, -0.5f * length);
-                    debug->AddLine(start, end, colorUInt, depthTest);
+                    debug->AddLine(start, end, uintColor, depthTest);
                 }
                 if (b > -M_EPSILON)
                 {
                     start = transform * Vector3(a, 0.0f, b + 0.5f * length);
                     end = transform * Vector3(c, 0.0f, d + 0.5f * length);
-                    debug->AddLine(start, end, colorUInt, depthTest);
+                    debug->AddLine(start, end, uintColor, depthTest);
                     start = transform * Vector3(0.0f, a, b + 0.5f * length);
                     end = transform * Vector3(0.0f, c, d + 0.5f * length);
-                    debug->AddLine(start, end, colorUInt, depthTest);
+                    debug->AddLine(start, end, uintColor, depthTest);
                     start = transform * Vector3(a, 0.0f, -b - 0.5f * length);
                     end = transform * Vector3(c, 0.0f, -d - 0.5f * length);
-                    debug->AddLine(start, end, colorUInt, depthTest);
+                    debug->AddLine(start, end, uintColor, depthTest);
                     start = transform * Vector3(0.0f, a, -b - 0.5f * length);
                     end = transform * Vector3(0.0f, c, -d - 0.5f * length);
-                    debug->AddLine(start, end, colorUInt, depthTest);
+                    debug->AddLine(start, end, uintColor, depthTest);
                 }
             }
         }
@@ -703,13 +703,13 @@ void CollisionShape::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
                 
                 start = transform * Vector3(a, b, 0.5f * length);
                 end = transform * Vector3(c, d, 0.5f * length);
-                debug->AddLine(start, end, colorUInt, depthTest);
+                debug->AddLine(start, end, uintColor, depthTest);
                 start = transform * Vector3(a, b, -0.5f * length);
                 end = transform * Vector3(c, d, -0.5f * length);
-                debug->AddLine(start, end, colorUInt, depthTest);
+                debug->AddLine(start, end, uintColor, depthTest);
                 start = transform * Vector3(a, b, 0.5f * length);
                 end = transform * Vector3(a, b, -0.5f * length);
-                debug->AddLine(start, end, colorUInt, depthTest);
+                debug->AddLine(start, end, uintColor, depthTest);
             }
         }
         break;
@@ -729,9 +729,9 @@ void CollisionShape::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
                 Vector3 v1 = transform * vertices[indices[i + 1]];
                 Vector3 v2 = transform * vertices[indices[i + 2]];
                 
-                debug->AddLine(v0, v1, colorUInt, depthTest);
-                debug->AddLine(v1, v2, colorUInt, depthTest);
-                debug->AddLine(v2, v0, colorUInt, depthTest);
+                debug->AddLine(v0, v1, uintColor, depthTest);
+                debug->AddLine(v1, v2, uintColor, depthTest);
+                debug->AddLine(v2, v0, uintColor, depthTest);
             }
         }
         break;
@@ -755,8 +755,8 @@ void CollisionShape::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
                     Vector3 a = transform * Vector3(xBase + x * xSpacing, heights[z * xPoints + x], zBase + z * zSpacing);
                     Vector3 b = transform * Vector3(xBase + (x + 1) * xSpacing, heights[z * xPoints + x + 1], zBase + z * zSpacing);
                     Vector3 c = transform * Vector3(xBase + x * xSpacing, heights[(z + 1) * xPoints + x], zBase + (z + 1) * zSpacing);
-                    debug->AddLine(a, b, colorUInt, depthTest);
-                    debug->AddLine(a, c, colorUInt, depthTest);
+                    debug->AddLine(a, b, uintColor, depthTest);
+                    debug->AddLine(a, c, uintColor, depthTest);
                 }
             }
             for (unsigned z = 0; z < zPoints - 1; ++z)
@@ -765,7 +765,7 @@ void CollisionShape::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
                 
                 Vector3 a = transform * Vector3(xBase + x * xSpacing, heights[z * xPoints + x], zBase + z * zSpacing);
                 Vector3 b = transform * Vector3(xBase + x * xSpacing, heights[(z + 1) * xPoints + x], zBase + (z + 1) * zSpacing);
-                debug->AddLine(a, b, colorUInt, depthTest);
+                debug->AddLine(a, b, uintColor, depthTest);
             }
             for (unsigned x = 0; x < xPoints - 1; ++x)
             {
@@ -773,7 +773,7 @@ void CollisionShape::DrawDebugGeometry(DebugRenderer* debug, bool depthTest)
                 
                 Vector3 a = transform * Vector3(xBase + x * xSpacing, heights[z * xPoints + x], zBase + z * zSpacing);
                 Vector3 b = transform * Vector3(xBase + (x + 1) * xSpacing, heights[z * xPoints + x + 1], zBase + z * zSpacing);
-                debug->AddLine(a, b, colorUInt, depthTest);
+                debug->AddLine(a, b, uintColor, depthTest);
             }
         }
         break;