Branimir Karadžić 10 years ago
parent
commit
921a315c4d

+ 1 - 1
examples/01-cubes/cubes.cpp

@@ -119,7 +119,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 		// Set view and projection matrix for view 0.
 		// Set view and projection matrix for view 0.
 		const bgfx::HMD* hmd = bgfx::getHMD();
 		const bgfx::HMD* hmd = bgfx::getHMD();
-		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING))
+		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
 		{
 		{
 			float view[16];
 			float view[16];
 			bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
 			bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);

+ 1 - 1
examples/02-metaballs/metaballs.cpp

@@ -548,7 +548,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 		// Set view and projection matrix for view 0.
 		// Set view and projection matrix for view 0.
 		const bgfx::HMD* hmd = bgfx::getHMD();
 		const bgfx::HMD* hmd = bgfx::getHMD();
-		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING))
+		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
 		{
 		{
 			float view[16];
 			float view[16];
 			bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
 			bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);

+ 1 - 1
examples/04-mesh/mesh.cpp

@@ -65,7 +65,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 		// Set view and projection matrix for view 0.
 		// Set view and projection matrix for view 0.
 		const bgfx::HMD* hmd = bgfx::getHMD();
 		const bgfx::HMD* hmd = bgfx::getHMD();
-		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING))
+		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
 		{
 		{
 			float view[16];
 			float view[16];
 			bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
 			bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);

+ 1 - 1
examples/05-instancing/instancing.cpp

@@ -135,7 +135,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 			// Set view and projection matrix for view 0.
 			// Set view and projection matrix for view 0.
 			const bgfx::HMD* hmd = bgfx::getHMD();
 			const bgfx::HMD* hmd = bgfx::getHMD();
-			if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING))
+			if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
 			{
 			{
 				float view[16];
 				float view[16];
 				bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
 				bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);

+ 1 - 1
examples/06-bump/bump.cpp

@@ -195,7 +195,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 		// Set view and projection matrix for view 0.
 		// Set view and projection matrix for view 0.
 		const bgfx::HMD* hmd = bgfx::getHMD();
 		const bgfx::HMD* hmd = bgfx::getHMD();
-		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING))
+		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
 		{
 		{
 			float view[16];
 			float view[16];
 			bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
 			bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);

+ 1 - 1
examples/10-font/font.cpp

@@ -203,7 +203,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 		// Setup a top-left ortho matrix for screen space drawing.
 		// Setup a top-left ortho matrix for screen space drawing.
 		const bgfx::HMD* hmd = bgfx::getHMD();
 		const bgfx::HMD* hmd = bgfx::getHMD();
-		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING))
+		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
 		{
 		{
 			float proj[16];
 			float proj[16];
 			bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
 			bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);

+ 1 - 1
examples/11-fontsdf/fontsdf.cpp

@@ -201,7 +201,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 		// Setup a top-left ortho matrix for screen space drawing.
 		// Setup a top-left ortho matrix for screen space drawing.
 		const bgfx::HMD* hmd = bgfx::getHMD();
 		const bgfx::HMD* hmd = bgfx::getHMD();
-		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING))
+		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
 		{
 		{
 			float proj[16];
 			float proj[16];
 			bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);
 			bx::mtxProj(proj, hmd->eye[0].fov, 0.1f, 100.0f);

+ 1 - 1
examples/12-lod/lod.cpp

@@ -163,7 +163,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 		// Set view and projection matrix for view 0.
 		// Set view and projection matrix for view 0.
 		const bgfx::HMD* hmd = bgfx::getHMD();
 		const bgfx::HMD* hmd = bgfx::getHMD();
-		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING))
+		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
 		{
 		{
 			float view[16];
 			float view[16];
 			bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);
 			bx::mtxQuatTranslationHMD(view, hmd->eye[0].rotation, eye);

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

@@ -906,7 +906,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 		lightRgbInnerR[ii][2] = rgbInnerR[index][2];
 		lightRgbInnerR[ii][2] = rgbInnerR[index][2];
 		lightRgbInnerR[ii][3] = rgbInnerR[index][3];
 		lightRgbInnerR[ii][3] = rgbInnerR[index][3];
 	}
 	}
-	memcpy(s_uniforms.m_lightRgbInnerR, lightRgbInnerR, MAX_NUM_LIGHTS * 4*sizeof(float));
+	memcpy(s_uniforms.m_lightRgbInnerR, lightRgbInnerR, MAX_NUM_LIGHTS * 4*sizeof(float) );
 
 
 	// Set view and projection matrices.
 	// Set view and projection matrices.
 	const float aspect = float(viewState.m_width)/float(viewState.m_height);
 	const float aspect = float(viewState.m_width)/float(viewState.m_height);
@@ -1031,11 +1031,11 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 		for (uint8_t ii = 0; ii < numLights; ++ii)
 		for (uint8_t ii = 0; ii < numLights; ++ii)
 		{
 		{
 			lightPosRadius[ii][0] = sinf( (lightTimeAccumulator*1.1f + ii*0.03f + ii*bx::piHalf*1.07f ) )*20.0f;
 			lightPosRadius[ii][0] = sinf( (lightTimeAccumulator*1.1f + ii*0.03f + ii*bx::piHalf*1.07f ) )*20.0f;
-			lightPosRadius[ii][1] = 8.0f + (1.0f - cosf( (lightTimeAccumulator*1.5f + ii*0.29f + bx::piHalf*1.49f ) ))*4.0f;
+			lightPosRadius[ii][1] = 8.0f + (1.0f - cosf( (lightTimeAccumulator*1.5f + ii*0.29f + bx::piHalf*1.49f ) ) )*4.0f;
 			lightPosRadius[ii][2] = cosf( (lightTimeAccumulator*1.3f + ii*0.13f + ii*bx::piHalf*1.79f ) )*20.0f;
 			lightPosRadius[ii][2] = cosf( (lightTimeAccumulator*1.3f + ii*0.13f + ii*bx::piHalf*1.79f ) )*20.0f;
 			lightPosRadius[ii][3] = radius;
 			lightPosRadius[ii][3] = radius;
 		}
 		}
-		memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float));
+		memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float) );
 
 
 		// Floor position.
 		// Floor position.
 		float floorMtx[16];
 		float floorMtx[16];
@@ -1153,7 +1153,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 					bx::vec3MulMtx(reflectedLights[ii], lightPosRadius[ii], reflectMtx);
 					bx::vec3MulMtx(reflectedLights[ii], lightPosRadius[ii], reflectMtx);
 					reflectedLights[ii][3] = lightPosRadius[ii][3];
 					reflectedLights[ii][3] = lightPosRadius[ii][3];
 				}
 				}
-				memcpy(s_uniforms.m_lightPosRadius, reflectedLights, numLights * 4*sizeof(float));
+				memcpy(s_uniforms.m_lightPosRadius, reflectedLights, numLights * 4*sizeof(float) );
 
 
 				// Reflect and submit bunny.
 				// Reflect and submit bunny.
 				float mtxReflectedBunny[16];
 				float mtxReflectedBunny[16];
@@ -1177,7 +1177,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 				}
 				}
 
 
 				// Set lights back.
 				// Set lights back.
-				memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float));
+				memcpy(s_uniforms.m_lightPosRadius, lightPosRadius, numLights * 4*sizeof(float) );
 				// Third pass - Blend plane.
 				// Third pass - Blend plane.
 
 
 				// Floor.
 				// Floor.

+ 6 - 6
examples/14-shadowvolumes/shadowvolumes.cpp

@@ -843,7 +843,7 @@ struct Group
 
 
 		//Init faces and edges.
 		//Init faces and edges.
 		m_faces.reserve(m_numIndices/3); //1 face = 3 indices
 		m_faces.reserve(m_numIndices/3); //1 face = 3 indices
-		m_edges = (Edge*)malloc(m_numIndices * sizeof(Edge)); //1 triangle = 3 indices = 3 edges.
+		m_edges = (Edge*)malloc(m_numIndices * sizeof(Edge) ); //1 triangle = 3 indices = 3 edges.
 		m_edgePlanesUnalignedPtr = (Plane*)malloc(m_numIndices * sizeof(Plane) + 15);
 		m_edgePlanesUnalignedPtr = (Plane*)malloc(m_numIndices * sizeof(Plane) + 15);
 		m_edgePlanes = (Plane*)bx::alignPtr(m_edgePlanesUnalignedPtr, 0, 16);
 		m_edgePlanes = (Plane*)bx::alignPtr(m_edgePlanesUnalignedPtr, 0, 16);
 
 
@@ -910,7 +910,7 @@ struct Group
 				std::pair<uint16_t, uint16_t> keyInv = std::make_pair(ui1, ui0);
 				std::pair<uint16_t, uint16_t> keyInv = std::make_pair(ui1, ui0);
 
 
 				EdgeMap::iterator iter = edgeMap.find(keyInv);
 				EdgeMap::iterator iter = edgeMap.find(keyInv);
