summaryrefslogtreecommitdiff
path: root/src/resources/image/image.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-12-31 05:04:16 +0300
committerAndrei Karas <akaras@inbox.ru>2016-12-31 17:30:48 +0300
commit537085e221d25f710ed7162e1fc8add8ffe4a72f (patch)
treed1abf9cdb898005099eb741a1f6ed79417b331fb /src/resources/image/image.cpp
parent496e74aa95984380e4a36fe8d55d0839002d6f8f (diff)
downloadmanaverse-537085e221d25f710ed7162e1fc8add8ffe4a72f.tar.gz
manaverse-537085e221d25f710ed7162e1fc8add8ffe4a72f.tar.bz2
manaverse-537085e221d25f710ed7162e1fc8add8ffe4a72f.tar.xz
manaverse-537085e221d25f710ed7162e1fc8add8ffe4a72f.zip
Improve fringe map layers drawing.
Pre cache next tile position with image.
Diffstat (limited to 'src/resources/image/image.cpp')
-rw-r--r--src/resources/image/image.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/resources/image/image.cpp b/src/resources/image/image.cpp
index 379a1c074..a3bb1b0ce 100644
--- a/src/resources/image/image.cpp
+++ b/src/resources/image/image.cpp
@@ -45,6 +45,36 @@
#include "debug.h"
+#ifdef UNITTESTS
+Image::Image(const int width,
+ const int height) :
+ Resource(),
+#ifdef USE_OPENGL
+ mGLImage(0),
+ mTexWidth(0),
+ mTexHeight(0),
+#endif // USE_OPENGL
+ mBounds(),
+ mAlpha(1.0F),
+ mSDLSurface(nullptr),
+#ifdef USE_SDL2
+ mTexture(nullptr),
+#endif // USE_SDL2
+ mAlphaChannel(nullptr),
+ mAlphaCache(),
+ mLoaded(false),
+ mHasAlphaChannel(false),
+ mUseAlphaCache(false),
+ mIsAlphaVisible(true),
+ mIsAlphaCalculated(false)
+{
+ mBounds.x = 0;
+ mBounds.y = 0;
+ mBounds.w = width;
+ mBounds.h = height;
+}
+#endif // UNITTESTS
+
#ifdef USE_SDL2
Image::Image(SDL_Texture *restrict const image,
const int width, const int height) :