diff --git a/src/easymesh/easymesh.cpp b/src/easymesh/easymesh.cpp index 24d79645..675de6e5 100644 --- a/src/easymesh/easymesh.cpp +++ b/src/easymesh/easymesh.cpp @@ -134,6 +134,7 @@ void DefaultShaderData::StoreUniformNames() //----------------------------------------------------------------------------- void DefaultShaderData::SetupDefaultData(bool with_UV) { + UNUSED(with_UV); for (int i = 0; i < m_uniform_names.Count(); i++) AddUniform(m_uniform_names[i].C()); } @@ -150,7 +151,6 @@ void DefaultShaderData::SetupShaderDatas(mat4 const &model) Array light_data; //This is not very nice, but necessary for emscripten WebGL generation. float f = 0.f; - int i = 0; /* FIXME: the 4th component of the position can be used for other things */ /* FIXME: GetUniform("blabla") is costly */ @@ -158,6 +158,8 @@ void DefaultShaderData::SetupShaderDatas(mat4 const &model) light_data << lights[i]->GetPosition() << lights[i]->GetColor(); while (light_data.Count() < 8) light_data << vec4::zero << vec4::zero; + + int i = 0; m_shader->SetUniform(*GetUniform(m_uniform_names[i++].C()), light_data); m_shader->SetUniform(*GetUniform(m_uniform_names[i++].C()), modelview); @@ -2691,7 +2693,8 @@ void EasyMesh::AppendCog(int nbsides, float h, float d10, float d20, j, j, j, j, \ j, j, j, j, \ k, j, j, k \ - }; + }; \ + UNUSED(q); int m[] = { /* The top and bottom faces */ 0, 2, 3, 1, 7, 9, 8, 6, diff --git a/test/empty.html b/test/javascript/empty.html similarity index 100% rename from test/empty.html rename to test/javascript/empty.html diff --git a/test/meshviewer.cpp b/test/meshviewer.cpp index bb412a4b..134112d5 100644 --- a/test/meshviewer.cpp +++ b/test/meshviewer.cpp @@ -359,7 +359,7 @@ public: bool is_pos = false; bool is_fov = false; bool is_hsc = false; - vec2 tmp = vec2::zero; + vec2 tmpv = vec2::zero; #if NO_NACL_EM is_pos = KeyDown(KEY_CAM_POS) || KeyDown(MSE_CAM_POS); @@ -367,23 +367,23 @@ public: if (KeyDown(MSE_CAM_ROT) || KeyDown(MSE_CAM_POS) || KeyDown(MSE_CAM_FOV)) { - tmp += vec2(AxisValue(MSEX_CAM_Y), AxisValue(MSEX_CAM_X)); + tmpv += vec2(AxisValue(MSEX_CAM_Y), AxisValue(MSEX_CAM_X)); if (KeyDown(MSE_CAM_ROT)) - tmp *= 6.f; + tmpv *= 6.f; if (KeyDown(MSE_CAM_POS)) - tmp *= vec2(1.f, -1.f) * 3.f; + tmpv *= vec2(1.f, -1.f) * 3.f; if (KeyDown(MSE_CAM_FOV)) - tmp = vec2(tmp.y * 4.f, tmp.x * 6.f); + tmpv = vec2(tmpv.y * 4.f, tmpv.x * 6.f); } - tmp += vec2((float)KeyDown(KEY_CAM_UP ) - (float)KeyDown(KEY_CAM_DOWN), - (float)KeyDown(KEY_CAM_RIGHT) - (float)KeyDown(KEY_CAM_LEFT)); + tmpv += vec2((float)KeyDown(KEY_CAM_UP ) - (float)KeyDown(KEY_CAM_DOWN), + (float)KeyDown(KEY_CAM_RIGHT) - (float)KeyDown(KEY_CAM_LEFT)); #endif //NO_NACL_EM //Base data - vec2 rot = (!is_pos && !is_fov)?(tmp):(vec2(.0f)); rot = vec2(rot.x, rot.y); - vec2 pos = ( is_pos && !is_fov)?(tmp):(vec2(.0f)); pos = -vec2(pos.y, pos.x); - vec2 fov = (!is_pos && is_fov )?(tmp):(vec2(.0f)); fov = vec2(-fov.x, fov.y); + vec2 rot = (!is_pos && !is_fov)?(tmpv):(vec2(.0f)); rot = vec2(rot.x, rot.y); + vec2 pos = ( is_pos && !is_fov)?(tmpv):(vec2(.0f)); pos = -vec2(pos.y, pos.x); + vec2 fov = (!is_pos && is_fov )?(tmpv):(vec2(.0f)); fov = vec2(-fov.x, fov.y); vec2 hsc = (is_hsc)?(vec2(0.f)):(vec2(0.f)); //speed @@ -536,11 +536,11 @@ public: for (int i = 0; i < m_ssetup->m_lights.Count(); ++i) { //Store local dst in current m_ld - LightData tmp = LightData(m_ssetup->m_lights[i]->GetPosition().xyz, m_ssetup->m_lights[i]->GetColor()); + LightData ltmp = LightData(m_ssetup->m_lights[i]->GetPosition().xyz, m_ssetup->m_lights[i]->GetColor()); if (i < m_light_datas.Count()) - m_light_datas[i] = tmp; + m_light_datas[i] = ltmp; else - m_light_datas << tmp; + m_light_datas << ltmp; vec3 loc = vec3::zero; vec4 col = vec4::zero; @@ -732,14 +732,14 @@ public: { for (int k = 0; k < m_ssetup->m_lights.Count(); ++k) { - Light* tmp = m_ssetup->m_lights[k]; - mat4 world = mat4::translate(tmp->GetPosition().xyz); + Light* ltmp = m_ssetup->m_lights[k]; + mat4 world = mat4::translate(ltmp->GetPosition().xyz); mat4 local = mat4::translate((inverse(m_mat) * world).v3.xyz); //dir light - if (tmp->GetPosition().w == 0.f) + if (ltmp->GetPosition().w == 0.f) { m_gizmos[GZ_LightPos]->Render(m_mat * inverse(local)); - m_gizmos[GZ_LightDir]->Render(inverse(world) * inverse(mat4::lookat(vec3::zero, -tmp->GetPosition().xyz, vec3::axis_y))); + m_gizmos[GZ_LightDir]->Render(inverse(world) * inverse(mat4::lookat(vec3::zero, -ltmp->GetPosition().xyz, vec3::axis_y))); } else //point light { diff --git a/test/meshviewer.index.html b/test/meshviewer.index.html index 8027eefd..7f9e2c12 100644 --- a/test/meshviewer.index.html +++ b/test/meshviewer.index.html @@ -282,7 +282,7 @@ function machinchose() { return 'test machin '; }
....
 
- +