-				if (iter != edgeMap.end())
+				if (iter != edgeMap.end() )
 				{
 				{
 					EdgeAndPlane& ep = iter->second;
 					EdgeAndPlane& ep = iter->second;
 					memcpy(ep.m_plane[ep.m_faceIndex].m_plane, plane, 4*sizeof(float) );
 					memcpy(ep.m_plane[ep.m_faceIndex].m_plane, plane, 4*sizeof(float) );
@@ -935,8 +935,8 @@ struct Group
 			Edge* edge = &m_edges[m_numEdges];
 			Edge* edge = &m_edges[m_numEdges];
 			Plane* plane = &m_edgePlanes[index];
 			Plane* plane = &m_edgePlanes[index];
 
 
-			memcpy(edge, iter->second.m_faceReverseOrder, sizeof(Edge));
-			memcpy(plane, iter->second.m_plane, 2 * sizeof(Plane));
+			memcpy(edge, iter->second.m_faceReverseOrder, sizeof(Edge) );
+			memcpy(plane, iter->second.m_plane, 2 * sizeof(Plane) );
 
 
 			m_numEdges++;
 			m_numEdges++;
 			index += 2;
 			index += 2;
@@ -1547,7 +1547,7 @@ void shadowVolumeCreate(ShadowVolume& _shadowVolume
 				const float4_t r1 = float4_mul(vY, ly);
 				const float4_t r1 = float4_mul(vY, ly);
 				const float4_t r2 = float4_mul(vZ, lz);
 				const float4_t r2 = float4_mul(vZ, lz);
 
 
-				const float4_t dot = float4_add(r0, float4_add(r1, r2));
+				const float4_t dot = float4_add(r0, float4_add(r1, r2) );
 				const float4_t f = float4_add(dot, vW);
 				const float4_t f = float4_add(dot, vW);
 
 
 				const float4_t zero = float4_zero();
 				const float4_t zero = float4_zero();
@@ -2107,7 +2107,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 		// Set view and projection matrix for view 0.
 		// Set view and projection matrix for view 0.
 		const bgfx::HMD* hmd = bgfx::getHMD();
 		const bgfx::HMD* hmd = bgfx::getHMD();
-		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING))
+		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
 		{
 		{
 			float eye[3];
 			float eye[3];
 			cameraGetPosition(eye);
 			cameraGetPosition(eye);

+ 3 - 3
examples/16-shadowmaps/shadowmaps.cpp

@@ -1985,9 +1985,9 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 #define IMGUI_FLOAT_SLIDER(_name, _val) \
 #define IMGUI_FLOAT_SLIDER(_name, _val) \
 			imguiSlider(_name \
 			imguiSlider(_name \
 					, _val \
 					, _val \
-					, *(((float*)&_val)+1) \
-					, *(((float*)&_val)+2) \
-					, *(((float*)&_val)+3) \
+					, *( ((float*)&_val)+1) \
+					, *( ((float*)&_val)+2) \
+					, *( ((float*)&_val)+3) \
 					)
 					)
 
 
 		imguiBool("Update lights", settings.m_updateLights);
 		imguiBool("Update lights", settings.m_updateLights);

+ 2 - 2
examples/18-ibl/ibl.cpp

@@ -434,8 +434,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 		s_uniforms.m_flags[1] = float(settings.m_specular);
 		s_uniforms.m_flags[1] = float(settings.m_specular);
 		s_uniforms.m_flags[2] = float(settings.m_diffuseIbl);
 		s_uniforms.m_flags[2] = float(settings.m_diffuseIbl);
 		s_uniforms.m_flags[3] = float(settings.m_specularIbl);
 		s_uniforms.m_flags[3] = float(settings.m_specularIbl);
-		memcpy(s_uniforms.m_rgbDiff, settings.m_rgbDiff, 3*sizeof(float));
-		memcpy(s_uniforms.m_rgbSpec, settings.m_rgbSpec, 3*sizeof(float));
+		memcpy(s_uniforms.m_rgbDiff, settings.m_rgbDiff, 3*sizeof(float) );
+		memcpy(s_uniforms.m_rgbSpec, settings.m_rgbSpec, 3*sizeof(float) );
 
 
 		s_uniforms.submitPerFrameUniforms();
 		s_uniforms.submitPerFrameUniforms();
 
 

+ 89 - 89
examples/20-nanovg/nanovg.cpp

@@ -91,12 +91,12 @@ void drawWindow(struct NVGcontext* vg, const char* title, float x, float y, floa
 	// Window
 	// Window
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x,y, w,h, cornerRadius);
 	nvgRoundedRect(vg, x,y, w,h, cornerRadius);
-	nvgFillColor(vg, nvgRGBA(28,30,34,192));
-	//	nvgFillColor(vg, nvgRGBA(0,0,0,128));
+	nvgFillColor(vg, nvgRGBA(28,30,34,192) );
+	//	nvgFillColor(vg, nvgRGBA(0,0,0,128) );
 	nvgFill(vg);
 	nvgFill(vg);
 
 
 	// Drop shadow
 	// Drop shadow
-	shadowPaint = nvgBoxGradient(vg, x,y+2, w,h, cornerRadius*2, 10, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0));
+	shadowPaint = nvgBoxGradient(vg, x,y+2, w,h, cornerRadius*2, 10, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRect(vg, x-10,y-10, w+20,h+30);
 	nvgRect(vg, x-10,y-10, w+20,h+30);
 	nvgRoundedRect(vg, x,y, w,h, cornerRadius);
 	nvgRoundedRect(vg, x,y, w,h, cornerRadius);
@@ -105,7 +105,7 @@ void drawWindow(struct NVGcontext* vg, const char* title, float x, float y, floa
 	nvgFill(vg);
 	nvgFill(vg);
 
 
 	// Header
 	// Header
-	headerPaint = nvgLinearGradient(vg, x,y,x,y+15, nvgRGBA(255,255,255,8), nvgRGBA(0,0,0,16));
+	headerPaint = nvgLinearGradient(vg, x,y,x,y+15, nvgRGBA(255,255,255,8), nvgRGBA(0,0,0,16) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x+1,y+1, w-2,30, cornerRadius-1);
 	nvgRoundedRect(vg, x+1,y+1, w-2,30, cornerRadius-1);
 	nvgFillPaint(vg, headerPaint);
 	nvgFillPaint(vg, headerPaint);
@@ -113,7 +113,7 @@ void drawWindow(struct NVGcontext* vg, const char* title, float x, float y, floa
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgMoveTo(vg, x+0.5f, y+0.5f+30);
 	nvgMoveTo(vg, x+0.5f, y+0.5f+30);
 	nvgLineTo(vg, x+0.5f+w-1, y+0.5f+30);
 	nvgLineTo(vg, x+0.5f+w-1, y+0.5f+30);
-	nvgStrokeColor(vg, nvgRGBA(0,0,0,32));
+	nvgStrokeColor(vg, nvgRGBA(0,0,0,32) );
 	nvgStroke(vg);
 	nvgStroke(vg);
 
 
 	nvgFontSize(vg, 18.0f);
 	nvgFontSize(vg, 18.0f);
@@ -121,11 +121,11 @@ void drawWindow(struct NVGcontext* vg, const char* title, float x, float y, floa
 	nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
 
 
 	nvgFontBlur(vg,2);
 	nvgFontBlur(vg,2);
-	nvgFillColor(vg, nvgRGBA(0,0,0,128));
+	nvgFillColor(vg, nvgRGBA(0,0,0,128) );
 	nvgText(vg, x+w/2,y+16+1, title, NULL);
 	nvgText(vg, x+w/2,y+16+1, title, NULL);
 
 
 	nvgFontBlur(vg,0);
 	nvgFontBlur(vg,0);
-	nvgFillColor(vg, nvgRGBA(220,220,220,160));
+	nvgFillColor(vg, nvgRGBA(220,220,220,160) );
 	nvgText(vg, x+w/2,y+16, title, NULL);
 	nvgText(vg, x+w/2,y+16, title, NULL);
 
 
 	nvgRestore(vg);
 	nvgRestore(vg);
@@ -138,7 +138,7 @@ void drawSearchBox(struct NVGcontext* vg, const char* text, float x, float y, fl
 	float cornerRadius = h/2-1;
 	float cornerRadius = h/2-1;
 
 
 	// Edit
 	// Edit
-	bg = nvgBoxGradient(vg, x,y+1.5f, w,h, h/2,5, nvgRGBA(0,0,0,16), nvgRGBA(0,0,0,92));
+	bg = nvgBoxGradient(vg, x,y+1.5f, w,h, h/2,5, nvgRGBA(0,0,0,16), nvgRGBA(0,0,0,92) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x,y, w,h, cornerRadius);
 	nvgRoundedRect(vg, x,y, w,h, cornerRadius);
 	nvgFillPaint(vg, bg);
 	nvgFillPaint(vg, bg);
@@ -146,25 +146,25 @@ void drawSearchBox(struct NVGcontext* vg, const char* text, float x, float y, fl
 
 
 	/*	nvgBeginPath(vg);
 	/*	nvgBeginPath(vg);
 		nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, cornerRadius-0.5f);
 		nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, cornerRadius-0.5f);
-		nvgStrokeColor(vg, nvgRGBA(0,0,0,48));
+		nvgStrokeColor(vg, nvgRGBA(0,0,0,48) );
 		nvgStroke(vg);*/
 		nvgStroke(vg);*/
 
 
 	nvgFontSize(vg, h*1.3f);
 	nvgFontSize(vg, h*1.3f);
 	nvgFontFace(vg, "icons");
 	nvgFontFace(vg, "icons");
-	nvgFillColor(vg, nvgRGBA(255,255,255,64));
+	nvgFillColor(vg, nvgRGBA(255,255,255,64) );
 	nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
 	nvgText(vg, x+h*0.55f, y+h*0.55f, cpToUTF8(ICON_SEARCH,icon), NULL);
 	nvgText(vg, x+h*0.55f, y+h*0.55f, cpToUTF8(ICON_SEARCH,icon), NULL);
 
 
 	nvgFontSize(vg, 20.0f);
 	nvgFontSize(vg, 20.0f);
 	nvgFontFace(vg, "sans");
 	nvgFontFace(vg, "sans");
-	nvgFillColor(vg, nvgRGBA(255,255,255,32));
+	nvgFillColor(vg, nvgRGBA(255,255,255,32) );
 
 
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 	nvgText(vg, x+h*1.05f,y+h*0.5f,text, NULL);
 	nvgText(vg, x+h*1.05f,y+h*0.5f,text, NULL);
 
 
 	nvgFontSize(vg, h*1.3f);
 	nvgFontSize(vg, h*1.3f);
 	nvgFontFace(vg, "icons");
 	nvgFontFace(vg, "icons");
-	nvgFillColor(vg, nvgRGBA(255,255,255,32));
+	nvgFillColor(vg, nvgRGBA(255,255,255,32) );
 	nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
 	nvgText(vg, x+w-h*0.55f, y+h*0.55f, cpToUTF8(ICON_CIRCLED_CROSS,icon), NULL);
 	nvgText(vg, x+w-h*0.55f, y+h*0.55f, cpToUTF8(ICON_CIRCLED_CROSS,icon), NULL);
 }
 }
@@ -175,7 +175,7 @@ void drawDropDown(struct NVGcontext* vg, const char* text, float x, float y, flo
 	char icon[8];
 	char icon[8];
 	float cornerRadius = 4.0f;
 	float cornerRadius = 4.0f;
 
 
-	bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(255,255,255,16), nvgRGBA(0,0,0,16));
+	bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(255,255,255,16), nvgRGBA(0,0,0,16) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x+1,y+1, w-2,h-2, cornerRadius-1);
 	nvgRoundedRect(vg, x+1,y+1, w-2,h-2, cornerRadius-1);
 	nvgFillPaint(vg, bg);
 	nvgFillPaint(vg, bg);
@@ -183,18 +183,18 @@ void drawDropDown(struct NVGcontext* vg, const char* text, float x, float y, flo
 
 
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, cornerRadius-0.5f);
 	nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, cornerRadius-0.5f);
-	nvgStrokeColor(vg, nvgRGBA(0,0,0,48));
+	nvgStrokeColor(vg, nvgRGBA(0,0,0,48) );
 	nvgStroke(vg);
 	nvgStroke(vg);
 
 
 	nvgFontSize(vg, 20.0f);
 	nvgFontSize(vg, 20.0f);
 	nvgFontFace(vg, "sans");
 	nvgFontFace(vg, "sans");
-	nvgFillColor(vg, nvgRGBA(255,255,255,160));
+	nvgFillColor(vg, nvgRGBA(255,255,255,160) );
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 	nvgText(vg, x+h*0.3f,y+h*0.5f,text, NULL);
 	nvgText(vg, x+h*0.3f,y+h*0.5f,text, NULL);
 
 
 	nvgFontSize(vg, h*1.3f);
 	nvgFontSize(vg, h*1.3f);
 	nvgFontFace(vg, "icons");
 	nvgFontFace(vg, "icons");
-	nvgFillColor(vg, nvgRGBA(255,255,255,64));
+	nvgFillColor(vg, nvgRGBA(255,255,255,64) );
 	nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
 	nvgText(vg, x+w-h*0.5f, y+h*0.5f, cpToUTF8(ICON_CHEVRON_RIGHT,icon), NULL);
 	nvgText(vg, x+w-h*0.5f, y+h*0.5f, cpToUTF8(ICON_CHEVRON_RIGHT,icon), NULL);
 }
 }
@@ -205,7 +205,7 @@ void drawLabel(struct NVGcontext* vg, const char* text, float x, float y, float
 
 
 	nvgFontSize(vg, 18.0f);
 	nvgFontSize(vg, 18.0f);
 	nvgFontFace(vg, "sans");
 	nvgFontFace(vg, "sans");
-	nvgFillColor(vg, nvgRGBA(255,255,255,128));
+	nvgFillColor(vg, nvgRGBA(255,255,255,128) );
 
 
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 	nvgText(vg, x,y+h*0.5f,text, NULL);
 	nvgText(vg, x,y+h*0.5f,text, NULL);
@@ -215,7 +215,7 @@ void drawEditBoxBase(struct NVGcontext* vg, float x, float y, float w, float h)
 {
 {
 	struct NVGpaint bg;
 	struct NVGpaint bg;
 	// Edit
 	// Edit
-	bg = nvgBoxGradient(vg, x+1,y+1+1.5f, w-2,h-2, 3,4, nvgRGBA(255,255,255,32), nvgRGBA(32,32,32,32));
+	bg = nvgBoxGradient(vg, x+1,y+1+1.5f, w-2,h-2, 3,4, nvgRGBA(255,255,255,32), nvgRGBA(32,32,32,32) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x+1,y+1, w-2,h-2, 4-1);
 	nvgRoundedRect(vg, x+1,y+1, w-2,h-2, 4-1);
 	nvgFillPaint(vg, bg);
 	nvgFillPaint(vg, bg);
@@ -223,7 +223,7 @@ void drawEditBoxBase(struct NVGcontext* vg, float x, float y, float w, float h)
 
 
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, 4-0.5f);
 	nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, 4-0.5f);
-	nvgStrokeColor(vg, nvgRGBA(0,0,0,48));
+	nvgStrokeColor(vg, nvgRGBA(0,0,0,48) );
 	nvgStroke(vg);
 	nvgStroke(vg);
 }
 }
 
 
@@ -233,7 +233,7 @@ void drawEditBox(struct NVGcontext* vg, const char* text, float x, float y, floa
 
 
 	nvgFontSize(vg, 20.0f);
 	nvgFontSize(vg, 20.0f);
 	nvgFontFace(vg, "sans");
 	nvgFontFace(vg, "sans");
-	nvgFillColor(vg, nvgRGBA(255,255,255,64));
+	nvgFillColor(vg, nvgRGBA(255,255,255,64) );
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 	nvgText(vg, x+h*0.3f,y+h*0.5f,text, NULL);
 	nvgText(vg, x+h*0.3f,y+h*0.5f,text, NULL);
 }
 }
@@ -249,13 +249,13 @@ void drawEditBoxNum(struct NVGcontext* vg,
 
 
 	nvgFontSize(vg, 18.0f);
 	nvgFontSize(vg, 18.0f);
 	nvgFontFace(vg, "sans");
 	nvgFontFace(vg, "sans");
-	nvgFillColor(vg, nvgRGBA(255,255,255,64));
+	nvgFillColor(vg, nvgRGBA(255,255,255,64) );
 	nvgTextAlign(vg,NVG_ALIGN_RIGHT|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_RIGHT|NVG_ALIGN_MIDDLE);
 	nvgText(vg, x+w-h*0.3f,y+h*0.5f,units, NULL);
 	nvgText(vg, x+w-h*0.3f,y+h*0.5f,units, NULL);
 
 
 	nvgFontSize(vg, 20.0f);
 	nvgFontSize(vg, 20.0f);
 	nvgFontFace(vg, "sans");
 	nvgFontFace(vg, "sans");
-	nvgFillColor(vg, nvgRGBA(255,255,255,128));
+	nvgFillColor(vg, nvgRGBA(255,255,255,128) );
 	nvgTextAlign(vg,NVG_ALIGN_RIGHT|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_RIGHT|NVG_ALIGN_MIDDLE);
 	nvgText(vg, x+w-uw-h*0.5f,y+h*0.5f,text, NULL);
 	nvgText(vg, x+w-uw-h*0.5f,y+h*0.5f,text, NULL);
 }
 }
@@ -268,12 +268,12 @@ void drawCheckBox(struct NVGcontext* vg, const char* text, float x, float y, flo
 
 
 	nvgFontSize(vg, 18.0f);
 	nvgFontSize(vg, 18.0f);
 	nvgFontFace(vg, "sans");
 	nvgFontFace(vg, "sans");
-	nvgFillColor(vg, nvgRGBA(255,255,255,160));
+	nvgFillColor(vg, nvgRGBA(255,255,255,160) );
 
 
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 	nvgText(vg, x+28,y+h*0.5f,text, NULL);
 	nvgText(vg, x+28,y+h*0.5f,text, NULL);
 
 
-	bg = nvgBoxGradient(vg, x+1,y+(int)(h*0.5f)-9+1, 18,18, 3,3, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,92));
+	bg = nvgBoxGradient(vg, x+1,y+(int)(h*0.5f)-9+1, 18,18, 3,3, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,92) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x+1,y+(int)(h*0.5f)-9, 18,18, 3);
 	nvgRoundedRect(vg, x+1,y+(int)(h*0.5f)-9, 18,18, 3);
 	nvgFillPaint(vg, bg);
 	nvgFillPaint(vg, bg);
@@ -281,7 +281,7 @@ void drawCheckBox(struct NVGcontext* vg, const char* text, float x, float y, flo
 
 
 	nvgFontSize(vg, 40);
 	nvgFontSize(vg, 40);
 	nvgFontFace(vg, "icons");
 	nvgFontFace(vg, "icons");
-	nvgFillColor(vg, nvgRGBA(255,255,255,128));
+	nvgFillColor(vg, nvgRGBA(255,255,255,128) );
 	nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_CENTER|NVG_ALIGN_MIDDLE);
 	nvgText(vg, x+9+2, y+h*0.5f, cpToUTF8(ICON_CHECK,icon), NULL);
 	nvgText(vg, x+9+2, y+h*0.5f, cpToUTF8(ICON_CHECK,icon), NULL);
 }
 }
@@ -293,10 +293,10 @@ void drawButton(struct NVGcontext* vg, int preicon, const char* text, float x, f
 	float cornerRadius = 4.0f;
 	float cornerRadius = 4.0f;
 	float tw = 0, iw = 0;
 	float tw = 0, iw = 0;
 
 
-	bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(255,255,255,isBlack(col)?16:32), nvgRGBA(0,0,0,isBlack(col)?16:32));
+	bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(255,255,255,isBlack(col)?16:32), nvgRGBA(0,0,0,isBlack(col)?16:32) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x+1,y+1, w-2,h-2, cornerRadius-1);
 	nvgRoundedRect(vg, x+1,y+1, w-2,h-2, cornerRadius-1);
-	if (!isBlack(col)) {
+	if (!isBlack(col) ) {
 		nvgFillColor(vg, col);
 		nvgFillColor(vg, col);
 		nvgFill(vg);
 		nvgFill(vg);
 	}
 	}
@@ -305,7 +305,7 @@ void drawButton(struct NVGcontext* vg, int preicon, const char* text, float x, f
 
 
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, cornerRadius-0.5f);
 	nvgRoundedRect(vg, x+0.5f,y+0.5f, w-1,h-1, cornerRadius-0.5f);
-	nvgStrokeColor(vg, nvgRGBA(0,0,0,48));
+	nvgStrokeColor(vg, nvgRGBA(0,0,0,48) );
 	nvgStroke(vg);
 	nvgStroke(vg);
 
 
 	nvgFontSize(vg, 20.0f);
 	nvgFontSize(vg, 20.0f);
