From 92dcf2e5efff356143483fe7db81bdef8a1613ff Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 17 Sep 2014 11:03:05 +0200 Subject: [PATCH] - fixed some of those supremely annoying and supremely pointless GCC/Clang compiler warnings. --- src/gl/data/gl_vertexbuffer.h | 4 ++-- src/gl/dynlights/gl_lightbuffer.cpp | 14 +++++++------- src/gl/scene/gl_drawinfo.h | 1 - 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gl/data/gl_vertexbuffer.h b/src/gl/data/gl_vertexbuffer.h index b6d61f2da1..84967a9ee6 100644 --- a/src/gl/data/gl_vertexbuffer.h +++ b/src/gl/data/gl_vertexbuffer.h @@ -51,8 +51,8 @@ class FFlatVertexBuffer : public FVertexBuffer void CheckPlanes(sector_t *sector); - const unsigned int BUFFER_SIZE = 2000000; - const unsigned int BUFFER_SIZE_TO_USE = 1999500; + static const unsigned int BUFFER_SIZE = 2000000; + static const unsigned int BUFFER_SIZE_TO_USE = 1999500; void ImmRenderBuffer(unsigned int primtype, unsigned int offset, unsigned int count); diff --git a/src/gl/dynlights/gl_lightbuffer.cpp b/src/gl/dynlights/gl_lightbuffer.cpp index 7e96c43ce0..1e0ec7e5ac 100644 --- a/src/gl/dynlights/gl_lightbuffer.cpp +++ b/src/gl/dynlights/gl_lightbuffer.cpp @@ -57,7 +57,7 @@ FLightBuffer::FLightBuffer() if (gl.flags & RFL_SHADER_STORAGE_BUFFER) { mBufferType = GL_SHADER_STORAGE_BUFFER; - mBlockAlign = -1; + mBlockAlign = 0; mBlockSize = mBufferSize; } else @@ -100,12 +100,12 @@ void FLightBuffer::Clear() int FLightBuffer::UploadLights(FDynLightData &data) { - int size0 = data.arrays[0].Size()/4; - int size1 = data.arrays[1].Size()/4; - int size2 = data.arrays[2].Size()/4; - int totalsize = size0 + size1 + size2 + 1; + unsigned int size0 = data.arrays[0].Size()/4; + unsigned int size1 = data.arrays[1].Size()/4; + unsigned int size2 = data.arrays[2].Size()/4; + unsigned int totalsize = size0 + size1 + size2 + 1; - if (mBlockAlign >= 0 && totalsize + (mIndex % mBlockAlign) > mBlockSize) + if (mBlockAlign > 0 && totalsize + (mIndex % mBlockAlign) > mBlockSize) { mIndex = ((mIndex + mBlockAlign) / mBlockAlign) * mBlockAlign; @@ -172,7 +172,7 @@ int FLightBuffer::UploadLights(FDynLightData &data) if (mBufferPointer == NULL) return -1; copyptr = mBufferPointer + mIndex * 4; - float parmcnt[] = { 0, size0, size0 + size1, size0 + size1 + size2 }; + float parmcnt[] = { 0, float(size0), float(size0 + size1), float(size0 + size1 + size2) }; memcpy(©ptr[0], parmcnt, 4 * sizeof(float)); memcpy(©ptr[4], &data.arrays[0][0], 4 * size0*sizeof(float)); diff --git a/src/gl/scene/gl_drawinfo.h b/src/gl/scene/gl_drawinfo.h index 67ed2099cc..4e86073d84 100644 --- a/src/gl/scene/gl_drawinfo.h +++ b/src/gl/scene/gl_drawinfo.h @@ -8,7 +8,6 @@ enum GLDrawItemType GLDIT_WALL, GLDIT_FLAT, GLDIT_SPRITE, - GLDIT_POLY, }; enum DrawListType