Browse Source

Merge branch 'master' of github.com:bkaradzic/bgfx

Branimir Karadžić 8 years ago
parent
commit
7ae58a6221

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

@@ -129,8 +129,8 @@ class ExampleFontSDF : public entry::AppI
 				, uint16_t(m_height)
 				, uint16_t(m_height)
 				);
 				);
 
 
-			const int32_t guiPanelWidth = 325;
-			const int32_t guiPanelHeight = 200;
+			const float guiPanelWidth  = 325.0f;
+			const float guiPanelHeight = 200.0f;
 
 
 			ImGui::SetNextWindowPos(ImVec2(m_width - guiPanelWidth - 10.0f, 10.0f) );
 			ImGui::SetNextWindowPos(ImVec2(m_width - guiPanelWidth - 10.0f, 10.0f) );
 			ImGui::Begin("Text Area"
 			ImGui::Begin("Text Area"

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

@@ -958,7 +958,7 @@ public:
 			uint8_t numLights = (uint8_t)m_numLights;
 			uint8_t numLights = (uint8_t)m_numLights;
 			s_uniforms.m_params.m_ambientPass  = 1.0f;
 			s_uniforms.m_params.m_ambientPass  = 1.0f;
 			s_uniforms.m_params.m_lightingPass = 1.0f;
 			s_uniforms.m_params.m_lightingPass = 1.0f;
-			s_uniforms.m_params.m_lightCount   = m_numLights;
+			s_uniforms.m_params.m_lightCount   = float(m_numLights);
 			s_uniforms.m_params.m_lightIndex   = 0.0f;
 			s_uniforms.m_params.m_lightIndex   = 0.0f;
 			s_uniforms.m_color[3]              = m_reflectionValue;
 			s_uniforms.m_color[3]              = m_reflectionValue;
 
 

+ 9 - 4
examples/16-shadowmaps/shadowmaps.cpp

@@ -1971,10 +1971,10 @@ class ExampleShadowmaps : public entry::AppI
 							, m_viewState.m_height
 							, m_viewState.m_height
 							);
 							);
 
 
-			ImGui::SetNextWindowPos(ImVec2(m_viewState.m_width - 300 - 10, 10) );
+			ImGui::SetNextWindowPos(ImVec2(float(m_viewState.m_width) - 300.0f - 10.0f, 10.0f) );
 			ImGui::Begin("Settings"
 			ImGui::Begin("Settings"
 						 , NULL
 						 , NULL
-						 , ImVec2(300, 660)
+						 , ImVec2(300.0f, 660.0f)
 						 , ImGuiWindowFlags_AlwaysAutoResize
 						 , ImGuiWindowFlags_AlwaysAutoResize
 						 );
 						 );
 
 
@@ -2414,7 +2414,12 @@ if ( ImGui::RadioButton(_name, _var == _val )) _var = _val;
 				BX_CHECK(maxNumSplits >= settings.m_numSplits, "Error! Max num splits.");
 				BX_CHECK(maxNumSplits >= settings.m_numSplits, "Error! Max num splits.");
 
 
 				float splitSlices[maxNumSplits*2];
 				float splitSlices[maxNumSplits*2];
-				splitFrustum(splitSlices, m_settings.m_numSplits, currentSmSettings->m_near, currentSmSettings->m_far, m_settings.m_splitDistribution);
+				splitFrustum(splitSlices
+					, uint8_t(m_settings.m_numSplits)
+					, currentSmSettings->m_near
+					, currentSmSettings->m_far
+					, m_settings.m_splitDistribution
+					);
 
 
 				// Update uniforms.
 				// Update uniforms.
 				for (uint8_t ii = 0, ff = 1; ii < m_settings.m_numSplits; ++ii, ff+=2)
 				for (uint8_t ii = 0, ff = 1; ii < m_settings.m_numSplits; ++ii, ff+=2)
@@ -2808,7 +2813,7 @@ if ( ImGui::RadioButton(_name, _var == _val )) _var = _val;
 				}
 				}
 				else //LightType::DirectionalLight == settings.m_lightType)
 				else //LightType::DirectionalLight == settings.m_lightType)
 				{
 				{
-					drawNum = m_settings.m_numSplits;
+					drawNum = uint8_t(m_settings.m_numSplits);
 				}
 				}
 
 
 				for (uint8_t ii = 0; ii < drawNum; ++ii)
 				for (uint8_t ii = 0; ii < drawNum; ++ii)

+ 0 - 10
tools/geometryc/geometryc.cpp

@@ -48,15 +48,6 @@ namespace stl = tinystl;
 		} while(0)
 		} while(0)
 #endif // 0
 #endif // 0
 
 
-#define EXPECT(_condition) \
-	do { \
-		if (!(_condition) ) \
-		{ \
-			printf("Error parsing at:\n" BX_FILE_LINE_LITERAL "\nExpected: " #_condition "\n"); \
-			exit(EXIT_FAILURE); \
-		} \
-	} while(0)
-
 #include <bx/bx.h>
 #include <bx/bx.h>
 #include <bx/debug.h>
 #include <bx/debug.h>
 #include <bx/commandline.h>
 #include <bx/commandline.h>
@@ -626,7 +617,6 @@ int main(int _argc, const char* _argv[])
 			}
 			}
 			else if (0 == bx::strCmp(argv[0], "g") )
 			else if (0 == bx::strCmp(argv[0], "g") )
 			{
 			{
-				EXPECT(1 < argc);
 				group.m_name = argv[1];
 				group.m_name = argv[1];
 			}
 			}
 			else if (*argv[0] == 'v')
 			else if (*argv[0] == 'v')