@@ -321,7 +321,7 @@ void drawButton(struct NVGcontext* vg, int preicon, const char* text, float x, f
 	if (preicon != 0) {
 	if (preicon != 0) {
 		nvgFontSize(vg, h*1.3f);
 		nvgFontSize(vg, h*1.3f);
 		nvgFontFace(vg, "icons");
 		nvgFontFace(vg, "icons");
-		nvgFillColor(vg, nvgRGBA(255,255,255,96));
+		nvgFillColor(vg, nvgRGBA(255,255,255,96) );
 		nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 		nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 		nvgText(vg, x+w*0.5f-tw*0.5f-iw*0.75f, y+h*0.5f, cpToUTF8(preicon,icon), NULL);
 		nvgText(vg, x+w*0.5f-tw*0.5f-iw*0.75f, y+h*0.5f, cpToUTF8(preicon,icon), NULL);
 	}
 	}
@@ -329,9 +329,9 @@ void drawButton(struct NVGcontext* vg, int preicon, const char* text, float x, f
 	nvgFontSize(vg, 20.0f);
 	nvgFontSize(vg, 20.0f);
 	nvgFontFace(vg, "sans-bold");
 	nvgFontFace(vg, "sans-bold");
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
 	nvgTextAlign(vg,NVG_ALIGN_LEFT|NVG_ALIGN_MIDDLE);
-	nvgFillColor(vg, nvgRGBA(0,0,0,160));
+	nvgFillColor(vg, nvgRGBA(0,0,0,160) );
 	nvgText(vg, x+w*0.5f-tw*0.5f+iw*0.25f,y+h*0.5f-1,text, NULL);
 	nvgText(vg, x+w*0.5f-tw*0.5f+iw*0.25f,y+h*0.5f-1,text, NULL);
-	nvgFillColor(vg, nvgRGBA(255,255,255,160));
+	nvgFillColor(vg, nvgRGBA(255,255,255,160) );
 	nvgText(vg, x+w*0.5f-tw*0.5f+iw*0.25f,y+h*0.5f,text, NULL);
 	nvgText(vg, x+w*0.5f-tw*0.5f+iw*0.25f,y+h*0.5f,text, NULL);
 }
 }
 
 
@@ -345,14 +345,14 @@ void drawSlider(struct NVGcontext* vg, float pos, float x, float y, float w, flo
 	//	nvgClearState(vg);
 	//	nvgClearState(vg);
 
 
 	// Slot
 	// Slot
-	bg = nvgBoxGradient(vg, x,cy-2+1, w,4, 2,2, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,128));
+	bg = nvgBoxGradient(vg, x,cy-2+1, w,4, 2,2, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,128) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x,cy-2, w,4, 2);
 	nvgRoundedRect(vg, x,cy-2, w,4, 2);
 	nvgFillPaint(vg, bg);
 	nvgFillPaint(vg, bg);
 	nvgFill(vg);
 	nvgFill(vg);
 
 
 	// Knob Shadow
 	// Knob Shadow
