Explorar o código

Fixed more variable shadowing warnings.

Branimir Karadžić %!s(int64=10) %!d(string=hai) anos
pai
achega
0490fbcd1e

+ 1 - 2
examples/08-update/update.cpp

@@ -292,8 +292,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 				for (uint32_t ii = 0, num = bx::uint32_min(10, (uint32_t)quads.size() ); ii < num; ++ii)
 				for (uint32_t ii = 0, num = bx::uint32_min(10, (uint32_t)quads.size() ); ii < num; ++ii)
 				{
 				{
-					const PackCube& face = quads.front();
-					cube.clear(face);
+					cube.clear(quads.front() );
 					quads.pop_front();
 					quads.pop_front();
 				}
 				}
 			}
 			}

+ 9 - 5
examples/12-lod/lod.cpp

@@ -20,7 +20,7 @@ KnightPos knightTour[8*4] =
 	{0,0}, {1,2}, {3,3}, {4,1}, {5,3}, {7,2}, {6,0}, {5,2},
 	{0,0}, {1,2}, {3,3}, {4,1}, {5,3}, {7,2}, {6,0}, {5,2},
 	{7,3}, {6,1}, {4,0}, {3,2}, {2,0}, {0,1}, {1,3}, {2,1},
 	{7,3}, {6,1}, {4,0}, {3,2}, {2,0}, {0,1}, {1,3}, {2,1},
 	{0,2}, {1,0}, {2,2}, {0,3}, {1,1}, {3,0}, {4,2}, {5,0},
 	{0,2}, {1,0}, {2,2}, {0,3}, {1,1}, {3,0}, {4,2}, {5,0},
-	{7,1}, {6,3}, {5,1}, {7,0}, {6,2}, {4,3}, {3,1}, {2,3}
+	{7,1}, {6,3}, {5,1}, {7,0}, {6,2}, {4,3}, {3,1}, {2,3},
 };
 };
 
 
 int _main_(int /*_argc*/, char** /*_argv*/)
 int _main_(int /*_argc*/, char** /*_argv*/)
@@ -55,15 +55,19 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 	bgfx::TextureHandle textureStipple;
 	bgfx::TextureHandle textureStipple;
 
 
-	const bgfx::Memory* stipple = bgfx::alloc(8*4);
-	memset(stipple->data, 0, stipple->size);
+	const bgfx::Memory* stippleTex = bgfx::alloc(8*4);
+	memset(stippleTex->data, 0, stippleTex->size);
 
 
 	for (uint32_t ii = 0; ii < 32; ++ii)
 	for (uint32_t ii = 0; ii < 32; ++ii)
 	{
 	{
-		stipple->data[knightTour[ii].m_y * 8 + knightTour[ii].m_x] = ii*4;
+		stippleTex->data[knightTour[ii].m_y * 8 + knightTour[ii].m_x] = ii*4;
 	}
 	}
 
 
-	textureStipple = bgfx::createTexture2D(8, 4, 1, bgfx::TextureFormat::R8, BGFX_TEXTURE_MAG_POINT|BGFX_TEXTURE_MIN_POINT, stipple);
+	textureStipple = bgfx::createTexture2D(8, 4, 1
+			, bgfx::TextureFormat::R8
+			, BGFX_TEXTURE_MAG_POINT|BGFX_TEXTURE_MIN_POINT
+			, stippleTex
+			);
 
 
 	Mesh* meshTop[3] =
 	Mesh* meshTop[3] =
 	{
 	{

+ 2 - 2
examples/13-stencil/stencil.cpp

@@ -1319,10 +1319,10 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 						);
 						);
 
 
 					// Cubes.
 					// Cubes.
-					for (uint8_t ii = 0; ii < numCubes; ++ii)
+					for (uint8_t jj = 0; jj < numCubes; ++jj)
 					{
 					{
 						cubeMesh.submit(viewId
 						cubeMesh.submit(viewId
-							, cubeMtx[ii]
+							, cubeMtx[jj]
 							, programTextureLightning
 							, programTextureLightning
 							, s_renderStates[RenderState::ProjectionShadows_DrawDiffuse]
 							, s_renderStates[RenderState::ProjectionShadows_DrawDiffuse]
 							, figureTex
 							, figureTex

+ 3 - 5
examples/24-nbody/nbody.cpp

@@ -209,7 +209,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 		imguiSlider("Random seed", u_paramsData.baseSeed, 0, 100);
 		imguiSlider("Random seed", u_paramsData.baseSeed, 0, 100);
 		int32_t shape = imguiChoose(u_paramsData.initialShape, "Point", "Sphere", "Box", "Donut");
 		int32_t shape = imguiChoose(u_paramsData.initialShape, "Point", "Sphere", "Box", "Donut");
 		imguiSlider("Initial speed", u_paramsData.initialSpeed, 0.0f, 300.0f, 0.1f);
 		imguiSlider("Initial speed", u_paramsData.initialSpeed, 0.0f, 300.0f, 0.1f);
-		bool reset = imguiButton("Reset");
+		bool defaults = imguiButton("Reset");
 		imguiSeparatorLine();
 		imguiSeparatorLine();
 		imguiSlider("Particle count (x512)", u_paramsData.dispatchSize, 1, 64);
 		imguiSlider("Particle count (x512)", u_paramsData.dispatchSize, 1, 64);
 		imguiSlider("Gravity", u_paramsData.gravity, 0.0f, 0.3f, 0.001f);
 		imguiSlider("Gravity", u_paramsData.gravity, 0.0f, 0.3f, 0.001f);
@@ -226,11 +226,11 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 		// Modify parameters and reset if shape is changed
 		// Modify parameters and reset if shape is changed
 		if (shape != u_paramsData.initialShape)
 		if (shape != u_paramsData.initialShape)
 		{
 		{
-			reset = true;
+			defaults = true;
 			InitializeParams(shape, &u_paramsData);
 			InitializeParams(shape, &u_paramsData);
 		}
 		}
 
 
-		if (reset)
+		if (defaults)
 		{
 		{
 			bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Write);
 			bgfx::setBuffer(0, prevPositionBuffer0, bgfx::Access::Write);
 			bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Write);
 			bgfx::setBuffer(1, currPositionBuffer0, bgfx::Access::Write);
@@ -248,8 +248,6 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 		bx::xchg(currPositionBuffer0, currPositionBuffer1);
 		bx::xchg(currPositionBuffer0, currPositionBuffer1);
 		bx::xchg(prevPositionBuffer0, prevPositionBuffer1);
 		bx::xchg(prevPositionBuffer0, prevPositionBuffer1);
 
 
-		float view[16];
-
 		// Update camera.
 		// Update camera.
 		cameraUpdate(deltaTime, mouseState);
 		cameraUpdate(deltaTime, mouseState);
 		cameraGetViewMtx(view);
 		cameraGetViewMtx(view);