From 7b26645c1b28b212c011f98a5420c0989a7f0adc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 15 Apr 2013 20:54:59 +0300 Subject: improve imagehelper class. --- src/resources/openglimagehelper.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/resources/openglimagehelper.h') diff --git a/src/resources/openglimagehelper.h b/src/resources/openglimagehelper.h index 1c1f398eb..5c144809a 100644 --- a/src/resources/openglimagehelper.h +++ b/src/resources/openglimagehelper.h @@ -78,16 +78,18 @@ class OpenGLImageHelper final : public ImageHelper * @return NULL if an error occurred, a valid pointer * otherwise. */ - Image *load(SDL_RWops *const rw, Dye const &dye) A_WARN_UNUSED; + Image *load(SDL_RWops *const rw, + Dye const &dye) const override A_WARN_UNUSED; /** * Loads an image from an SDL surface. */ - Image *load(SDL_Surface *const tmpImage) A_WARN_UNUSED; + Image *load(SDL_Surface *const tmpImage) const override A_WARN_UNUSED; Image *createTextSurface(SDL_Surface *const tmpImage, - int width, int height, - const float alpha) A_WARN_UNUSED; + const int width, const int height, + const float alpha) + const override A_WARN_UNUSED; // OpenGL only public functions @@ -95,7 +97,7 @@ class OpenGLImageHelper final : public ImageHelper * Sets the target image format. Use false for SDL and * true for OpenGL. */ - static void setLoadAsOpenGL(int useOpenGL); + static void setLoadAsOpenGL(const int useOpenGL); static int getTextureType() A_WARN_UNUSED { return mTextureType; } @@ -117,26 +119,26 @@ class OpenGLImageHelper final : public ImageHelper * Tells if the image was loaded using OpenGL or SDL * @return true if OpenGL, false if SDL. */ - int useOpenGL() A_WARN_UNUSED; + int useOpenGL() const override A_WARN_UNUSED; static int getTextureSize() A_WARN_UNUSED { return mTextureSize; } - static void initTextureSampler(GLint id); + static void initTextureSampler(const GLint id); - static void setUseTextureSampler(bool b) + static void setUseTextureSampler(const bool b) { mUseTextureSampler = b; } - SDL_Surface *create32BitSurface(int width, int height); + SDL_Surface *create32BitSurface(int width, int height) const override; protected: /** * Returns the first power of two equal or bigger than the input. */ - int powerOfTwo(int input) const A_WARN_UNUSED; + int powerOfTwo(const int input) const A_WARN_UNUSED; Image *glLoad(SDL_Surface *tmpImage, - int width = 0, int height = 0) A_WARN_UNUSED; + int width = 0, int height = 0) const A_WARN_UNUSED; static int mUseOpenGL; static int mTextureSize; -- cgit v1.2.3-60-g2f50