-	bg = nvgRadialGradient(vg, x+(int)(pos*w),cy+1, kr-3,kr+3, nvgRGBA(0,0,0,64), nvgRGBA(0,0,0,0));
+	bg = nvgRadialGradient(vg, x+(int)(pos*w),cy+1, kr-3,kr+3, nvgRGBA(0,0,0,64), nvgRGBA(0,0,0,0) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRect(vg, x+(int)(pos*w)-kr-5,cy-kr-5,kr*2+5+5,kr*2+5+5+3);
 	nvgRect(vg, x+(int)(pos*w)-kr-5,cy-kr-5,kr*2+5+5,kr*2+5+5+3);
 	nvgCircle(vg, x+(int)(pos*w),cy, kr);
 	nvgCircle(vg, x+(int)(pos*w),cy, kr);
@@ -361,17 +361,17 @@ void drawSlider(struct NVGcontext* vg, float pos, float x, float y, float w, flo
 	nvgFill(vg);
 	nvgFill(vg);
 
 
 	// Knob
 	// Knob
-	knob = nvgLinearGradient(vg, x,cy-kr,x,cy+kr, nvgRGBA(255,255,255,16), nvgRGBA(0,0,0,16));
+	knob = nvgLinearGradient(vg, x,cy-kr,x,cy+kr, nvgRGBA(255,255,255,16), nvgRGBA(0,0,0,16) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgCircle(vg, x+(int)(pos*w),cy, kr-1);
 	nvgCircle(vg, x+(int)(pos*w),cy, kr-1);
-	nvgFillColor(vg, nvgRGBA(40,43,48,255));
+	nvgFillColor(vg, nvgRGBA(40,43,48,255) );
 	nvgFill(vg);
 	nvgFill(vg);
 	nvgFillPaint(vg, knob);
 	nvgFillPaint(vg, knob);
 	nvgFill(vg);
 	nvgFill(vg);
 
 
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgCircle(vg, x+(int)(pos*w),cy, kr-0.5f);
 	nvgCircle(vg, x+(int)(pos*w),cy, kr-0.5f);
-	nvgStrokeColor(vg, nvgRGBA(0,0,0,92));
+	nvgStrokeColor(vg, nvgRGBA(0,0,0,92) );
 	nvgStroke(vg);
 	nvgStroke(vg);
 
 
 	nvgRestore(vg);
 	nvgRestore(vg);
@@ -390,14 +390,14 @@ void drawEyes(struct NVGcontext* vg, float x, float y, float w, float h, float m
 	float br = (ex < ey ? ex : ey) * 0.5f;
 	float br = (ex < ey ? ex : ey) * 0.5f;
 	float blink = 1 - powf(sinf(t*0.5f),200)*0.8f;
 	float blink = 1 - powf(sinf(t*0.5f),200)*0.8f;
 
 
-	bg = nvgLinearGradient(vg, x,y+h*0.5f,x+w*0.1f,y+h, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,16));
+	bg = nvgLinearGradient(vg, x,y+h*0.5f,x+w*0.1f,y+h, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,16) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgEllipse(vg, lx+3.0f,ly+16.0f, ex,ey);
 	nvgEllipse(vg, lx+3.0f,ly+16.0f, ex,ey);
 	nvgEllipse(vg, rx+3.0f,ry+16.0f, ex,ey);
 	nvgEllipse(vg, rx+3.0f,ry+16.0f, ex,ey);
 	nvgFillPaint(vg, bg);
 	nvgFillPaint(vg, bg);
 	nvgFill(vg);
 	nvgFill(vg);
 
 
-	bg = nvgLinearGradient(vg, x,y+h*0.25f,x+w*0.1f,y+h, nvgRGBA(220,220,220,255), nvgRGBA(128,128,128,255));
+	bg = nvgLinearGradient(vg, x,y+h*0.25f,x+w*0.1f,y+h, nvgRGBA(220,220,220,255), nvgRGBA(128,128,128,255) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgEllipse(vg, lx,ly, ex,ey);
 	nvgEllipse(vg, lx,ly, ex,ey);
 	nvgEllipse(vg, rx,ry, ex,ey);
 	nvgEllipse(vg, rx,ry, ex,ey);
@@ -414,7 +414,7 @@ void drawEyes(struct NVGcontext* vg, float x, float y, float w, float h, float m
 	dy *= ey*0.5f;
 	dy *= ey*0.5f;
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgEllipse(vg, lx+dx,ly+dy+ey*0.25f*(1-blink), br,br*blink);
 	nvgEllipse(vg, lx+dx,ly+dy+ey*0.25f*(1-blink), br,br*blink);
-	nvgFillColor(vg, nvgRGBA(32,32,32,255));
+	nvgFillColor(vg, nvgRGBA(32,32,32,255) );
 	nvgFill(vg);
 	nvgFill(vg);
 
 
 	dx = (mx - rx) / (ex * 10);
 	dx = (mx - rx) / (ex * 10);
@@ -427,16 +427,16 @@ void drawEyes(struct NVGcontext* vg, float x, float y, float w, float h, float m
 	dy *= ey*0.5f;
 	dy *= ey*0.5f;
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgEllipse(vg, rx+dx,ry+dy+ey*0.25f*(1-blink), br,br*blink);
 	nvgEllipse(vg, rx+dx,ry+dy+ey*0.25f*(1-blink), br,br*blink);
-	nvgFillColor(vg, nvgRGBA(32,32,32,255));
+	nvgFillColor(vg, nvgRGBA(32,32,32,255) );
 	nvgFill(vg);
 	nvgFill(vg);
 
 
-	gloss = nvgRadialGradient(vg, lx-ex*0.25f,ly-ey*0.5f, ex*0.1f,ex*0.75f, nvgRGBA(255,255,255,128), nvgRGBA(255,255,255,0));
+	gloss = nvgRadialGradient(vg, lx-ex*0.25f,ly-ey*0.5f, ex*0.1f,ex*0.75f, nvgRGBA(255,255,255,128), nvgRGBA(255,255,255,0) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgEllipse(vg, lx,ly, ex,ey);
 	nvgEllipse(vg, lx,ly, ex,ey);
 	nvgFillPaint(vg, gloss);
 	nvgFillPaint(vg, gloss);
 	nvgFill(vg);
 	nvgFill(vg);
 
 
-	gloss = nvgRadialGradient(vg, rx-ex*0.25f,ry-ey*0.5f, ex*0.1f,ex*0.75f, nvgRGBA(255,255,255,128), nvgRGBA(255,255,255,0));
+	gloss = nvgRadialGradient(vg, rx-ex*0.25f,ry-ey*0.5f, ex*0.1f,ex*0.75f, nvgRGBA(255,255,255,128), nvgRGBA(255,255,255,0) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgEllipse(vg, rx,ry, ex,ey);
 	nvgEllipse(vg, rx,ry, ex,ey);
 	nvgFillPaint(vg, gloss);
 	nvgFillPaint(vg, gloss);
@@ -451,12 +451,12 @@ void drawGraph(struct NVGcontext* vg, float x, float y, float w, float h, float
 	float dx = w/5.0f;
 	float dx = w/5.0f;
 	int i;
 	int i;
 
 
-	samples[0] = (1+sinf(t*1.2345f+cosf(t*0.33457f)*0.44f))*0.5f;
-	samples[1] = (1+sinf(t*0.68363f+cosf(t*1.3f)*1.55f))*0.5f;
-	samples[2] = (1+sinf(t*1.1642f+cosf(t*0.33457f)*1.24f))*0.5f;
-	samples[3] = (1+sinf(t*0.56345f+cosf(t*1.63f)*0.14f))*0.5f;
-	samples[4] = (1+sinf(t*1.6245f+cosf(t*0.254f)*0.3f))*0.5f;
-	samples[5] = (1+sinf(t*0.345f+cosf(t*0.03f)*0.6f))*0.5f;
+	samples[0] = (1+sinf(t*1.2345f+cosf(t*0.33457f)*0.44f) )*0.5f;
+	samples[1] = (1+sinf(t*0.68363f+cosf(t*1.3f)*1.55f) )*0.5f;
+	samples[2] = (1+sinf(t*1.1642f+cosf(t*0.33457f)*1.24f) )*0.5f;
+	samples[3] = (1+sinf(t*0.56345f+cosf(t*1.63f)*0.14f) )*0.5f;
+	samples[4] = (1+sinf(t*1.6245f+cosf(t*0.254f)*0.3f) )*0.5f;
+	samples[5] = (1+sinf(t*0.345f+cosf(t*0.03f)*0.6f) )*0.5f;
 
 
 	for (i = 0; i < 6; i++) {
 	for (i = 0; i < 6; i++) {
 		sx[i] = x+i*dx;
 		sx[i] = x+i*dx;
@@ -464,7 +464,7 @@ void drawGraph(struct NVGcontext* vg, float x, float y, float w, float h, float
 	}
 	}
 
 
 	// Graph background
 	// Graph background
-	bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(0,160,192,0), nvgRGBA(0,160,192,64));
+	bg = nvgLinearGradient(vg, x,y,x,y+h, nvgRGBA(0,160,192,0), nvgRGBA(0,160,192,64) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgMoveTo(vg, sx[0], sy[0]);
 	nvgMoveTo(vg, sx[0], sy[0]);
 	for (i = 1; i < 6; i++)
 	for (i = 1; i < 6; i++)
@@ -479,7 +479,7 @@ void drawGraph(struct NVGcontext* vg, float x, float y, float w, float h, float
 	nvgMoveTo(vg, sx[0], sy[0]+2);
 	nvgMoveTo(vg, sx[0], sy[0]+2);
 	for (i = 1; i < 6; i++)
 	for (i = 1; i < 6; i++)
 		nvgBezierTo(vg, sx[i-1]+dx*0.5f,sy[i-1]+2, sx[i]-dx*0.5f,sy[i]+2, sx[i],sy[i]+2);
 		nvgBezierTo(vg, sx[i-1]+dx*0.5f,sy[i-1]+2, sx[i]-dx*0.5f,sy[i]+2, sx[i],sy[i]+2);
-	nvgStrokeColor(vg, nvgRGBA(0,0,0,32));
+	nvgStrokeColor(vg, nvgRGBA(0,0,0,32) );
 	nvgStrokeWidth(vg, 3.0f);
 	nvgStrokeWidth(vg, 3.0f);
 	nvgStroke(vg);
 	nvgStroke(vg);
 
 
@@ -487,13 +487,13 @@ void drawGraph(struct NVGcontext* vg, float x, float y, float w, float h, float
 	nvgMoveTo(vg, sx[0], sy[0]);
 	nvgMoveTo(vg, sx[0], sy[0]);
 	for (i = 1; i < 6; i++)
 	for (i = 1; i < 6; i++)
 		nvgBezierTo(vg, sx[i-1]+dx*0.5f,sy[i-1], sx[i]-dx*0.5f,sy[i], sx[i],sy[i]);
 		nvgBezierTo(vg, sx[i-1]+dx*0.5f,sy[i-1], sx[i]-dx*0.5f,sy[i], sx[i],sy[i]);
-	nvgStrokeColor(vg, nvgRGBA(0,160,192,255));
+	nvgStrokeColor(vg, nvgRGBA(0,160,192,255) );
 	nvgStrokeWidth(vg, 3.0f);
 	nvgStrokeWidth(vg, 3.0f);
 	nvgStroke(vg);
 	nvgStroke(vg);
 
 
 	// Graph sample pos
 	// Graph sample pos
 	for (i = 0; i < 6; i++) {
 	for (i = 0; i < 6; i++) {
-		bg = nvgRadialGradient(vg, sx[i],sy[i]+2, 3.0f,8.0f, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,0));
+		bg = nvgRadialGradient(vg, sx[i],sy[i]+2, 3.0f,8.0f, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,0) );
 		nvgBeginPath(vg);
 		nvgBeginPath(vg);
 		nvgRect(vg, sx[i]-10, sy[i]-10+2, 20,20);
 		nvgRect(vg, sx[i]-10, sy[i]-10+2, 20,20);
 		nvgFillPaint(vg, bg);
 		nvgFillPaint(vg, bg);
@@ -503,12 +503,12 @@ void drawGraph(struct NVGcontext* vg, float x, float y, float w, float h, float
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	for (i = 0; i < 6; i++)
 	for (i = 0; i < 6; i++)
 		nvgCircle(vg, sx[i], sy[i], 4.0f);
 		nvgCircle(vg, sx[i], sy[i], 4.0f);
-	nvgFillColor(vg, nvgRGBA(0,160,192,255));
+	nvgFillColor(vg, nvgRGBA(0,160,192,255) );
 	nvgFill(vg);
 	nvgFill(vg);
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	for (i = 0; i < 6; i++)
 	for (i = 0; i < 6; i++)
 		nvgCircle(vg, sx[i], sy[i], 2.0f);
 		nvgCircle(vg, sx[i], sy[i], 2.0f);
-	nvgFillColor(vg, nvgRGBA(220,220,220,255));
+	nvgFillColor(vg, nvgRGBA(220,220,220,255) );
 	nvgFill(vg);
 	nvgFill(vg);
 
 
 	nvgStrokeWidth(vg, 1.0f);
 	nvgStrokeWidth(vg, 1.0f);
@@ -524,14 +524,14 @@ void drawThumbnails(struct NVGcontext* vg, float x, float y, float w, float h, c
 	int imgw, imgh;
 	int imgw, imgh;
 	float stackh = (nimages/2) * (thumb+10) + 10;
 	float stackh = (nimages/2) * (thumb+10) + 10;
 	int i;
 	int i;
-	float u = (1+cosf(t*0.5f))*0.5f;
+	float u = (1+cosf(t*0.5f) )*0.5f;
 	float scrollh;
 	float scrollh;
 
 
 	nvgSave(vg);
 	nvgSave(vg);
 	//	nvgClearState(vg);
 	//	nvgClearState(vg);
 
 
 	// Drop shadow
 	// Drop shadow
-	shadowPaint = nvgBoxGradient(vg, x,y+4, w,h, cornerRadius*2, 20, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0));
+	shadowPaint = nvgBoxGradient(vg, x,y+4, w,h, cornerRadius*2, 20, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRect(vg, x-10,y-10, w+20,h+30);
 	nvgRect(vg, x-10,y-10, w+20,h+30);
 	nvgRoundedRect(vg, x,y, w,h, cornerRadius);
 	nvgRoundedRect(vg, x,y, w,h, cornerRadius);
@@ -545,7 +545,7 @@ void drawThumbnails(struct NVGcontext* vg, float x, float y, float w, float h, c
 	nvgMoveTo(vg, x-10,y+arry);
 	nvgMoveTo(vg, x-10,y+arry);
 	nvgLineTo(vg, x+1,y+arry-11);
 	nvgLineTo(vg, x+1,y+arry-11);
 	nvgLineTo(vg, x+1,y+arry+11);
 	nvgLineTo(vg, x+1,y+arry+11);
-	nvgFillColor(vg, nvgRGBA(200,200,200,255));
+	nvgFillColor(vg, nvgRGBA(200,200,200,255) );
 	nvgFill(vg);
 	nvgFill(vg);
 
 
 	nvgSave(vg);
 	nvgSave(vg);
@@ -576,7 +576,7 @@ void drawThumbnails(struct NVGcontext* vg, float x, float y, float w, float h, c
 		nvgFillPaint(vg, imgPaint);
 		nvgFillPaint(vg, imgPaint);
 		nvgFill(vg);
 		nvgFill(vg);
 
 
-		shadowPaint = nvgBoxGradient(vg, tx-1,ty, thumb+2,thumb+2, 5, 3, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0));
+		shadowPaint = nvgBoxGradient(vg, tx-1,ty, thumb+2,thumb+2, 5, 3, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0) );
 		nvgBeginPath(vg);
 		nvgBeginPath(vg);
 		nvgRect(vg, tx-5,ty-5, thumb+10,thumb+10);
 		nvgRect(vg, tx-5,ty-5, thumb+10,thumb+10);
 		nvgRoundedRect(vg, tx,ty, thumb,thumb, 6);
 		nvgRoundedRect(vg, tx,ty, thumb,thumb, 6);
@@ -587,38 +587,38 @@ void drawThumbnails(struct NVGcontext* vg, float x, float y, float w, float h, c
 		nvgBeginPath(vg);
 		nvgBeginPath(vg);
 		nvgRoundedRect(vg, tx+0.5f,ty+0.5f, thumb-1,thumb-1, 4-0.5f);
 		nvgRoundedRect(vg, tx+0.5f,ty+0.5f, thumb-1,thumb-1, 4-0.5f);
 		nvgStrokeWidth(vg,1.0f);
 		nvgStrokeWidth(vg,1.0f);
-		nvgStrokeColor(vg, nvgRGBA(255,255,255,192));
+		nvgStrokeColor(vg, nvgRGBA(255,255,255,192) );
 		nvgStroke(vg);
 		nvgStroke(vg);
 	}
 	}
 	nvgRestore(vg);
 	nvgRestore(vg);
 
 
 	// Hide fades
 	// Hide fades
-	fadePaint = nvgLinearGradient(vg, x,y,x,y+6, nvgRGBA(200,200,200,255), nvgRGBA(200,200,200,0));
+	fadePaint = nvgLinearGradient(vg, x,y,x,y+6, nvgRGBA(200,200,200,255), nvgRGBA(200,200,200,0) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRect(vg, x+4,y,w-8,6);
 	nvgRect(vg, x+4,y,w-8,6);
 	nvgFillPaint(vg, fadePaint);
 	nvgFillPaint(vg, fadePaint);
 	nvgFill(vg);
 	nvgFill(vg);
 
 
-	fadePaint = nvgLinearGradient(vg, x,y+h,x,y+h-6, nvgRGBA(200,200,200,255), nvgRGBA(200,200,200,0));
+	fadePaint = nvgLinearGradient(vg, x,y+h,x,y+h-6, nvgRGBA(200,200,200,255), nvgRGBA(200,200,200,0) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRect(vg, x+4,y+h-6,w-8,6);
 	nvgRect(vg, x+4,y+h-6,w-8,6);
 	nvgFillPaint(vg, fadePaint);
 	nvgFillPaint(vg, fadePaint);
 	nvgFill(vg);
 	nvgFill(vg);
 
 
 	// Scroll bar
 	// Scroll bar
-	shadowPaint = nvgBoxGradient(vg, x+w-12+1,y+4+1, 8,h-8, 3,4, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,92));
+	shadowPaint = nvgBoxGradient(vg, x+w-12+1,y+4+1, 8,h-8, 3,4, nvgRGBA(0,0,0,32), nvgRGBA(0,0,0,92) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x+w-12,y+4, 8,h-8, 3);
 	nvgRoundedRect(vg, x+w-12,y+4, 8,h-8, 3);
 	nvgFillPaint(vg, shadowPaint);
 	nvgFillPaint(vg, shadowPaint);
-	//	nvgFillColor(vg, nvgRGBA(255,0,0,128));
+	//	nvgFillColor(vg, nvgRGBA(255,0,0,128) );
 	nvgFill(vg);
 	nvgFill(vg);
 
 
 	scrollh = (h/stackh) * (h-8);
 	scrollh = (h/stackh) * (h-8);
-	shadowPaint = nvgBoxGradient(vg, x+w-12-1,y+4+(h-8-scrollh)*u-1, 8,scrollh, 3,4, nvgRGBA(220,220,220,255), nvgRGBA(128,128,128,255));
+	shadowPaint = nvgBoxGradient(vg, x+w-12-1,y+4+(h-8-scrollh)*u-1, 8,scrollh, 3,4, nvgRGBA(220,220,220,255), nvgRGBA(128,128,128,255) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRoundedRect(vg, x+w-12+1,y+4+1 + (h-8-scrollh)*u, 8-2,scrollh-2, 2);
 	nvgRoundedRect(vg, x+w-12+1,y+4+1 + (h-8-scrollh)*u, 8-2,scrollh-2, 2);
 	nvgFillPaint(vg, shadowPaint);
 	nvgFillPaint(vg, shadowPaint);
-	//	nvgFillColor(vg, nvgRGBA(0,0,0,128));
+	//	nvgFillColor(vg, nvgRGBA(0,0,0,128) );
 	nvgFill(vg);
 	nvgFill(vg);
 
 
 	nvgRestore(vg);
 	nvgRestore(vg);
@@ -635,7 +635,7 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
 
 
 	/*	nvgBeginPath(vg);
 	/*	nvgBeginPath(vg);
 		nvgRect(vg, x,y,w,h);
 		nvgRect(vg, x,y,w,h);
-		nvgFillColor(vg, nvgRGBA(255,0,0,128));
+		nvgFillColor(vg, nvgRGBA(255,0,0,128) );
 		nvgFill(vg);*/
 		nvgFill(vg);*/
 
 
 	cx = x + w*0.5f;
 	cx = x + w*0.5f;
@@ -656,7 +656,7 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
 		ay = cy + sinf(a0) * (r0+r1)*0.5f;
 		ay = cy + sinf(a0) * (r0+r1)*0.5f;
 		bx = cx + cosf(a1) * (r0+r1)*0.5f;
 		bx = cx + cosf(a1) * (r0+r1)*0.5f;
 		by = cy + sinf(a1) * (r0+r1)*0.5f;
 		by = cy + sinf(a1) * (r0+r1)*0.5f;
-		paint = nvgLinearGradient(vg, ax,ay, bx,by, nvgHSLA(a0/(NVG_PI*2),1.0f,0.55f,255), nvgHSLA(a1/(NVG_PI*2),1.0f,0.55f,255));
+		paint = nvgLinearGradient(vg, ax,ay, bx,by, nvgHSLA(a0/(NVG_PI*2),1.0f,0.55f,255), nvgHSLA(a1/(NVG_PI*2),1.0f,0.55f,255) );
 		nvgFillPaint(vg, paint);
 		nvgFillPaint(vg, paint);
 		nvgFill(vg);
 		nvgFill(vg);
 	}
 	}
@@ -664,7 +664,7 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgCircle(vg, cx,cy, r0-0.5f);
 	nvgCircle(vg, cx,cy, r0-0.5f);
 	nvgCircle(vg, cx,cy, r1+0.5f);
 	nvgCircle(vg, cx,cy, r1+0.5f);
-	nvgStrokeColor(vg, nvgRGBA(0,0,0,64));
+	nvgStrokeColor(vg, nvgRGBA(0,0,0,64) );
 	nvgStrokeWidth(vg, 1.0f);
 	nvgStrokeWidth(vg, 1.0f);
 	nvgStroke(vg);
 	nvgStroke(vg);
 
 
@@ -677,10 +677,10 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
 	nvgStrokeWidth(vg, 2.0f);
 	nvgStrokeWidth(vg, 2.0f);
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRect(vg, r0-1,-3,r1-r0+2,6);
 	nvgRect(vg, r0-1,-3,r1-r0+2,6);
-	nvgStrokeColor(vg, nvgRGBA(255,255,255,192));
+	nvgStrokeColor(vg, nvgRGBA(255,255,255,192) );
 	nvgStroke(vg);
 	nvgStroke(vg);
 
 
-	paint = nvgBoxGradient(vg, r0-3,-5,r1-r0+6,10, 2,4, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0));
+	paint = nvgBoxGradient(vg, r0-3,-5,r1-r0+6,10, 2,4, nvgRGBA(0,0,0,128), nvgRGBA(0,0,0,0) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRect(vg, r0-2-10,-4-10,r1-r0+4+20,8+20);
 	nvgRect(vg, r0-2-10,-4-10,r1-r0+4+20,8+20);
 	nvgRect(vg, r0-2,-4,r1-r0+4,8);
 	nvgRect(vg, r0-2,-4,r1-r0+4,8);
@@ -699,13 +699,13 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
 	nvgLineTo(vg, ax,ay);
 	nvgLineTo(vg, ax,ay);
 	nvgLineTo(vg, bx,by);
 	nvgLineTo(vg, bx,by);
 	nvgClosePath(vg);
 	nvgClosePath(vg);
-	paint = nvgLinearGradient(vg, r,0, ax,ay, nvgHSLA(hue,1.0f,0.5f,255), nvgRGBA(255,255,255,255));
+	paint = nvgLinearGradient(vg, r,0, ax,ay, nvgHSLA(hue,1.0f,0.5f,255), nvgRGBA(255,255,255,255) );
 	nvgFillPaint(vg, paint);
 	nvgFillPaint(vg, paint);
 	nvgFill(vg);
 	nvgFill(vg);
-	paint = nvgLinearGradient(vg, (r+ax)*0.5f,(0+ay)*0.5f, bx,by, nvgRGBA(0,0,0,0), nvgRGBA(0,0,0,255));
+	paint = nvgLinearGradient(vg, (r+ax)*0.5f,(0+ay)*0.5f, bx,by, nvgRGBA(0,0,0,0), nvgRGBA(0,0,0,255) );
 	nvgFillPaint(vg, paint);
 	nvgFillPaint(vg, paint);
 	nvgFill(vg);
 	nvgFill(vg);
-	nvgStrokeColor(vg, nvgRGBA(0,0,0,64));
+	nvgStrokeColor(vg, nvgRGBA(0,0,0,64) );
 	nvgStroke(vg);
 	nvgStroke(vg);
 
 
 	// Select circle on triangle
 	// Select circle on triangle
@@ -714,10 +714,10 @@ void drawColorwheel(struct NVGcontext* vg, float x, float y, float w, float h, f
 	nvgStrokeWidth(vg, 2.0f);
 	nvgStrokeWidth(vg, 2.0f);
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgCircle(vg, ax,ay,5);
 	nvgCircle(vg, ax,ay,5);
-	nvgStrokeColor(vg, nvgRGBA(255,255,255,192));
+	nvgStrokeColor(vg, nvgRGBA(255,255,255,192) );
 	nvgStroke(vg);
 	nvgStroke(vg);
 
 
-	paint = nvgRadialGradient(vg, ax,ay, 7,9, nvgRGBA(0,0,0,64), nvgRGBA(0,0,0,0));
+	paint = nvgRadialGradient(vg, ax,ay, 7,9, nvgRGBA(0,0,0,64), nvgRGBA(0,0,0,0) );
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
 	nvgRect(vg, ax-20,ay-20,40,40);
 	nvgRect(vg, ax-20,ay-20,40,40);
 	nvgCircle(vg, ax,ay,7);
 	nvgCircle(vg, ax,ay,7);
@@ -760,7 +760,7 @@ void drawLines(struct NVGcontext* vg, float x, float y, float w, float h, float
 			nvgLineJoin(vg, joins[j]);
 			nvgLineJoin(vg, joins[j]);
 
 
 			nvgStrokeWidth(vg, s*0.3f);
 			nvgStrokeWidth(vg, s*0.3f);
-			nvgStrokeColor(vg, nvgRGBA(0,0,0,160));
+			nvgStrokeColor(vg, nvgRGBA(0,0,0,160) );
 			nvgBeginPath(vg);
 			nvgBeginPath(vg);
 			nvgMoveTo(vg, fx+pts[0], fy+pts[1]);
 			nvgMoveTo(vg, fx+pts[0], fy+pts[1]);
 			nvgLineTo(vg, fx+pts[2], fy+pts[3]);
 			nvgLineTo(vg, fx+pts[2], fy+pts[3]);
@@ -772,7 +772,7 @@ void drawLines(struct NVGcontext* vg, float x, float y, float w, float h, float
 			nvgLineJoin(vg, NVG_BEVEL);
 			nvgLineJoin(vg, NVG_BEVEL);
 
 
 			nvgStrokeWidth(vg, 1.0f);
 			nvgStrokeWidth(vg, 1.0f);
-			nvgStrokeColor(vg, nvgRGBA(0,192,255,255));
+			nvgStrokeColor(vg, nvgRGBA(0,192,255,255) );
 			nvgBeginPath(vg);
 			nvgBeginPath(vg);
 			nvgMoveTo(vg, fx+pts[0], fy+pts[1]);
 			nvgMoveTo(vg, fx+pts[0], fy+pts[1]);
 			nvgLineTo(vg, fx+pts[2], fy+pts[3]);
 			nvgLineTo(vg, fx+pts[2], fy+pts[3]);
@@ -1029,11 +1029,11 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h
 			int hit = mx > x && mx < (x+width) && my >= y && my < (y+lineh);
 			int hit = mx > x && mx < (x+width) && my >= y && my < (y+lineh);
 
 
 			nvgBeginPath(vg);
 			nvgBeginPath(vg);
-			nvgFillColor(vg, nvgRGBA(255,255,255,hit?64:8));
+			nvgFillColor(vg, nvgRGBA(255,255,255,hit?64:8) );
 			nvgRect(vg, x, y, row->width, lineh);
 			nvgRect(vg, x, y, row->width, lineh);
 			nvgFill(vg);
 			nvgFill(vg);
 
 
-			nvgFillColor(vg, nvgRGBA(255,255,255,255));
+			nvgFillColor(vg, nvgRGBA(255,255,255,255) );
 			nvgText(vg, x, y, row->start, row->end);
 			nvgText(vg, x, y, row->start, row->end);
 
 
 			if (hit) {
 			if (hit) {
@@ -1049,7 +1049,7 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h
 					px = tgx;
 					px = tgx;
 				}
 				}
 				nvgBeginPath(vg);
 				nvgBeginPath(vg);
-				nvgFillColor(vg, nvgRGBA(255,192,0,255));
+				nvgFillColor(vg, nvgRGBA(255,192,0,255) );
 				nvgRect(vg, caretx, y, 1, lineh);
 				nvgRect(vg, caretx, y, 1, lineh);
 				nvgFill(vg);
 				nvgFill(vg);
 
 
@@ -1074,7 +1074,7 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h
 		nvgTextBounds(vg, gx,gy, txt, NULL, bounds);
 		nvgTextBounds(vg, gx,gy, txt, NULL, bounds);
 
 
 		nvgBeginPath(vg);
 		nvgBeginPath(vg);
-		nvgFillColor(vg, nvgRGBA(255,192,0,255));
+		nvgFillColor(vg, nvgRGBA(255,192,0,255) );
 		nvgRoundedRect(vg
 		nvgRoundedRect(vg
 			, roundf(bounds[0])-4.0f
 			, roundf(bounds[0])-4.0f
 			, roundf(bounds[1])-2.0f
 			, roundf(bounds[1])-2.0f
@@ -1084,7 +1084,7 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h
 			);
 			);
 		nvgFill(vg);
 		nvgFill(vg);
 
 
-		nvgFillColor(vg, nvgRGBA(32,32,32,255));
+		nvgFillColor(vg, nvgRGBA(32,32,32,255) );
 		nvgText(vg, gx,gy, txt, NULL);
 		nvgText(vg, gx,gy, txt, NULL);
 	}
 	}
 
 
@@ -1096,7 +1096,7 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h
 
 
 	nvgTextBoxBounds(vg, x,y, 150, "Hover your mouse over the text to see calculated caret position.", NULL, bounds);
 	nvgTextBoxBounds(vg, x,y, 150, "Hover your mouse over the text to see calculated caret position.", NULL, bounds);
 	nvgBeginPath(vg);
 	nvgBeginPath(vg);
-	nvgFillColor(vg, nvgRGBA(220,220,220,255));
+	nvgFillColor(vg, nvgRGBA(220,220,220,255) );
 	nvgRoundedRect(vg
 	nvgRoundedRect(vg
 		, roundf(bounds[0]-2.0f)
 		, roundf(bounds[0]-2.0f)
 		, roundf(bounds[1]-2.0f)
 		, roundf(bounds[1]-2.0f)
@@ -1104,13 +1104,13 @@ void drawParagraph(struct NVGcontext* vg, float x, float y, float width, float h
 		, roundf(bounds[3]-bounds[1])+4.0f
 		, roundf(bounds[3]-bounds[1])+4.0f
 		, 3.0f
 		, 3.0f
 		);
 		);
-	px = float( (int)((bounds[2]+bounds[0])/2) );
+	px = float( (int)( (bounds[2]+bounds[0])/2) );
 	nvgMoveTo(vg, px,bounds[1] - 10);
 	nvgMoveTo(vg, px,bounds[1] - 10);
 	nvgLineTo(vg, px+7,bounds[1]+1);
 	nvgLineTo(vg, px+7,bounds[1]+1);
 	nvgLineTo(vg, px-7,bounds[1]+1);
 	nvgLineTo(vg, px-7,bounds[1]+1);
 	nvgFill(vg);
 	nvgFill(vg);
 
 
-	nvgFillColor(vg, nvgRGBA(0,0,0,220));
+	nvgFillColor(vg, nvgRGBA(0,0,0,220) );
 	nvgTextBox(vg, x,y, 150, "Hover your mouse over the text to see calculated caret position.", NULL);
 	nvgTextBox(vg, x,y, 150, "Hover your mouse over the text to see calculated caret position.", NULL);
 
 
 	nvgRestore(vg);
 	nvgRestore(vg);
@@ -1120,7 +1120,7 @@ void drawWidths(struct NVGcontext* vg, float x, float y, float width)
 {
 {
 	nvgSave(vg);
 	nvgSave(vg);
 
 
-	nvgStrokeColor(vg, nvgRGBA(0,0,0,255));
+	nvgStrokeColor(vg, nvgRGBA(0,0,0,255) );
 
 
 	for (uint32_t ii = 0; ii < 20; ++ii)
 	for (uint32_t ii = 0; ii < 20; ++ii)
 	{
 	{
@@ -1179,7 +1179,7 @@ void renderDemo(struct NVGcontext* vg, float mx, float my, float width, float he
 	drawEditBox(vg, "Password", x,y, 280,28);
 	drawEditBox(vg, "Password", x,y, 280,28);
 	y += 38;
 	y += 38;
 	drawCheckBox(vg, "Remember me", x,y, 140,28);
 	drawCheckBox(vg, "Remember me", x,y, 140,28);
-	drawButton(vg, ICON_LOGIN, "Sign in", x+138, y, 140, 28, nvgRGBA(0,96,128,255));
+	drawButton(vg, ICON_LOGIN, "Sign in", x+138, y, 140, 28, nvgRGBA(0,96,128,255) );
 	y += 45;
 	y += 45;
 
 
 	// Slider
 	// Slider
@@ -1189,8 +1189,8 @@ void renderDemo(struct NVGcontext* vg, float mx, float my, float width, float he
 	drawSlider(vg, 0.4f, x,y, 170,28);
 	drawSlider(vg, 0.4f, x,y, 170,28);
 	y += 55;
 	y += 55;
 
 
-	drawButton(vg, ICON_TRASH, "Delete", x, y, 160, 28, nvgRGBA(128,16,8,255));
-	drawButton(vg, 0, "Cancel", x+170, y, 110, 28, nvgRGBA(0,0,0,0));
+	drawButton(vg, ICON_TRASH, "Delete", x, y, 160, 28, nvgRGBA(128,16,8,255) );
+	drawButton(vg, 0, "Cancel", x+170, y, 110, 28, nvgRGBA(0,0,0,0) );
 
 
 	// Thumbnails box
 	// Thumbnails box
 	drawThumbnails(vg, popx, popy-30, 160, 300, data->images, 12, t);
 	drawThumbnails(vg, popx, popy-30, 160, 300, data->images, 12, t);

+ 1 - 1
examples/24-nbody/nbody.cpp

@@ -294,7 +294,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
 
 
 			// Set view and projection matrix for view 0.
 			// Set view and projection matrix for view 0.
 			const bgfx::HMD* hmd = bgfx::getHMD();
 			const bgfx::HMD* hmd = bgfx::getHMD();
-			if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING))
+			if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
 			{
 			{
 				float viewHead[16];
 				float viewHead[16];
 				float eye[3] = {};
 				float eye[3] = {};

+ 2 - 2
examples/common/camera.cpp

@@ -330,12 +330,12 @@ void cameraGetViewMtx(float* _viewMtx)
 
 
 void cameraGetPosition(float* _pos)
 void cameraGetPosition(float* _pos)
 {
 {
-	memcpy(_pos, s_camera->m_eye, 3*sizeof(float));
+	memcpy(_pos, s_camera->m_eye, 3*sizeof(float) );
 }
 }
 
 
 void cameraGetAt(float* _at)
 void cameraGetAt(float* _at)
 {
 {
-	memcpy(_at, s_camera->m_at, 3*sizeof(float));
+	memcpy(_at, s_camera->m_at, 3*sizeof(float) );
 }
 }
 
 
 void cameraUpdate(float _deltaTime, const entry::MouseState& _mouseState)
 void cameraUpdate(float _deltaTime, const entry::MouseState& _mouseState)

+ 1 - 1
examples/common/cube_atlas.cpp

@@ -318,7 +318,7 @@ void Atlas::init()
 {
 {
 	m_texelSize = float(UINT16_MAX) / float(m_textureSize);
 	m_texelSize = float(UINT16_MAX) / float(m_textureSize);
 	float texelHalf = m_texelSize/2.0f;
 	float texelHalf = m_texelSize/2.0f;
-	switch (bgfx::getRendererType())
+	switch (bgfx::getRendererType() )
 	{
 	{
 	case bgfx::RendererType::Direct3D9:
 	case bgfx::RendererType::Direct3D9:
 		m_texelOffset[0] = 0.0f;
 		m_texelOffset[0] = 0.0f;

+ 2 - 2
examples/common/cube_atlas.h

@@ -54,12 +54,12 @@ class Atlas
 {
 {
 public:
 public:
 	/// create an empty dynamic atlas (region can be updated and added)
 	/// create an empty dynamic atlas (region can be updated and added)
-	/// @param textureSize an atlas creates a texture cube of 6 faces with size equal to (textureSize*textureSize * sizeof(RGBA))
+	/// @param textureSize an atlas creates a texture cube of 6 faces with size equal to (textureSize*textureSize * sizeof(RGBA) )
 	/// @param maxRegionCount maximum number of region allowed in the atlas
 	/// @param maxRegionCount maximum number of region allowed in the atlas
 	Atlas(uint16_t _textureSize, uint16_t _maxRegionsCount = 4096);
 	Atlas(uint16_t _textureSize, uint16_t _maxRegionsCount = 4096);
 
 
 	/// initialize a static atlas with serialized data	(region can be updated but not added)
 	/// initialize a static atlas with serialized data	(region can be updated but not added)
-	/// @param textureSize an atlas creates a texture cube of 6 faces with size equal to (textureSize*textureSize * sizeof(RGBA))
+	/// @param textureSize an atlas creates a texture cube of 6 faces with size equal to (textureSize*textureSize * sizeof(RGBA) )
 	/// @param textureBuffer buffer of size 6*textureSize*textureSize*sizeof(uint32_t) (will be copied)
 	/// @param textureBuffer buffer of size 6*textureSize*textureSize*sizeof(uint32_t) (will be copied)
 	/// @param regionCount number of region in the Atlas
 	/// @param regionCount number of region in the Atlas
 	/// @param regionBuffer buffer containing the region (will be copied)
 	/// @param regionBuffer buffer containing the region (will be copied)

+ 1 - 1
examples/common/entry/entry.cpp

@@ -320,7 +320,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 		inputAddBindings("bindings", s_bindings);
 		inputAddBindings("bindings", s_bindings);
 
 
 		entry::WindowHandle defaultWindow = { 0 };
 		entry::WindowHandle defaultWindow = { 0 };
-		entry::setWindowTitle(defaultWindow, bx::baseName(_argv[0]));
+		entry::setWindowTitle(defaultWindow, bx::baseName(_argv[0]) );
 
 
 		int32_t result = ::_main_(_argc, _argv);
 		int32_t result = ::_main_(_argc, _argv);
 
 

+ 1 - 1
examples/common/entry/entry_sdl.cpp

@@ -644,7 +644,7 @@ namespace entry
 									Msg* msg = (Msg*)uev.data2;
 									Msg* msg = (Msg*)uev.data2;
 									if (isValid(handle) )
 									if (isValid(handle) )
 									{
 									{
-										SDL_SetWindowTitle(m_window[handle.idx], msg->m_title.c_str());
+										SDL_SetWindowTitle(m_window[handle.idx], msg->m_title.c_str() );
 									}
 									}
 									delete msg;
 									delete msg;
 								}
 								}

+ 3 - 3
examples/common/entry/entry_winrt.cpp

@@ -44,7 +44,7 @@ public:
 		window->VisibilityChanged += ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &App::OnVisibilityChanged);
 		window->VisibilityChanged += ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &App::OnVisibilityChanged);
 		window->Closed += ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed);
 		window->Closed += ref new TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed);
 
 
-		bgfx::winrtSetWindow(reinterpret_cast<IUnknown*>(window));
+		bgfx::winrtSetWindow(reinterpret_cast<IUnknown*>(window) );
 	}
 	}
 
 
 	virtual void Load(String^ entryPoint)
 	virtual void Load(String^ entryPoint)
@@ -62,8 +62,8 @@ public:
 
 
 		static const float dipsPerInch = 96.0f;
 		static const float dipsPerInch = 96.0f;
 		g_eventQueue.postSizeEvent(g_defaultWindow
 		g_eventQueue.postSizeEvent(g_defaultWindow
-			, lround(floorf(bounds.Width * dpi / dipsPerInch + 0.5f))
-			, lround(floorf(bounds.Height * dpi / dipsPerInch + 0.5f))
+			, lround(floorf(bounds.Width * dpi / dipsPerInch + 0.5f) )
+			, lround(floorf(bounds.Height * dpi / dipsPerInch + 0.5f) )
 			);
 			);
 
 
 		while (!m_windowClosed)
 		while (!m_windowClosed)

+ 1 - 1
examples/common/font/text_metrics.cpp

@@ -158,7 +158,7 @@ void TextLineMetrics::getSubText(const char* _string, uint32_t _firstLine, uint3
 	uint32_t state = 0;
 	uint32_t state = 0;
 	// y is bottom of a text line
 	// y is bottom of a text line
 	uint32_t currentLine = 0;
 	uint32_t currentLine = 0;
-	while(*_string && (currentLine < _firstLine))
+	while(*_string && (currentLine < _firstLine) )
 	{
 	{
 		for (; *_string; ++_string)
 		for (; *_string; ++_string)
 		{	
 		{	

+ 6 - 6
examples/common/imgui/imgui.cpp

@@ -770,7 +770,7 @@ struct Imgui
 			&& m_leftPressed)
 			&& m_leftPressed)
 			{
 			{
 				// Toggle active input.
 				// Toggle active input.
-				if (isActiveInputField(_id))
+				if (isActiveInputField(_id) )
 				{
 				{
 					clearActiveInputField();
 					clearActiveInputField();
 				}
 				}
@@ -831,7 +831,7 @@ struct Imgui
 		bgfx::setViewSeq(_view, true);
 		bgfx::setViewSeq(_view, true);
 
 
 		const bgfx::HMD* hmd = bgfx::getHMD();
 		const bgfx::HMD* hmd = bgfx::getHMD();
-		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING))
+		if (NULL != hmd && 0 != (hmd->flags & BGFX_HMD_RENDERING) )
 		{
 		{
 			m_viewWidth = _width / 2;
 			m_viewWidth = _width / 2;
 			m_surfaceWidth = _surfaceWidth / 2;
 			m_surfaceWidth = _surfaceWidth / 2;
@@ -1080,7 +1080,7 @@ struct Imgui
 		else
 		else
 		{
 		{
 			// Clear active if scroll is selected but not visible any more.
 			// Clear active if scroll is selected but not visible any more.
-			if (isActive(hid))
+			if (isActive(hid) )
 			{
 			{
 				clearActive();
 				clearActive();
 			}
 			}
@@ -1399,7 +1399,7 @@ struct Imgui
 		// Handle input.
 		// Handle input.
 		if (isActiveInputField(id) )
 		if (isActiveInputField(id) )
 		{
 		{
-			const size_t cursor = size_t(strlen(_str));
+			const size_t cursor = size_t(strlen(_str) );
 
 
 			if (m_char == 0x08 || m_char == 0x7f) //backspace or delete
 			if (m_char == 0x08 || m_char == 0x7f) //backspace or delete
 			{
 			{
@@ -1422,7 +1422,7 @@ struct Imgui
 		if (drawLabel)
 		if (drawLabel)
 		{
 		{
 			uint32_t numVertices = 0; //unused
 			uint32_t numVertices = 0; //unused
-			const int32_t labelWidth = int32_t(getTextLength(m_fonts[m_currentFontIdx].m_cdata, _label, numVertices));
+			const int32_t labelWidth = int32_t(getTextLength(m_fonts[m_currentFontIdx].m_cdata, _label, numVertices) );
 			xx    += (labelWidth + 6);
 			xx    += (labelWidth + 6);
 			width -= (labelWidth + 6);
 			width -= (labelWidth + 6);
 		}
 		}
@@ -1562,7 +1562,7 @@ struct Imgui
 							   , enabled?imguiRGBA(255,196,0,200):imguiRGBA(128,128,128,32)
 							   , enabled?imguiRGBA(255,196,0,200):imguiRGBA(128,128,128,32)
 							   );
 							   );
 			}
 			}
-			else if (isActive(id))
+			else if (isActive(id) )
 			{
 			{
 				drawRoundedRect( (float)buttonX
 				drawRoundedRect( (float)buttonX
 							   , (float)yy
 							   , (float)yy

+ 1 - 1
examples/common/imgui/imgui.h

@@ -207,7 +207,7 @@ bool imguiMouseOverArea();
 namespace ImGui
 namespace ImGui
 {
 {
 	// Helper function for passing bgfx::TextureHandle to ImGui::Image.
 	// Helper function for passing bgfx::TextureHandle to ImGui::Image.
-	inline void Image(bgfx::TextureHandle _handle, const ImVec2& _size, const ImVec2& _uv0 = ImVec2(0, 0), const ImVec2& _uv1 = ImVec2(1, 1), const ImVec4& _tint_col = ImVec4(1, 1, 1, 1), const ImVec4& _border_col = ImVec4(0, 0, 0, 0))
+	inline void Image(bgfx::TextureHandle _handle, const ImVec2& _size, const ImVec2& _uv0 = ImVec2(0, 0), const ImVec2& _uv1 = ImVec2(1, 1), const ImVec4& _tint_col = ImVec4(1, 1, 1, 1), const ImVec4& _border_col = ImVec4(0, 0, 0, 0) )
 	{
 	{
 		union { bgfx::TextureHandle handle; ImTextureID ptr; } texture;
 		union { bgfx::TextureHandle handle; ImTextureID ptr; } texture;
 		texture.handle = _handle;
 		texture.handle = _handle;

+ 17 - 17
examples/common/imgui/ocornut_imgui.cpp

@@ -44,7 +44,7 @@ struct OcornutImguiContext
 			uint32_t vtx_size = (uint32_t)cmd_list->VtxBuffer.size();
 			uint32_t vtx_size = (uint32_t)cmd_list->VtxBuffer.size();
 			uint32_t idx_size = (uint32_t)cmd_list->IdxBuffer.size();
 			uint32_t idx_size = (uint32_t)cmd_list->IdxBuffer.size();
 
 
-			if (!bgfx::checkAvailTransientVertexBuffer(vtx_size, m_decl) || !bgfx::checkAvailTransientIndexBuffer(idx_size))
+			if (!bgfx::checkAvailTransientVertexBuffer(vtx_size, m_decl) || !bgfx::checkAvailTransientIndexBuffer(idx_size) )
 			{
 			{
 				// not enough space in transient buffer just quit drawing the rest...
 				// not enough space in transient buffer just quit drawing the rest...
 				break;
 				break;
@@ -54,10 +54,10 @@ struct OcornutImguiContext
 			bgfx::allocTransientIndexBuffer(&tib, idx_size);
 			bgfx::allocTransientIndexBuffer(&tib, idx_size);
 
 
 			ImDrawVert* verts = (ImDrawVert*)tvb.data;
 			ImDrawVert* verts = (ImDrawVert*)tvb.data;
-			memcpy(verts, cmd_list->VtxBuffer.begin(), vtx_size * sizeof(ImDrawVert));
+			memcpy(verts, cmd_list->VtxBuffer.begin(), vtx_size * sizeof(ImDrawVert) );
 
 
 			ImDrawIdx* indices = (ImDrawIdx*)tib.data;
 			ImDrawIdx* indices = (ImDrawIdx*)tib.data;
-			memcpy(indices, cmd_list->IdxBuffer.begin(), idx_size * sizeof(ImDrawIdx));
+			memcpy(indices, cmd_list->IdxBuffer.begin(), idx_size * sizeof(ImDrawIdx) );
 
 
 			uint32_t elem_offset = 0;
 			uint32_t elem_offset = 0;
 			const ImDrawCmd* pcmd_begin = cmd_list->CmdBuffer.begin();
 			const ImDrawCmd* pcmd_begin = cmd_list->CmdBuffer.begin();
@@ -81,10 +81,10 @@ struct OcornutImguiContext
 					| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
 					| BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)
 					| BGFX_STATE_MSAA
 					| BGFX_STATE_MSAA
 					);
 					);
-				bgfx::setScissor(uint16_t(bx::fmax(pcmd->ClipRect.x, 0.0f))
-					, uint16_t(bx::fmax(pcmd->ClipRect.y, 0.0f))
-					, uint16_t(bx::fmin(pcmd->ClipRect.z, 65535.0f)-bx::fmax(pcmd->ClipRect.x, 0.0f))
-					, uint16_t(bx::fmin(pcmd->ClipRect.w, 65535.0f)-bx::fmax(pcmd->ClipRect.y, 0.0f))
+				bgfx::setScissor(uint16_t(bx::fmax(pcmd->ClipRect.x, 0.0f) )
+					, uint16_t(bx::fmax(pcmd->ClipRect.y, 0.0f) )
+					, uint16_t(bx::fmin(pcmd->ClipRect.z, 65535.0f)-bx::fmax(pcmd->ClipRect.x, 0.0f) )
+					, uint16_t(bx::fmin(pcmd->ClipRect.w, 65535.0f)-bx::fmax(pcmd->ClipRect.y, 0.0f) )
 					);
 					);
 				union { void* ptr; bgfx::TextureHandle handle; } texture ={ pcmd->TextureId };
 				union { void* ptr; bgfx::TextureHandle handle; } texture ={ pcmd->TextureId };
 
 
@@ -144,22 +144,22 @@ struct OcornutImguiContext
 		const bgfx::Memory* vsmem;
 		const bgfx::Memory* vsmem;
 		const bgfx::Memory* fsmem;
 		const bgfx::Memory* fsmem;
 
 
-		switch (bgfx::getRendererType())
+		switch (bgfx::getRendererType() )
 		{
 		{
 		case bgfx::RendererType::Direct3D9:
 		case bgfx::RendererType::Direct3D9:
-			vsmem = bgfx::makeRef(vs_ocornut_imgui_dx9, sizeof(vs_ocornut_imgui_dx9));
-			fsmem = bgfx::makeRef(fs_ocornut_imgui_dx9, sizeof(fs_ocornut_imgui_dx9));
+			vsmem = bgfx::makeRef(vs_ocornut_imgui_dx9, sizeof(vs_ocornut_imgui_dx9) );
+			fsmem = bgfx::makeRef(fs_ocornut_imgui_dx9, sizeof(fs_ocornut_imgui_dx9) );
 			break;
 			break;
 
 
 		case bgfx::RendererType::Direct3D11:
 		case bgfx::RendererType::Direct3D11:
 		case bgfx::RendererType::Direct3D12:
 		case bgfx::RendererType::Direct3D12:
-			vsmem = bgfx::makeRef(vs_ocornut_imgui_dx11, sizeof(vs_ocornut_imgui_dx11));
-			fsmem = bgfx::makeRef(fs_ocornut_imgui_dx11, sizeof(fs_ocornut_imgui_dx11));
+			vsmem = bgfx::makeRef(vs_ocornut_imgui_dx11, sizeof(vs_ocornut_imgui_dx11) );
+			fsmem = bgfx::makeRef(fs_ocornut_imgui_dx11, sizeof(fs_ocornut_imgui_dx11) );
 			break;
 			break;
 
 
 		default:
 		default:
-			vsmem = bgfx::makeRef(vs_ocornut_imgui_glsl, sizeof(vs_ocornut_imgui_glsl));
-			fsmem = bgfx::makeRef(fs_ocornut_imgui_glsl, sizeof(fs_ocornut_imgui_glsl));
+			vsmem = bgfx::makeRef(vs_ocornut_imgui_glsl, sizeof(vs_ocornut_imgui_glsl) );
+			fsmem = bgfx::makeRef(fs_ocornut_imgui_glsl, sizeof(fs_ocornut_imgui_glsl) );
 			break;
 			break;
 		}
 		}
 
 
@@ -185,7 +185,7 @@ struct OcornutImguiContext
 
 
 		io.Fonts->GetTexDataAsRGBA32(&data, &width, &height);
 		io.Fonts->GetTexDataAsRGBA32(&data, &width, &height);
 
 
-		m_texture = bgfx::createTexture2D((uint16_t)width
+		m_texture = bgfx::createTexture2D( (uint16_t)width
 			, (uint16_t)height
 			, (uint16_t)height
 			, 1
 			, 1
 			, bgfx::TextureFormat::BGRA8
 			, bgfx::TextureFormat::BGRA8
@@ -217,9 +217,9 @@ struct OcornutImguiContext
 			io.AddInputCharacter(_inputChar); // ASCII or GTFO! :(
 			io.AddInputCharacter(_inputChar); // ASCII or GTFO! :(
 		}
 		}
 
 
-		io.DisplaySize = ImVec2((float)_width, (float)_height);
+		io.DisplaySize = ImVec2( (float)_width, (float)_height);
 		io.DeltaTime = 1.0f / 60.0f;
 		io.DeltaTime = 1.0f / 60.0f;
-		io.MousePos = ImVec2((float)_mx, (float)_my);
+		io.MousePos = ImVec2( (float)_mx, (float)_my);
 		io.MouseDown[0] = 0 != (_button & IMGUI_MBUT_LEFT);
 		io.MouseDown[0] = 0 != (_button & IMGUI_MBUT_LEFT);
 		io.MouseDown[1] = 0 != (_button & IMGUI_MBUT_RIGHT);
 		io.MouseDown[1] = 0 != (_button & IMGUI_MBUT_RIGHT);
 		io.MouseWheel = (float)(_scroll - m_lastScroll);
 		io.MouseWheel = (float)(_scroll - m_lastScroll);

+ 1 - 1
examples/common/imgui/scintilla.cpp

@@ -236,7 +236,7 @@ public:
 	virtual Scintilla::XYPOSITION WidthChar(Scintilla::Font& _font, char ch) BX_OVERRIDE
 	virtual Scintilla::XYPOSITION WidthChar(Scintilla::Font& _font, char ch) BX_OVERRIDE
 	{
 	{
 		FontInt* fi = (FontInt*)_font.GetID();
 		FontInt* fi = (FontInt*)_font.GetID();
-		return fi->m_font->GetCharAdvance((unsigned int)ch) * fi->m_scale;
+		return fi->m_font->GetCharAdvance( (unsigned int)ch) * fi->m_scale;
 	}
 	}
 
 
 	virtual Scintilla::XYPOSITION Ascent(Scintilla::Font& _font) BX_OVERRIDE
 	virtual Scintilla::XYPOSITION Ascent(Scintilla::Font& _font) BX_OVERRIDE

+ 14 - 14
examples/common/nanovg/nanovg_bgfx.cpp

@@ -188,7 +188,7 @@ namespace
 			tex = &gl->textures[gl->ntextures++];
 			tex = &gl->textures[gl->ntextures++];
 		}
 		}
 
 
-		memset(tex, 0, sizeof(*tex));
+		memset(tex, 0, sizeof(*tex) );
 
 
 		return tex;
 		return tex;
 	}
 	}
@@ -218,7 +218,7 @@ namespace
 				{
 				{
 					bgfx::destroyTexture(gl->textures[ii].id);
 					bgfx::destroyTexture(gl->textures[ii].id);
 				}
 				}
-				memset(&gl->textures[ii], 0, sizeof(gl->textures[ii]));
+				memset(&gl->textures[ii], 0, sizeof(gl->textures[ii]) );
 				gl->textures[ii].id.idx = bgfx::invalidHandle;
 				gl->textures[ii].id.idx = bgfx::invalidHandle;
 				return 1;
 				return 1;
 			}
 			}
@@ -384,10 +384,10 @@ namespace
 		invdet = 1.0 / det;
 		invdet = 1.0 / det;
 		inv[0] = (float)(t[3] * invdet);
 		inv[0] = (float)(t[3] * invdet);
 		inv[2] = (float)(-t[2] * invdet);
 		inv[2] = (float)(-t[2] * invdet);
-		inv[4] = (float)(((double)t[2] * t[5] - (double)t[3] * t[4]) * invdet);
+		inv[4] = (float)( ((double)t[2] * t[5] - (double)t[3] * t[4]) * invdet);
 		inv[1] = (float)(-t[1] * invdet);
 		inv[1] = (float)(-t[1] * invdet);
 		inv[3] = (float)(t[0] * invdet);
 		inv[3] = (float)(t[0] * invdet);
-		inv[5] = (float)(((double)t[1] * t[4] - (double)t[0] * t[5]) * invdet);
+		inv[5] = (float)( ((double)t[1] * t[4] - (double)t[0] * t[5]) * invdet);
 	}
 	}
 
 
 	static void glnvg__xformToMat3x4(float* m3, float* t)
 	static void glnvg__xformToMat3x4(float* m3, float* t)
@@ -412,7 +412,7 @@ namespace
 		struct GLNVGtexture* tex = NULL;
 		struct GLNVGtexture* tex = NULL;
 		float invxform[6] = {};
 		float invxform[6] = {};
 
 
-		memset(frag, 0, sizeof(*frag));
+		memset(frag, 0, sizeof(*frag) );
 
 
 		frag->innerCol = paint->innerColor;
 		frag->innerCol = paint->innerColor;
 		frag->outerCol = paint->outerColor;
 		frag->outerCol = paint->outerColor;
@@ -422,7 +422,7 @@ namespace
 
 
 		if (scissor->extent[0] < 0.5f || scissor->extent[1] < 0.5f)
 		if (scissor->extent[0] < 0.5f || scissor->extent[1] < 0.5f)
 		{
 		{
-			memset(frag->scissorMat, 0, sizeof(frag->scissorMat));
+			memset(frag->scissorMat, 0, sizeof(frag->scissorMat) );
 			frag->scissorExt[0] = 1.0f;
 			frag->scissorExt[0] = 1.0f;
 			frag->scissorExt[1] = 1.0f;
 			frag->scissorExt[1] = 1.0f;
 			frag->scissorScale[0] = 1.0f;
 			frag->scissorScale[0] = 1.0f;
@@ -437,7 +437,7 @@ namespace
 			frag->scissorScale[0] = sqrtf(scissor->xform[0]*scissor->xform[0] + scissor->xform[2]*scissor->xform[2]) / fringe;
 			frag->scissorScale[0] = sqrtf(scissor->xform[0]*scissor->xform[0] + scissor->xform[2]*scissor->xform[2]) / fringe;
 			frag->scissorScale[1] = sqrtf(scissor->xform[1]*scissor->xform[1] + scissor->xform[3]*scissor->xform[3]) / fringe;
 			frag->scissorScale[1] = sqrtf(scissor->xform[1]*scissor->xform[1] + scissor->xform[3]*scissor->xform[3]) / fringe;
 		}
 		}
-		memcpy(frag->extent, paint->extent, sizeof(frag->extent));
+		memcpy(frag->extent, paint->extent, sizeof(frag->extent) );
 		frag->strokeMult = (width*0.5f + fringe*0.5f) / fringe;
 		frag->strokeMult = (width*0.5f + fringe*0.5f) / fringe;
 
 
 		bgfx::TextureHandle invalid = BGFX_INVALID_HANDLE;
 		bgfx::TextureHandle invalid = BGFX_INVALID_HANDLE;
@@ -779,7 +779,7 @@ namespace
 			gl->calls = (struct GLNVGcall*)realloc(gl->calls, sizeof(struct GLNVGcall) * gl->ccalls);
 			gl->calls = (struct GLNVGcall*)realloc(gl->calls, sizeof(struct GLNVGcall) * gl->ccalls);
 		}
 		}
 		ret = &gl->calls[gl->ncalls++];
 		ret = &gl->calls[gl->ncalls++];
-		memset(ret, 0, sizeof(struct GLNVGcall));
+		memset(ret, 0, sizeof(struct GLNVGcall) );
 		return ret;
 		return ret;
 	}
 	}
 
 
@@ -865,7 +865,7 @@ namespace
 		{
 		{
 			struct GLNVGpath* copy = &gl->paths[call->pathOffset + i];
 			struct GLNVGpath* copy = &gl->paths[call->pathOffset + i];
 			const struct NVGpath* path = &paths[i];
 			const struct NVGpath* path = &paths[i];
-			memset(copy, 0, sizeof(struct GLNVGpath));
+			memset(copy, 0, sizeof(struct GLNVGpath) );
 			if (path->nfill > 0)
 			if (path->nfill > 0)
 			{
 			{
 				copy->fillOffset = offset;
 				copy->fillOffset = offset;
@@ -901,7 +901,7 @@ namespace
 			call->uniformOffset = glnvg__allocFragUniforms(gl, 2);
 			call->uniformOffset = glnvg__allocFragUniforms(gl, 2);
 			// Simple shader for stencil
 			// Simple shader for stencil
 			frag = nvg__fragUniformPtr(gl, call->uniformOffset);
 			frag = nvg__fragUniformPtr(gl, call->uniformOffset);
-			memset(frag, 0, sizeof(*frag));
+			memset(frag, 0, sizeof(*frag) );
 			frag->type = NSVG_SHADER_SIMPLE;
 			frag->type = NSVG_SHADER_SIMPLE;
 			// Fill shader
 			// Fill shader
 			glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call->uniformOffset + gl->fragSize), paint, scissor, fringe, fringe);
 			glnvg__convertPaint(gl, nvg__fragUniformPtr(gl, call->uniformOffset + gl->fragSize), paint, scissor, fringe, fringe);
@@ -935,7 +935,7 @@ namespace
 		{
 		{
 			struct GLNVGpath* copy = &gl->paths[call->pathOffset + i];
 			struct GLNVGpath* copy = &gl->paths[call->pathOffset + i];
 			const struct NVGpath* path = &paths[i];
 			const struct NVGpath* path = &paths[i];
-			memset(copy, 0, sizeof(struct GLNVGpath));
+			memset(copy, 0, sizeof(struct GLNVGpath) );
 			if (path->nstroke)
 			if (path->nstroke)
 			{
 			{
 				copy->strokeOffset = offset;
 				copy->strokeOffset = offset;
@@ -1018,11 +1018,11 @@ NVGcontext* nvgCreate(int edgeaa, unsigned char viewid)
 {
 {
 	struct NVGparams params;
 	struct NVGparams params;
 	struct NVGcontext* ctx = NULL;
 	struct NVGcontext* ctx = NULL;
-	struct GLNVGcontext* gl = (struct GLNVGcontext*)malloc(sizeof(struct GLNVGcontext));
+	struct GLNVGcontext* gl = (struct GLNVGcontext*)malloc(sizeof(struct GLNVGcontext) );
 	if (gl == NULL) goto error;
 	if (gl == NULL) goto error;
-	memset(gl, 0, sizeof(struct GLNVGcontext));
+	memset(gl, 0, sizeof(struct GLNVGcontext) );
 
 
-	memset(&params, 0, sizeof(params));
+	memset(&params, 0, sizeof(params) );
 	params.renderCreate         = nvgRenderCreate;
 	params.renderCreate         = nvgRenderCreate;
 	params.renderCreateTexture  = nvgRenderCreateTexture;
 	params.renderCreateTexture  = nvgRenderCreateTexture;
 	params.renderDeleteTexture  = nvgRenderDeleteTexture;
 	params.renderDeleteTexture  = nvgRenderDeleteTexture;

+ 5 - 6
src/bgfx.cpp

@@ -1493,7 +1493,7 @@ again:
 			{
 			{
 				_type = RendererType::OpenGLES;
 				_type = RendererType::OpenGLES;
 			}
 			}
-			else if (BX_ENABLED(BX_PLATFORM_WINRT))
+			else if (BX_ENABLED(BX_PLATFORM_WINRT) )
 			{
 			{
 				_type = RendererType::Direct3D11;
 				_type = RendererType::Direct3D11;
 			}
 			}
@@ -2077,6 +2077,8 @@ again:
 
 
 		BX_ALIGNED_DELETE(g_allocator, ctx, 16);
 		BX_ALIGNED_DELETE(g_allocator, ctx, 16);
 
 
+		BX_TRACE("Shutdown complete.");
+
 		if (NULL != s_callbackStub)
 		if (NULL != s_callbackStub)
 		{
 		{
 			BX_DELETE(g_allocator, s_callbackStub);
 			BX_DELETE(g_allocator, s_callbackStub);
@@ -2093,11 +2095,8 @@ again:
 		}
 		}
 
 
 		s_threadIndex = 0;
 		s_threadIndex = 0;
-
-		BX_TRACE("Shutdown complete.");
-
-		g_callback  = NULL;
-		g_allocator = NULL;
+		g_callback    = NULL;
+		g_allocator   = NULL;
 	}
 	}
 
 
 	void reset(uint32_t _width, uint32_t _height, uint32_t _flags)
 	void reset(uint32_t _width, uint32_t _height, uint32_t _flags)

+ 3 - 3
src/bgfx_p.h

@@ -52,7 +52,7 @@
 namespace bgfx
 namespace bgfx
 {
 {
 #if BX_COMPILER_CLANG_ANALYZER
 #if BX_COMPILER_CLANG_ANALYZER
-	void __attribute__((analyzer_noreturn)) fatal(Fatal::Enum _code, const char* _format, ...);
+	void __attribute__( (analyzer_noreturn) ) fatal(Fatal::Enum _code, const char* _format, ...);
 #else
 #else
 	void fatal(Fatal::Enum _code, const char* _format, ...);
 	void fatal(Fatal::Enum _code, const char* _format, ...);
 #endif // BX_COMPILER_CLANG_ANALYZER
 #endif // BX_COMPILER_CLANG_ANALYZER
@@ -2090,7 +2090,7 @@ namespace bgfx
 			{
 			{
 				IndexBufferHandle indexBufferHandle = { m_indexBufferHandle.alloc() };
 				IndexBufferHandle indexBufferHandle = { m_indexBufferHandle.alloc() };
 				BX_WARN(isValid(indexBufferHandle), "Failed to allocate index buffer handle.");
 				BX_WARN(isValid(indexBufferHandle), "Failed to allocate index buffer handle.");
-				if (!isValid(indexBufferHandle))
+				if (!isValid(indexBufferHandle) )
 				{
 				{
 					return ptr;
 					return ptr;
 				}
 				}
@@ -2117,7 +2117,7 @@ namespace bgfx
 			if (0 != (_flags & BGFX_BUFFER_COMPUTE_WRITE) )
 			if (0 != (_flags & BGFX_BUFFER_COMPUTE_WRITE) )
 			{
 			{
 				IndexBufferHandle indexBufferHandle = { m_indexBufferHandle.alloc() };
 				IndexBufferHandle indexBufferHandle = { m_indexBufferHandle.alloc() };
-				if (!isValid(indexBufferHandle))
+				if (!isValid(indexBufferHandle) )
 				{
 				{
 					return handle;
 					return handle;
 				}
 				}

+ 4 - 4
src/renderer_d3d.h

@@ -144,13 +144,13 @@ namespace bgfx
 		void add(uint64_t _id, uint16_t _item)
 		void add(uint64_t _id, uint16_t _item)
 		{
 		{
 			invalidate(_id);
 			invalidate(_id);
-			m_hashMap.insert(stl::make_pair(_id, _item));
+			m_hashMap.insert(stl::make_pair(_id, _item) );
 		}
 		}
 
 
 		uint16_t find(uint64_t _id)
 		uint16_t find(uint64_t _id)
 		{
 		{
 			HashMap::iterator it = m_hashMap.find(_id);
 			HashMap::iterator it = m_hashMap.find(_id);
-			if (it != m_hashMap.end())
+			if (it != m_hashMap.end() )
 			{
 			{
 				return it->second;
 				return it->second;
 			}
 			}
@@ -161,7 +161,7 @@ namespace bgfx
 		void invalidate(uint64_t _id)
 		void invalidate(uint64_t _id)
 		{
 		{
 			HashMap::iterator it = m_hashMap.find(_id);
 			HashMap::iterator it = m_hashMap.find(_id);
-			if (it != m_hashMap.end())
+			if (it != m_hashMap.end() )
 			{
 			{
 				m_hashMap.erase(it);
 				m_hashMap.erase(it);
 			}
 			}
@@ -174,7 +174,7 @@ namespace bgfx
 
 
 		uint32_t getCount() const
 		uint32_t getCount() const
 		{
 		{
-			return uint32_t(m_hashMap.size());
+			return uint32_t(m_hashMap.size() );
 		}
 		}
 
 
 	private:
 	private:

+ 14 - 14
src/renderer_d3d11.cpp

@@ -788,10 +788,10 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 					);
 					);
 				BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
 				BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
 
 
-				DX_CHECK(m_factory->MakeWindowAssociation((HWND)g_platformData.nwh, 0
+				DX_CHECK(m_factory->MakeWindowAssociation( (HWND)g_platformData.nwh, 0
 					| DXGI_MWA_NO_WINDOW_CHANGES
 					| DXGI_MWA_NO_WINDOW_CHANGES
 					| DXGI_MWA_NO_ALT_ENTER
 					| DXGI_MWA_NO_ALT_ENTER
-					));
+					) );
 #endif // BX_PLATFORM_WINRT
 #endif // BX_PLATFORM_WINRT
 			}
 			}
 			else
 			else
@@ -853,7 +853,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 			if (m_featureLevel <= D3D_FEATURE_LEVEL_9_2)
 			if (m_featureLevel <= D3D_FEATURE_LEVEL_9_2)
 			{
 			{
 				g_caps.maxTextureSize   = D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION;
 				g_caps.maxTextureSize   = D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION;
-				g_caps.maxFBAttachments = uint8_t(bx::uint32_min(D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS));
+				g_caps.maxFBAttachments = uint8_t(bx::uint32_min(D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS) );
 			}
 			}
 			else if (m_featureLevel == D3D_FEATURE_LEVEL_9_3)
 			else if (m_featureLevel == D3D_FEATURE_LEVEL_9_3)
 			{
 			{
@@ -1314,7 +1314,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 			}
 			}
 
 
 			ID3D11Texture2D* backBuffer;
 			ID3D11Texture2D* backBuffer;
-			DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer));
+			DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer) );
 
 
 			D3D11_TEXTURE2D_DESC backBufferDesc;
 			D3D11_TEXTURE2D_DESC backBufferDesc;
 			backBuffer->GetDesc(&backBufferDesc);
 			backBuffer->GetDesc(&backBufferDesc);
@@ -1509,7 +1509,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 			if (NULL != m_swapChain)
 			if (NULL != m_swapChain)
 			{
 			{
 				ID3D11Texture2D* color;
 				ID3D11Texture2D* color;
-				DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&color));
+				DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&color) );
 
 
 				D3D11_RENDER_TARGET_VIEW_DESC desc;
 				D3D11_RENDER_TARGET_VIEW_DESC desc;
 				desc.ViewDimension = (m_flags & BGFX_RESET_MSAA_MASK)
 				desc.ViewDimension = (m_flags & BGFX_RESET_MSAA_MASK)
@@ -1708,7 +1708,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 							, getBufferHeight()
 							, getBufferHeight()
 							, getBufferFormat()
 							, getBufferFormat()
 							, DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH
 							, DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH
-							));
+							) );
 					}
 					}
 					else
 					else
 					{
 					{
@@ -1720,7 +1720,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 						SwapChainDesc* scd = &m_scd;
 						SwapChainDesc* scd = &m_scd;
 						SwapChainDesc swapChainScd;
 						SwapChainDesc swapChainScd;
 						if (0 != (m_flags & BGFX_RESET_HMD)
 						if (0 != (m_flags & BGFX_RESET_HMD)
-						&&  m_ovr.isInitialized())
+						&&  m_ovr.isInitialized() )
 						{
 						{
 							swapChainScd = m_scd;
 							swapChainScd = m_scd;
 							swapChainScd.SampleDesc = s_msaa[0];
 							swapChainScd.SampleDesc = s_msaa[0];
@@ -2264,7 +2264,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 					bx::write(&writer, magic);
 					bx::write(&writer, magic);
 
 
 					TextureCreate tc;
 					TextureCreate tc;
-					tc.m_flags   = BGFX_TEXTURE_RT|(((m_flags & BGFX_RESET_MSAA_MASK) >> BGFX_RESET_MSAA_SHIFT) << BGFX_TEXTURE_RT_MSAA_SHIFT);
+					tc.m_flags   = BGFX_TEXTURE_RT|( ((m_flags & BGFX_RESET_MSAA_MASK) >> BGFX_RESET_MSAA_SHIFT) << BGFX_TEXTURE_RT_MSAA_SHIFT);
 					tc.m_width   = m_ovr.m_rtSize.w;
 					tc.m_width   = m_ovr.m_rtSize.w;
 					tc.m_height  = m_ovr.m_rtSize.h;
 					tc.m_height  = m_ovr.m_rtSize.h;
 					tc.m_sides   = 0;
 					tc.m_sides   = 0;
@@ -2335,7 +2335,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 			if (m_flags&BGFX_RESET_CAPTURE)
 			if (m_flags&BGFX_RESET_CAPTURE)
 			{
 			{
 				ID3D11Texture2D* backBuffer;
 				ID3D11Texture2D* backBuffer;
-				DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer));
+				DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer) );
 
 
 				D3D11_TEXTURE2D_DESC backBufferDesc;
 				D3D11_TEXTURE2D_DESC backBufferDesc;
 				backBuffer->GetDesc(&backBufferDesc);
 				backBuffer->GetDesc(&backBufferDesc);
@@ -2381,7 +2381,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 			if (NULL != m_captureTexture)
 			if (NULL != m_captureTexture)
 			{
 			{
 				ID3D11Texture2D* backBuffer;
 				ID3D11Texture2D* backBuffer;
-				DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer));
+				DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&backBuffer) );
 
 
 				if (NULL == m_captureResolve)
 				if (NULL == m_captureResolve)
 				{
 				{
@@ -2389,7 +2389,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 				}
 				}
 				else
 				else
 				{
 				{
-					m_deviceCtx->ResolveSubresource(m_captureResolve, 0, backBuffer, 0, getBufferFormat());
+					m_deviceCtx->ResolveSubresource(m_captureResolve, 0, backBuffer, 0, getBufferFormat() );
 					m_deviceCtx->CopyResource(m_captureTexture, m_captureResolve);
 					m_deviceCtx->CopyResource(m_captureTexture, m_captureResolve);
 				}
 				}
 
 
@@ -2909,7 +2909,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 		D3D11_MAPPED_SUBRESOURCE mapped;
 		D3D11_MAPPED_SUBRESOURCE mapped;
 		BX_UNUSED(_discard);
 		BX_UNUSED(_discard);
 		D3D11_MAP type = D3D11_MAP_WRITE_DISCARD;
 		D3D11_MAP type = D3D11_MAP_WRITE_DISCARD;
-		DX_CHECK(deviceCtx->Map(m_ptr, 0, type, 0, &mapped));
+		DX_CHECK(deviceCtx->Map(m_ptr, 0, type, 0, &mapped) );
 		memcpy( (uint8_t*)mapped.pData + _offset, _data, _size);
 		memcpy( (uint8_t*)mapped.pData + _offset, _data, _size);
 		deviceCtx->Unmap(m_ptr, 0);
 		deviceCtx->Unmap(m_ptr, 0);
 #endif // 0
 #endif // 0
@@ -3058,7 +3058,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 		uint8_t numAttrs;
 		uint8_t numAttrs;
 		bx::read(&reader, numAttrs);
 		bx::read(&reader, numAttrs);
 
 
-		memset(m_attrMask, 0, sizeof(m_attrMask));
+		memset(m_attrMask, 0, sizeof(m_attrMask) );
 
 
 		for (uint32_t ii = 0; ii < numAttrs; ++ii)
 		for (uint32_t ii = 0; ii < numAttrs; ++ii)
 		{
 		{
@@ -3428,7 +3428,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
 		BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
 		BGFX_FATAL(SUCCEEDED(hr), Fatal::UnableToInitialize, "Failed to create swap chain.");
 
 
 		ID3D11Resource* ptr;
 		ID3D11Resource* ptr;
-		DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&ptr));
+		DX_CHECK(m_swapChain->GetBuffer(0, IID_ID3D11Texture2D, (void**)&ptr) );
 		DX_CHECK(s_renderD3D11->m_device->CreateRenderTargetView(ptr, NULL, &m_rtv[0]) );
 		DX_CHECK(s_renderD3D11->m_device->CreateRenderTargetView(ptr, NULL, &m_rtv[0]) );
 		DX_RELEASE(ptr, 0);
 		DX_RELEASE(ptr, 0);
 		m_srv[0]   = NULL;
 		m_srv[0]   = NULL;

+ 3 - 3
src/renderer_d3d9.cpp

@@ -395,7 +395,7 @@ namespace bgfx { namespace d3d9
 						}
 						}
 
 
 						if (BX_ENABLED(BGFX_CONFIG_DEBUG_PERFHUD)
 						if (BX_ENABLED(BGFX_CONFIG_DEBUG_PERFHUD)
-						&&  0 != strstr(desc.Description, "PerfHUD"))
+						&&  0 != strstr(desc.Description, "PerfHUD") )
 						{
 						{
 							m_adapter = ii;
 							m_adapter = ii;
 							m_deviceType = D3DDEVTYPE_REF;
 							m_deviceType = D3DDEVTYPE_REF;
@@ -1095,7 +1095,7 @@ namespace bgfx { namespace d3d9
 				}
 				}
 				DX_CHECK(m_device->SetDepthStencilSurface(m_backBufferDepthStencil) );
 				DX_CHECK(m_device->SetDepthStencilSurface(m_backBufferDepthStencil) );
 
 
-				DX_CHECK(m_device->SetRenderState(D3DRS_SRGBWRITEENABLE, 0 != (m_flags & BGFX_RESET_SRGB_BACKBUFFER) ));
+				DX_CHECK(m_device->SetRenderState(D3DRS_SRGBWRITEENABLE, 0 != (m_flags & BGFX_RESET_SRGB_BACKBUFFER) ) );
 			}
 			}
 			else
 			else
 			{
 			{
@@ -1337,7 +1337,7 @@ namespace bgfx { namespace d3d9
 				DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MAGFILTER, magFilter) );
 				DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MAGFILTER, magFilter) );
 				DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MIPFILTER, mipFilter) );
 				DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MIPFILTER, mipFilter) );
 				DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MAXANISOTROPY, m_maxAnisotropy) );
 				DX_CHECK(device->SetSamplerState(stage, D3DSAMP_MAXANISOTROPY, m_maxAnisotropy) );
-				DX_CHECK(device->SetSamplerState(stage, D3DSAMP_SRGBTEXTURE, 0 != (flags & BGFX_TEXTURE_SRGB)) );
+				DX_CHECK(device->SetSamplerState(stage, D3DSAMP_SRGBTEXTURE, 0 != (flags & BGFX_TEXTURE_SRGB) ) );
 			}
 			}
 		}
 		}
 
 

+ 5 - 5
src/renderer_gl.cpp

@@ -2467,7 +2467,7 @@ namespace bgfx { namespace gl
 					bx::write(&writer, magic);
 					bx::write(&writer, magic);
 
 
 					TextureCreate tc;
 					TextureCreate tc;
-					tc.m_flags   = BGFX_TEXTURE_RT|(((m_resolution.m_flags & BGFX_RESET_MSAA_MASK) >> BGFX_RESET_MSAA_SHIFT) << BGFX_TEXTURE_RT_MSAA_SHIFT);;
+					tc.m_flags   = BGFX_TEXTURE_RT|( ((m_resolution.m_flags & BGFX_RESET_MSAA_MASK) >> BGFX_RESET_MSAA_SHIFT) << BGFX_TEXTURE_RT_MSAA_SHIFT);;
 					tc.m_width   = m_ovr.m_rtSize.w;
 					tc.m_width   = m_ovr.m_rtSize.w;
 					tc.m_height  = m_ovr.m_rtSize.h;
 					tc.m_height  = m_ovr.m_rtSize.h;
 					tc.m_sides   = 0;
 					tc.m_sides   = 0;
@@ -5054,7 +5054,7 @@ namespace bgfx { namespace gl
 								case Binding::IndexBuffer:
 								case Binding::IndexBuffer:
 									{
 									{
 										const IndexBufferGL& buffer = m_indexBuffers[bind.m_idx];
 										const IndexBufferGL& buffer = m_indexBuffers[bind.m_idx];
-										GL_CHECK(glBindBufferBase(GL_SHADER_STORAGE_BUFFER, ii, buffer.m_id));
+										GL_CHECK(glBindBufferBase(GL_SHADER_STORAGE_BUFFER, ii, buffer.m_id) );
 										barrier |= GL_SHADER_STORAGE_BARRIER_BIT;
 										barrier |= GL_SHADER_STORAGE_BARRIER_BIT;
 									}
 									}
 									break;
 									break;
@@ -5062,7 +5062,7 @@ namespace bgfx { namespace gl
 								case Binding::VertexBuffer:
 								case Binding::VertexBuffer:
 									{
 									{
 										const VertexBufferGL& buffer = m_vertexBuffers[bind.m_idx];
 										const VertexBufferGL& buffer = m_vertexBuffers[bind.m_idx];
-										GL_CHECK(glBindBufferBase(GL_SHADER_STORAGE_BUFFER, ii, buffer.m_id));
+										GL_CHECK(glBindBufferBase(GL_SHADER_STORAGE_BUFFER, ii, buffer.m_id) );
 										barrier |= GL_SHADER_STORAGE_BARRIER_BIT;
 										barrier |= GL_SHADER_STORAGE_BARRIER_BIT;
 									}
 									}
 									break;
 									break;
@@ -5217,7 +5217,7 @@ namespace bgfx { namespace gl
 								GLint ref = (stencil&BGFX_STENCIL_FUNC_REF_MASK)>>BGFX_STENCIL_FUNC_REF_SHIFT;
 								GLint ref = (stencil&BGFX_STENCIL_FUNC_REF_MASK)>>BGFX_STENCIL_FUNC_REF_SHIFT;
 								GLint mask = (stencil&BGFX_STENCIL_FUNC_RMASK_MASK)>>BGFX_STENCIL_FUNC_RMASK_SHIFT;
 								GLint mask = (stencil&BGFX_STENCIL_FUNC_RMASK_MASK)>>BGFX_STENCIL_FUNC_RMASK_SHIFT;
 								uint32_t func = (stencil&BGFX_STENCIL_TEST_MASK)>>BGFX_STENCIL_TEST_SHIFT;
 								uint32_t func = (stencil&BGFX_STENCIL_TEST_MASK)>>BGFX_STENCIL_TEST_SHIFT;
-								GL_CHECK(glStencilFuncSeparate(face, s_cmpFunc[func], ref, mask));
+								GL_CHECK(glStencilFuncSeparate(face, s_cmpFunc[func], ref, mask) );
 							}
 							}
 
 
 							if ( (BGFX_STENCIL_OP_FAIL_S_MASK|BGFX_STENCIL_OP_FAIL_Z_MASK|BGFX_STENCIL_OP_PASS_Z_MASK) & changed)
 							if ( (BGFX_STENCIL_OP_FAIL_S_MASK|BGFX_STENCIL_OP_FAIL_Z_MASK|BGFX_STENCIL_OP_PASS_Z_MASK) & changed)
@@ -5337,7 +5337,7 @@ namespace bgfx { namespace gl
 							const uint32_t srcA   = (blend>> 8)&0xf;
 							const uint32_t srcA   = (blend>> 8)&0xf;
 							const uint32_t dstA   = (blend>>12)&0xf;
 							const uint32_t dstA   = (blend>>12)&0xf;
 
 
-							const uint32_t equ    = uint32_t((newFlags&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT);
+							const uint32_t equ    = uint32_t( (newFlags&BGFX_STATE_BLEND_EQUATION_MASK)>>BGFX_STATE_BLEND_EQUATION_SHIFT);
 							const uint32_t equRGB = (equ   )&0x7;
 							const uint32_t equRGB = (equ   )&0x7;
 							const uint32_t equA   = (equ>>3)&0x7;
 							const uint32_t equA   = (equ>>3)&0x7;
 
 

+ 1 - 1
src/vertexdecl.cpp

@@ -131,7 +131,7 @@ namespace bgfx
 	{
 	{
 		uint8_t val = m_attributes[_attrib];
 		uint8_t val = m_attributes[_attrib];
 		_num        = (val&3)+1;
 		_num        = (val&3)+1;
-		_type       = AttribType::Enum((val>>3)&3);
+		_type       = AttribType::Enum( (val>>3)&3);
 		_normalized = !!(val&(1<<6) );
 		_normalized = !!(val&(1<<6) );
 		_asInt      = !!(val&(1<<7) );
 		_asInt      = !!(val&(1<<7) );
 	}
 	}