Commit 5209b760 authored by Robert Menzel's avatar Robert Menzel
Browse files

fixed some warnings

parent ce04d9bc
......@@ -32,7 +32,7 @@ public:
mType(GL_UNSIGNED_BYTE),
mMinFilter(0),
mMagFilter(0),
mAnisotropicFilter(0.0),
mAnisotropicFilter(0.0f),
mWrapS(0),
mWrapT(0),
mWrapR(0)
......@@ -43,8 +43,8 @@ public:
// ============================================================================================ METHODS \/
// ==================================================================================================== \/
public:
inline TextureControl& size ( const glm::vec2 &_size ) { return size(_size.x, _size.y); }
inline TextureControl& size ( const glm::vec3 &_size ) { return size(_size.x, _size.y, _size.z); }
inline TextureControl& size ( const glm::ivec2 &_size ) { return size(_size.x, _size.y); }
inline TextureControl& size ( const glm::ivec3 &_size ) { return size(_size.x, _size.y, _size.z); }
inline TextureControl& size (GLsizei _width, GLsizei _height = 0, GLsizei _depth = 0)
{
......@@ -68,7 +68,7 @@ public:
inline TextureControl& type (GLenum type) { mType = type; return *this; }
inline TextureControl& minFilter (GLint _minFilter) { mMinFilter = _minFilter; return *this; }
inline TextureControl& magFilter (GLint _magFilter) { mMagFilter = _magFilter; return *this; }
inline TextureControl& anisotropicFilter (GLint _anisotropicFilter) { mAnisotropicFilter = _anisotropicFilter; return *this; }
inline TextureControl& anisotropicFilter (GLfloat _anisotropicFilter) { mAnisotropicFilter = _anisotropicFilter; return *this; }
// ===================================================================================================== \/
// ============================================================================================ OVERRIDE \/
......@@ -78,10 +78,10 @@ public:
{
SharedTexture texture(new Texture(mTarget));
texture->bind();
if(mMinFilter > 0) texture->setMinFilter(mMinFilter);
if(mMagFilter > 0) texture->setMagFilter(mMagFilter);
if(mWrapS > 0) texture->setWrap(mWrapS, mWrapT, mWrapR);
if(mAnisotropicFilter > 0.0) texture->setAnisotropicFilter(mAnisotropicFilter);
if(mMinFilter > 0) texture->setMinFilter(mMinFilter);
if(mMagFilter > 0) texture->setMagFilter(mMagFilter);
if(mWrapS > 0) texture->setWrap(mWrapS, mWrapT, mWrapR);
if(mAnisotropicFilter > 0.0f) texture->setAnisotropicFilter(mAnisotropicFilter);
texture->setImageData(
NULL,
mWidth,
......
......@@ -36,7 +36,7 @@ public:
mType(GL_UNSIGNED_BYTE),
mMinFilter(GL_LINEAR),
mMagFilter(GL_LINEAR),
mAnisotropicFilter(0.0),
mAnisotropicFilter(0.0f),
mWrapS(GL_CLAMP_TO_EDGE),
mWrapT(GL_CLAMP_TO_EDGE),
mWrapR(GL_CLAMP_TO_EDGE)
......
......@@ -30,7 +30,7 @@ public:
mDataController(new CONTROLLER(_fileController)),
mMinFilter(0),
mMagFilter(0),
mAnisotropicFilter(0.0),
mAnisotropicFilter(0.0f),
mWrapS(0),
mWrapT(0),
mWrapR(0)
......
......@@ -26,7 +26,7 @@ public:
: Resource::FileController<Texture>(_filename, Base::Settings::the()->getFullTexturePath()),
mMinFilter(0),
mMagFilter(0),
mAnisotropicFilter(0.0),
mAnisotropicFilter(0.0f),
mWrapS(0),
mWrapT(0),
mWrapR(0)
......
......@@ -111,7 +111,7 @@ public:
public:
//! elements is the number of vertices (unless this AB should get interpreted in a strange way):
inline GLsizei getElements (void) const { return mSize/mStride; }
inline GLsizei getElements (void) const { return (GLsizei) (mSize/mStride); }
//! size in bytes of all attributes that make up one element (vertex):
inline GLsizei getStride (void) const { return mStride; }
......@@ -139,7 +139,7 @@ public:
void defineAttribute( const Attribute &_attribute );
//! Returns the index of a named attribute
int_t getAttributeIndexByName(const std::string& _nameInArray) const;
int32_t getAttributeIndexByName(const std::string& _nameInArray) const;
//! Setting of the stride size explicitly is not needed if the attributes are defined correctly (with padding)
inline void setStride( GLsizei _stride ) { mStride = _stride; }
......
......@@ -61,7 +61,7 @@ public:
//! Returns the number of indices:
GLuint getElements() {
return getSize() / getGLTypeSize(mType);
return (GLuint)( getSize() / getGLTypeSize(mType));
}
//! Overloaded from the base class to _prevent_ redefining of the binding target! (see Buffer)
......
......@@ -79,7 +79,7 @@ public:
mDepthAttachment.texture = ConstSharedTexture();
mDepthAttachment.renderBuffer = ConstSharedRenderBuffer();
mDepthAttachment.name = ""; // not useful here
mDepthAttachment.location = -1; // not useful here
mDepthAttachment.location = 0; // not useful here
}
virtual ~FrameBufferObject(void)
......@@ -123,13 +123,13 @@ public:
*/
inline bool attachColorRenderBuffer(const std::string &_name, const ConstSharedRenderBuffer& _renderBuffer)
{
Attachment a = {_name, SharedTexture(), _renderBuffer, mColorAttachments.size()};
Attachment a = {_name, SharedTexture(), _renderBuffer, (GLuint) mColorAttachments.size()};
return attachColorAttachment( a );
}
inline bool attachColorTexture(const std::string &_name, const ConstSharedTexture& _texture)
{
Attachment a = {_name, _texture, SharedRenderBuffer(), mColorAttachments.size()};
Attachment a = {_name, _texture, SharedRenderBuffer(), (GLuint) mColorAttachments.size()};
return attachColorAttachment( a );
}
......
......@@ -191,7 +191,7 @@ public:
ArrayBuffer::AttributeVec attributes = _arrayBuffer->getAttributes();
for(ArrayBuffer::AttributeVec::size_type i = 0; i < attributes.size(); ++i)
{
attachAttribute(_arrayBuffer, i);
attachAttribute(_arrayBuffer, (GLint) i);
}
}
......
......@@ -46,8 +46,8 @@ namespace FileHelpers
bool stringEndsWith( const std::string &theString, const std::string &theEnding )
{
int32_t stringLenght = theString.size();
int32_t endingLenght = theEnding.size();
int32_t stringLenght = (int32_t) theString.size();
int32_t endingLenght = (int32_t) theEnding.size();
if ( stringLenght < endingLenght ) return false;
......
......@@ -16,7 +16,7 @@ SharedTexture TextureControlCubeMap::create(void)
texture->setMagFilter(mMagFilter);
texture->setWrap(mWrapS, mWrapT, mWrapR);
if(mAnisotropicFilter > 0.0) texture->setAnisotropicFilter(mAnisotropicFilter);
if(mAnisotropicFilter > 0.0f) texture->setAnisotropicFilter(mAnisotropicFilter);
texture->setCubeMapFormat(
mSize,
......
......@@ -13,7 +13,7 @@ TextureControlFile::TextureControlFile(const std::string& _filename)
mDataController(TextureDataControlFileFactory::the()->create(_filename)),
mMinFilter(0),
mMagFilter(0),
mAnisotropicFilter(0.0),
mAnisotropicFilter(0.0f),
mWrapS(0),
mWrapT(0),
mWrapR(0)
......@@ -27,7 +27,7 @@ TextureControlFile::TextureControlFile(const char* _filename)
mDataController(TextureDataControlFileFactory::the()->create(std::string(_filename))),
mMinFilter(0),
mMagFilter(0),
mAnisotropicFilter(0.0),
mAnisotropicFilter(0.0f),
mWrapS(0),
mWrapT(0),
mWrapR(0)
......@@ -69,7 +69,7 @@ SharedTexture TextureControlFile::create(void)
texture->setMagFilter(mMagFilter == 0 ? GL_LINEAR : mMagFilter);
if(mWrapS > 0) texture->setWrap(mWrapS, mWrapT, mWrapR);
if(mAnisotropicFilter > 0.0)
if(mAnisotropicFilter > 0.0f)
texture->setAnisotropicFilter(mAnisotropicFilter);
if(!load(texture))
......
......@@ -18,7 +18,7 @@ SharedTexture TextureControlFileJPG::create(void)
texture->setMagFilter(mMagFilter == 0 ? GL_LINEAR : mMagFilter);
if(mWrapS > 0) texture->setWrap(mWrapS, mWrapT, mWrapR);
if(mAnisotropicFilter > 0.0)
if(mAnisotropicFilter > 0.0f)
texture->setAnisotropicFilter(mAnisotropicFilter);
if(loadJPG(texture))
......
......@@ -53,10 +53,10 @@ void ArrayBuffer::defineAttribute( const Attribute &_attribute )
mAttributes.push_back( _attribute );
}
int_t ArrayBuffer::getAttributeIndexByName(const std::string& _nameInArray) const
int32_t ArrayBuffer::getAttributeIndexByName(const std::string& _nameInArray) const
{
for(AttributeVec::size_type i = 0; i < mAttributes.size(); ++i)
if(mAttributes[i].name == _nameInArray)
return i;
return (int32_t) i;
return -1;
}
......@@ -13,7 +13,7 @@ int_t FrameBufferObject::getColorAttachmentIndexByName(const std::string& _name)
for(AttachmentVec::size_type i = 0; i < mColorAttachments.size(); i++)
{
if(mColorAttachments[i].name == _name)
return i;
return (int_t) i;
}
return -1;
......@@ -95,7 +95,7 @@ bool FrameBufferObject::attachColorAttachment( const Attachment &_attachment )
}
if (realLocation == -1) {
// it's a new attachment
realLocation = mColorAttachments.size();
realLocation = (int) mColorAttachments.size();
mColorAttachments.push_back(_attachment);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment