From 0534847df83047f1ce2605187d45a762ffeae11e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 2 Sep 2012 21:25:21 +0300 Subject: Add const to more classes. --- src/resources/image.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/resources/image.h') diff --git a/src/resources/image.h b/src/resources/image.h index 4798c87af..2ba7890ab 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -96,7 +96,7 @@ class Image : public Resource * Tells if the image has got an alpha channel * @return true if it's true, false otherwise. */ - bool hasAlphaChannel(); + bool hasAlphaChannel() const; /** * Sets the alpha value of this image. @@ -115,7 +115,8 @@ class Image : public Resource * @return NULL if creation failed and a valid * object otherwise. */ - virtual Image *getSubImage(int x, int y, int width, int height); + virtual Image *getSubImage(const int x, const int y, + const int width, const int height); // SDL only public functions @@ -156,13 +157,13 @@ class Image : public Resource bool isAlphaVisible() const { return mIsAlphaVisible; } - void setAlphaVisible(bool b) + void setAlphaVisible(const bool b) { mIsAlphaVisible = b; } bool isAlphaCalculated() const { return mIsAlphaCalculated; } - void setAlphaCalculated(bool b) + void setAlphaCalculated(const bool b) { mIsAlphaCalculated = b; } SDL_Rect mBounds; @@ -182,10 +183,10 @@ class Image : public Resource // ----------------------- /** SDL Constructor */ - Image(SDL_Surface *image, bool hasAlphaChannel = false, - uint8_t *alphaChannel = nullptr); + Image(SDL_Surface *const image, const bool hasAlphaChannel = false, + uint8_t *const alphaChannel = nullptr); - SDL_Surface *getByAlpha(float alpha); + SDL_Surface *getByAlpha(const float alpha); SDL_Surface *mSDLSurface; @@ -205,8 +206,8 @@ class Image : public Resource /** * OpenGL Constructor. */ - Image(GLuint glimage, int width, int height, - int texWidth, int texHeight); + Image(const GLuint glimage, const int width, const int height, + const int texWidth, const int texHeight); GLuint mGLImage; int mTexWidth, mTexHeight; -- cgit v1.2.3-70-g09d2