From 8bcd09a67f52bc3d791f5de058e3edd8c8d39eae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 18 Jun 2017 17:06:07 -0700 Subject: [PATCH 1/2] Cleanup. --- examples/11-fontsdf/fontsdf.cpp | 4 ++-- examples/13-stencil/stencil.cpp | 2 +- examples/16-shadowmaps/shadowmaps.cpp | 13 +++++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/examples/11-fontsdf/fontsdf.cpp b/examples/11-fontsdf/fontsdf.cpp index fa470e711..0222c298d 100644 --- a/examples/11-fontsdf/fontsdf.cpp +++ b/examples/11-fontsdf/fontsdf.cpp @@ -129,8 +129,8 @@ class ExampleFontSDF : public entry::AppI , 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::Begin("Text Area" diff --git a/examples/13-stencil/stencil.cpp b/examples/13-stencil/stencil.cpp index f6b7646c9..1eb04bdb9 100644 --- a/examples/13-stencil/stencil.cpp +++ b/examples/13-stencil/stencil.cpp @@ -958,7 +958,7 @@ public: uint8_t numLights = (uint8_t)m_numLights; s_uniforms.m_params.m_ambientPass = 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_color[3] = m_reflectionValue; diff --git a/examples/16-shadowmaps/shadowmaps.cpp b/examples/16-shadowmaps/shadowmaps.cpp index 94f7996b1..993c22445 100644 --- a/examples/16-shadowmaps/shadowmaps.cpp +++ b/examples/16-shadowmaps/shadowmaps.cpp @@ -1971,10 +1971,10 @@ class ExampleShadowmaps : public entry::AppI , 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" , NULL - , ImVec2(300, 660) + , ImVec2(300.0f, 660.0f) , ImGuiWindowFlags_AlwaysAutoResize ); @@ -2414,7 +2414,12 @@ if ( ImGui::RadioButton(_name, _var == _val )) _var = _val; BX_CHECK(maxNumSplits >= settings.m_numSplits, "Error! Max num splits."); 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. 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) { - drawNum = m_settings.m_numSplits; + drawNum = uint8_t(m_settings.m_numSplits); } for (uint8_t ii = 0; ii < drawNum; ++ii) From baa7cd92824d21a12302516b9a4b0c4b07ed6958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 18 Jun 2017 17:12:30 -0700 Subject: [PATCH 2/2] Cleanup. --- tools/geometryc/geometryc.cpp | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tools/geometryc/geometryc.cpp b/tools/geometryc/geometryc.cpp index 58b2465f4..dca91ba76 100644 --- a/tools/geometryc/geometryc.cpp +++ b/tools/geometryc/geometryc.cpp @@ -48,15 +48,6 @@ namespace stl = tinystl; } while(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 #include #include @@ -626,7 +617,6 @@ int main(int _argc, const char* _argv[]) } else if (0 == bx::strCmp(argv[0], "g") ) { - EXPECT(1 < argc); group.m_name = argv[1]; } else if (*argv[0] == 'v')