fixed annoying warnings
This commit is contained in:
parent
cf07f30a00
commit
3ed4b73c05
@ -10,7 +10,7 @@ FILE(GLOB RES_SRC_FILE shaders/*.glsl)
|
|||||||
SET(RESOURCE_DST_FILE shaders.cpp)
|
SET(RESOURCE_DST_FILE shaders.cpp)
|
||||||
|
|
||||||
# choose source file
|
# choose source file
|
||||||
file(GLOB LIB_SRC_LIST src/*.cpp src/glew.c)
|
file(GLOB LIB_SRC_LIST src/*.cpp)
|
||||||
list(APPEND LIB_SRC_LIST ${RESOURCE_DST_FILE})
|
list(APPEND LIB_SRC_LIST ${RESOURCE_DST_FILE})
|
||||||
file(GLOB LIB_HEAD_LIST src/*.h)
|
file(GLOB LIB_HEAD_LIST src/*.h)
|
||||||
|
|
||||||
|
16
src/mesh.cpp
16
src/mesh.cpp
@ -37,8 +37,8 @@ Mesh::Mesh() :
|
|||||||
isBillboard(false),
|
isBillboard(false),
|
||||||
isShadowCaster(true),
|
isShadowCaster(true),
|
||||||
depth(0),
|
depth(0),
|
||||||
vao(0),
|
primitive_type(GL_TRIANGLES),
|
||||||
primitive_type(GL_TRIANGLES)
|
vao(0)
|
||||||
{
|
{
|
||||||
clearBuffers();
|
clearBuffers();
|
||||||
}
|
}
|
||||||
@ -289,13 +289,15 @@ void Mesh::mergeVertices()
|
|||||||
|
|
||||||
for(std::size_t i=0; i<indices.size(); ++i)
|
for(std::size_t i=0; i<indices.size(); ++i)
|
||||||
{
|
{
|
||||||
std::pair<std::set<int,VertexComparator>::iterator,bool> ret = vertexSet.insert(indices[i]);
|
std::pair<std::set<int,VertexComparator>::iterator, bool> ret = vertexSet.insert(indices[i]);
|
||||||
deleted[indices[i]] = !ret.second && *(ret.first) != indices[i];
|
std::set<int,VertexComparator>::iterator it = ret.first;
|
||||||
|
bool success = ret.second;
|
||||||
|
deleted[indices[i]] = !success && *it != int(indices[i]);
|
||||||
if(deleted[indices[i]])
|
if(deleted[indices[i]])
|
||||||
{
|
{
|
||||||
if(!tangents.empty())
|
if(!tangents.empty())
|
||||||
tangents[*(ret.first)].tangent += tangents[indices[i]].tangent;
|
tangents[*it].tangent += tangents[indices[i]].tangent;
|
||||||
indices[i] = *(ret.first);
|
indices[i] = *it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
@ -330,7 +332,7 @@ void Mesh::mergeVertices()
|
|||||||
normals.resize(normals.size()-offset);
|
normals.resize(normals.size()-offset);
|
||||||
if(!tangents.empty())
|
if(!tangents.empty())
|
||||||
tangents.resize(tangents.size()-offset);
|
tangents.resize(tangents.size()-offset);
|
||||||
for(int i=0; i<tangents.size(); ++i)
|
for(int i=0; i<int(tangents.size()); ++i)
|
||||||
{
|
{
|
||||||
glm::vec3 &T = tangents[i].tangent;
|
glm::vec3 &T = tangents[i].tangent;
|
||||||
const glm::vec3 &N = normals[i];
|
const glm::vec3 &N = normals[i];
|
||||||
|
@ -15,11 +15,11 @@ const GLfloat PostEffectModule::vertices[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PostEffectModule::PostEffectModule(int width, int height) :
|
PostEffectModule::PostEffectModule(int width, int height) :
|
||||||
outputFBO(FrameBuffer::screen),
|
|
||||||
frameBuffers(NULL),
|
frameBuffers(NULL),
|
||||||
|
outputFBO(FrameBuffer::screen),
|
||||||
blur(NULL),
|
blur(NULL),
|
||||||
redux(NULL),
|
|
||||||
blurSource(NULL),
|
blurSource(NULL),
|
||||||
|
redux(NULL),
|
||||||
bloom_threshold(0.7f)
|
bloom_threshold(0.7f)
|
||||||
{
|
{
|
||||||
for(int i=0; i<NB_SHADERS; ++i)
|
for(int i=0; i<NB_SHADERS; ++i)
|
||||||
|
@ -34,7 +34,7 @@ void SparrowRenderer::initGL(int w, int h, bool forceCrappy)
|
|||||||
strcmp("3.30",(const char *)glGetString(GL_SHADING_LANGUAGE_VERSION)) <= 0;
|
strcmp("3.30",(const char *)glGetString(GL_SHADING_LANGUAGE_VERSION)) <= 0;
|
||||||
|
|
||||||
#ifdef RENDER_DEBUG
|
#ifdef RENDER_DEBUG
|
||||||
printf("Using SparrowRenderer %d.%d\n\n", VERSION_MAJOR, VERSION_MINOR);
|
printf("Using SparrowRenderer %d.%d\n\n", SparrowRenderer_VERSION_MAJOR, SparrowRenderer_VERSION_MINOR);
|
||||||
if(modernOpenglAvailable)
|
if(modernOpenglAvailable)
|
||||||
printf("Modern OpenGL available.\n");
|
printf("Modern OpenGL available.\n");
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user