From 87c7206900be0853435d731040dcd2455d82581f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 15 Jun 2016 12:58:36 -0700 Subject: [PATCH] Cleanup. --- examples/common/debugdraw/debugdraw.cpp | 58 ++++++++++++------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/examples/common/debugdraw/debugdraw.cpp b/examples/common/debugdraw/debugdraw.cpp index a0fc701de..b07395065 100644 --- a/examples/common/debugdraw/debugdraw.cpp +++ b/examples/common/debugdraw/debugdraw.cpp @@ -435,7 +435,7 @@ struct DebugDraw { Mesh::Enum id = Mesh::Enum(Mesh::Cone0+mesh); - const uint32_t num = getCircleLod(mesh); + const uint32_t num = getCircleLod(uint8_t(mesh) ); const float step = bx::pi * 2.0f / num; const uint32_t numVertices = num+1; @@ -466,19 +466,19 @@ struct DebugDraw vertex[ii].m_z = xy[0]; vertex[ii].m_indices[0] = 0; - index[ii*3+0] = num; - index[ii*3+1] = (ii+1)%num; - index[ii*3+2] = ii; + index[ii*3+0] = uint16_t(num); + index[ii*3+1] = uint16_t( (ii+1)%num); + index[ii*3+2] = uint16_t(ii); index[num*3+ii*3+0] = 0; - index[num*3+ii*3+1] = ii; - index[num*3+ii*3+2] = (ii+1)%num; + index[num*3+ii*3+1] = uint16_t(ii); + index[num*3+ii*3+2] = uint16_t( (ii+1)%num); - index[numIndices+ii*2+0] = ii; - index[numIndices+ii*2+1] = num; + index[numIndices+ii*2+0] = uint16_t(ii); + index[numIndices+ii*2+1] = uint16_t(num); - index[numIndices+num*2+ii*2+0] = ii; - index[numIndices+num*2+ii*2+1] = (ii+1)%num; + index[numIndices+num*2+ii*2+0] = uint16_t(ii); + index[numIndices+num*2+ii*2+1] = uint16_t( (ii+1)%num); } m_mesh[id].m_startVertex = startVertex; @@ -496,7 +496,7 @@ struct DebugDraw { Mesh::Enum id = Mesh::Enum(Mesh::Cylinder0+mesh); - const uint32_t num = getCircleLod(mesh); + const uint32_t num = getCircleLod(uint8_t(mesh) ); const float step = bx::pi * 2.0f / num; const uint32_t numVertices = num*2; @@ -527,28 +527,28 @@ struct DebugDraw vertex[ii+num].m_z = xy[0]; vertex[ii+num].m_indices[0] = 1; - index[ii*6+0] = ii+num; - index[ii*6+1] = (ii+1)%num; - index[ii*6+2] = ii; - index[ii*6+3] = ii+num; - index[ii*6+4] = (ii+1)%num+num; - index[ii*6+5] = (ii+1)%num; + index[ii*6+0] = uint16_t(ii+num); + index[ii*6+1] = uint16_t( (ii+1)%num); + index[ii*6+2] = uint16_t(ii); + index[ii*6+3] = uint16_t(ii+num); + index[ii*6+4] = uint16_t( (ii+1)%num+num); + index[ii*6+5] = uint16_t( (ii+1)%num); - index[num*6+ii*6+0] = 0; - index[num*6+ii*6+1] = ii; - index[num*6+ii*6+2] = (ii+1)%num; - index[num*6+ii*6+3] = num; - index[num*6+ii*6+4] = (ii+1)%num+num; - index[num*6+ii*6+5] = ii+num; + index[num*6+ii*6+0] = uint16_t(0); + index[num*6+ii*6+1] = uint16_t(ii); + index[num*6+ii*6+2] = uint16_t( (ii+1)%num); + index[num*6+ii*6+3] = uint16_t(num); + index[num*6+ii*6+4] = uint16_t( (ii+1)%num+num); + index[num*6+ii*6+5] = uint16_t(ii+num); - index[numIndices+ii*2+0] = ii; - index[numIndices+ii*2+1] = ii+num; + index[numIndices+ii*2+0] = uint16_t(ii); + index[numIndices+ii*2+1] = uint16_t(ii+num); - index[numIndices+num*2+ii*2+0] = ii; - index[numIndices+num*2+ii*2+1] = (ii+1)%num; + index[numIndices+num*2+ii*2+0] = uint16_t(ii); + index[numIndices+num*2+ii*2+1] = uint16_t( (ii+1)%num); - index[numIndices+num*4+ii*2+0] = num + ii; - index[numIndices+num*4+ii*2+1] = num + (ii+1)%num; + index[numIndices+num*4+ii*2+0] = uint16_t(num + ii); + index[numIndices+num*4+ii*2+1] = uint16_t(num + (ii+1)%num); } m_mesh[id].m_startVertex = startVertex;