From 1c3ca01ea05cd1742535407f742aa40897c3d7f2 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 24 Feb 2013 17:39:40 +0000 Subject: [PATCH] build: fix a few compiler warnings here and there. --- src/easymesh/easymesh.cpp | 9 +++++---- src/easymesh/easymesh.h | 2 +- src/gpu/framebuffer.cpp | 4 ++-- src/image/codec/dummy-image.cpp | 2 ++ src/image/image.cpp | 3 ++- src/mesh/mesh.cpp | 1 + src/video.cpp | 5 ++--- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/easymesh/easymesh.cpp b/src/easymesh/easymesh.cpp index 3b3a955a..7f6774c3 100644 --- a/src/easymesh/easymesh.cpp +++ b/src/easymesh/easymesh.cpp @@ -420,7 +420,7 @@ void EasyMesh::MeshConvert(Shader* provided_shader) } //----------------------------------------------------------------------------- -void EasyMesh::Render(mat4 const &model, float damage) +void EasyMesh::Render(mat4 const &model) { m_gpu_data.RenderMeshData(model); } @@ -871,6 +871,7 @@ void EasyMesh::ComputeNormals(int start, int vcount) //----------------------------------------------------------------------------- void EasyMesh::ComputeTexCoord(float uv_scale, int uv_offset) { + UNUSED(uv_scale, uv_offset); #if 0 VertexDictionnary vert_dict; Array tri_list; @@ -2149,7 +2150,7 @@ void EasyMesh::AppendCog(int nbsides, float h, float d10, float d20, for (int n = 0; n < 3 * 12; n++) { int d = n / 3; - int m = d % 6; + int e = d % 6; AddVertex(p[d]); if (n % 3 == 0) //Top-Bottom logic { @@ -2165,14 +2166,14 @@ void EasyMesh::AppendCog(int nbsides, float h, float d10, float d20, SetCurVertTexCoord(tmp * vec2(.25f) + add); SetCurVertTexCoord2(tmp * vec2(.25f) + add); } - else if (m == 0 || m == 1) //inner Logic + else if (e == 0 || e == 1) //inner Logic { SetCurVertTexCoord(uv[d]); SetCurVertTexCoord2(uv[d]); } else //Cog logic { - if (m == 2 && n % 3 == 2) + if (e == 2 && n % 3 == 2) { SetCurVertTexCoord(vec2(1.f, (d == 2)?(0.f):(1.f)) * CogUV[0] + CogUV[1]); SetCurVertTexCoord2(vec2(1.f, (d == 2)?(0.f):(1.f)) * CogUV[0] + CogUV[1]); diff --git a/src/easymesh/easymesh.h b/src/easymesh/easymesh.h index 733533e4..437d5aeb 100644 --- a/src/easymesh/easymesh.h +++ b/src/easymesh/easymesh.h @@ -525,7 +525,7 @@ public: bool Compile(char const *command); void MeshConvert(GpuShaderData* new_gpu_sdata); void MeshConvert(Shader* ProvidedShader = NULL); - void Render(mat4 const &model, float damage = 0.f); + void Render(mat4 const &model); private: void UpdateVertexDict(Array< int, int > &vertex_dict); diff --git a/src/gpu/framebuffer.cpp b/src/gpu/framebuffer.cpp index 1d7c3942..d8a97d3b 100644 --- a/src/gpu/framebuffer.cpp +++ b/src/gpu/framebuffer.cpp @@ -209,9 +209,9 @@ void FrameBuffer::Unbind() m_data->m_back_surface->Release(); #else # if GL_VERSION_1_1 || GL_ES_VERSION_2_0 - glBindFramebuffer(GL_FRAMEBUFFER, NULL); + glBindFramebuffer(GL_FRAMEBUFFER, 0); # else - glBindFramebufferOES(GL_FRAMEBUFFER_OES, NULL); + glBindFramebufferOES(GL_FRAMEBUFFER_OES, 0); # endif #endif } diff --git a/src/image/codec/dummy-image.cpp b/src/image/codec/dummy-image.cpp index f8337b8f..764d1110 100644 --- a/src/image/codec/dummy-image.cpp +++ b/src/image/codec/dummy-image.cpp @@ -42,6 +42,8 @@ private: bool DummyImageData::Open(char const *path) { + UNUSED(path); + size = ivec2(256); format = Image::FORMAT_RGBA; pixels = (uint8_t *)malloc(256 * 256 * 4 * sizeof(*pixels)); diff --git a/src/image/image.cpp b/src/image/image.cpp index b735ec27..ff68c2ed 100644 --- a/src/image/image.cpp +++ b/src/image/image.cpp @@ -55,7 +55,8 @@ static bool RegisterAllLoaders() Image::Image(char const *path) { - static bool unused = RegisterAllLoaders(); + static bool init = RegisterAllLoaders(); + UNUSED(init); data = ImageLoader::Load(path); } diff --git a/src/mesh/mesh.cpp b/src/mesh/mesh.cpp index 6ed09e41..14254f0e 100644 --- a/src/mesh/mesh.cpp +++ b/src/mesh/mesh.cpp @@ -44,6 +44,7 @@ SubMesh::~SubMesh() void SubMesh::Render(mat4 const &model) { + /* FIXME: TODO */ } } /* namespace lol */ diff --git a/src/video.cpp b/src/video.cpp index abe62b2c..7054f006 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -239,9 +239,6 @@ void Video::SetClearDepth(float f) void Video::SetDebugRenderMode(DebugRenderMode d) { - if (d == DebugRenderMode::Max) - return; - switch(d) { //All these modes are handled in the shaders. @@ -289,6 +286,8 @@ void Video::SetDebugRenderMode(DebugRenderMode d) #endif break; } + default: + return; /* Unknown render mode */ } VideoData::render_mode = d; }