summaryrefslogtreecommitdiff
path: root/src/resources/image.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-09 09:47:21 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-02-13 12:57:16 +0100
commitc70be70cab3615cb36cc5f244671cf5d39f1fda8 (patch)
treeb15e68552ffd6adda832a9ae5d38160ef8299d7f /src/resources/image.h
parent717eb07c0d51098e319059883b11ba6e2bf4cbb8 (diff)
downloadMana-c70be70cab3615cb36cc5f244671cf5d39f1fda8.tar.gz
Mana-c70be70cab3615cb36cc5f244671cf5d39f1fda8.tar.bz2
Mana-c70be70cab3615cb36cc5f244671cf5d39f1fda8.tar.xz
Mana-c70be70cab3615cb36cc5f244671cf5d39f1fda8.zip
General code cleanups
* Removing unused includes * Use member initialization * Use range-based for loops * Use nullptr * Removed no longer used aliases * Use override * Don't use else after return * Use '= delete' to remove implicit members * Use std::string::empty instead of comparing to ""
Diffstat (limited to 'src/resources/image.h')
-rw-r--r--src/resources/image.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/resources/image.h b/src/resources/image.h
index 66c3ff78..662c0393 100644
--- a/src/resources/image.h
+++ b/src/resources/image.h
@@ -38,7 +38,6 @@
#endif
class Dye;
-class Position;
/**
* Defines a class for loading and storing images.
@@ -87,7 +86,7 @@ class Image : public Resource
/**
* Tells is the image is loaded
*/
- bool isLoaded()
+ bool isLoaded() const
{ return mLoaded; }
/**
@@ -164,8 +163,8 @@ class Image : public Resource
// -----------------------
SDL_Rect mBounds;
- bool mLoaded;
- float mAlpha;
+ bool mLoaded = false;
+ float mAlpha = 1.0f;
// -----------------------
// SDL protected members
@@ -177,7 +176,7 @@ class Image : public Resource
/** SDL_Surface to SDL_Texture Image loader */
static Image *_SDLload(SDL_Surface *tmpImage);
- SDL_Texture *mTexture;
+ SDL_Texture *mTexture = nullptr;
/** Stores whether the transparency is disabled */
static bool mDisableTransparency;
@@ -201,7 +200,7 @@ class Image : public Resource
static Image *_GLload(SDL_Surface *image);
- GLuint mGLImage;
+ GLuint mGLImage = 0;
int mTexWidth, mTexHeight;
static bool mUseOpenGL;