diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-30 23:11:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-30 23:11:20 +0300 |
commit | b85fd67fb14f6a49c7e71f2265254150ba7a1240 (patch) | |
tree | ba4b7d4eb86b84753580885d067783d6bb4b1968 /src | |
parent | 080291d23a1a28cf7c5e3e01eb4ecb1637a1b42b (diff) | |
download | manaverse-b85fd67fb14f6a49c7e71f2265254150ba7a1240.tar.gz manaverse-b85fd67fb14f6a49c7e71f2265254150ba7a1240.tar.bz2 manaverse-b85fd67fb14f6a49c7e71f2265254150ba7a1240.tar.xz manaverse-b85fd67fb14f6a49c7e71f2265254150ba7a1240.zip |
add drawImageInline into renders for internal usage.
Diffstat (limited to 'src')
-rw-r--r-- | src/render/graphics_drawImageRect.hpp | 8 | ||||
-rw-r--r-- | src/render/mobileopenglgraphics.cpp | 9 | ||||
-rw-r--r-- | src/render/mobileopenglgraphics.h | 3 | ||||
-rw-r--r-- | src/render/normalopenglgraphics.cpp | 9 | ||||
-rw-r--r-- | src/render/normalopenglgraphics.h | 3 | ||||
-rw-r--r-- | src/render/nullopenglgraphics.cpp | 9 | ||||
-rw-r--r-- | src/render/nullopenglgraphics.h | 3 | ||||
-rw-r--r-- | src/render/safeopenglgraphics.cpp | 9 | ||||
-rw-r--r-- | src/render/safeopenglgraphics.h | 3 | ||||
-rw-r--r-- | src/render/sdl2graphics.cpp | 6 | ||||
-rw-r--r-- | src/render/sdl2graphics.h | 3 | ||||
-rw-r--r-- | src/render/sdl2softwaregraphics.cpp | 6 | ||||
-rw-r--r-- | src/render/sdl2softwaregraphics.h | 3 | ||||
-rw-r--r-- | src/render/sdlgraphics.cpp | 6 | ||||
-rw-r--r-- | src/render/sdlgraphics.h | 2 |
15 files changed, 70 insertions, 12 deletions
diff --git a/src/render/graphics_drawImageRect.hpp b/src/render/graphics_drawImageRect.hpp index 5c4bba0a1..28157fafd 100644 --- a/src/render/graphics_drawImageRect.hpp +++ b/src/render/graphics_drawImageRect.hpp @@ -67,15 +67,15 @@ if (top && left && bottom && right) // Draw the corners if (drawMain) { - drawImage2(topLeft, x, y); + drawImageInline(topLeft, x, y); const int trw = topRight->getWidth(); if (w > trw) - drawImage2(topRight, x + w - trw, y); - drawImage2(bottomLeft, x, h - bottomLeft->getHeight() + y); + drawImageInline(topRight, x + w - trw, y); + drawImageInline(bottomLeft, x, h - bottomLeft->getHeight() + y); const int brw = bottomRight->getWidth(); if (w > brw) { - drawImage2(bottomRight, + drawImageInline(bottomRight, x + w - brw, y + h - bottomRight->getHeight()); } diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 2a2d5f98b..0c486a04d 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -216,10 +216,15 @@ static inline void drawRescaledQuad(const Image *const image, } } - bool MobileOpenGLGraphics::drawImage2(const Image *const image, int dstX, int dstY) { + return drawImageInline(image, dstX, dstY); +} + +bool MobileOpenGLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) +{ FUNC_BLOCK("Graphics::drawImage2", 1) if (!image) return false; @@ -383,7 +388,7 @@ bool MobileOpenGLGraphics::drawRescaledImage(const Image *const image, // Just draw the image normally when no resizing is necessary, if (imageRect.w == desiredWidth && imageRect.h == desiredHeight) - return drawImage2(image, dstX, dstY); + return drawImageInline(image, dstX, dstY); setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE diff --git a/src/render/mobileopenglgraphics.h b/src/render/mobileopenglgraphics.h index bdf366c22..c59033602 100644 --- a/src/render/mobileopenglgraphics.h +++ b/src/render/mobileopenglgraphics.h @@ -115,6 +115,9 @@ class MobileOpenGLGraphics final : public Graphics const Image *const image, int x, int y) const; + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); + GLfloat *mFloatTexArray; GLshort *mShortVertArray; GLfloat *mFloatTexArrayCached; diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index 0ab2e88fa..7df3313fd 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -283,10 +283,15 @@ static inline void drawRescaledQuad(const Image *const image, } } - bool NormalOpenGLGraphics::drawImage2(const Image *const image, int dstX, int dstY) { + return drawImageInline(image, dstX, dstY); +} + +bool NormalOpenGLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) +{ FUNC_BLOCK("Graphics::drawImage2", 1) if (!image) return false; @@ -497,7 +502,7 @@ bool NormalOpenGLGraphics::drawRescaledImage(const Image *const image, // Just draw the image normally when no resizing is necessary, if (imageRect.w == desiredWidth && imageRect.h == desiredHeight) - return drawImage2(image, dstX, dstY); + return drawImageInline(image, dstX, dstY); setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE diff --git a/src/render/normalopenglgraphics.h b/src/render/normalopenglgraphics.h index 2cb0a7397..c570f8c50 100644 --- a/src/render/normalopenglgraphics.h +++ b/src/render/normalopenglgraphics.h @@ -129,6 +129,9 @@ class NormalOpenGLGraphics final : public Graphics const Image *const image, int x, int y) const; + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); + GLfloat *mFloatTexArray; GLint *mIntTexArray; GLint *mIntVertArray; diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index d372aa7dc..11f2035d6 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -136,10 +136,15 @@ static inline void drawRescaledQuad(const Image *const image A_UNUSED, } } - bool NullOpenGLGraphics::drawImage2(const Image *const image, int dstX, int dstY) { + return drawImageInline(image, dstX, dstY); +} + +bool NullOpenGLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) +{ FUNC_BLOCK("Graphics::drawImage2", 1) if (!image) return false; @@ -188,7 +193,7 @@ bool NullOpenGLGraphics::drawRescaledImage(const Image *const image, // Just draw the image normally when no resizing is necessary, if (imageRect.w == desiredWidth && imageRect.h == desiredHeight) - return drawImage2(image, dstX, dstY); + return drawImageInline(image, dstX, dstY); setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE diff --git a/src/render/nullopenglgraphics.h b/src/render/nullopenglgraphics.h index 1335bea3a..d14073e26 100644 --- a/src/render/nullopenglgraphics.h +++ b/src/render/nullopenglgraphics.h @@ -121,6 +121,9 @@ class NullOpenGLGraphics final : public Graphics const Image *const image, int x, int y) const; + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); + GLfloat *mFloatTexArray; GLint *mIntTexArray; GLint *mIntVertArray; diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index e4ae7792e..717e7d5bf 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -138,10 +138,15 @@ static inline void drawRescaledQuad(const Image *const image, } } - bool SafeOpenGLGraphics::drawImage2(const Image *const image, int dstX, int dstY) { + return drawImageInline(image, dstX, dstY); +} + +bool SafeOpenGLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) +{ FUNC_BLOCK("Graphics::drawImage2", 1) if (!image) return false; @@ -234,7 +239,7 @@ bool SafeOpenGLGraphics::drawRescaledImage(const Image *const image, // Just draw the image normally when no resizing is necessary, if (imageRect.w == desiredWidth && imageRect.h == desiredHeight) - return drawImage2(image, dstX, dstY); + return drawImageInline(image, dstX, dstY); setColorAlpha(image->mAlpha); bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); diff --git a/src/render/safeopenglgraphics.h b/src/render/safeopenglgraphics.h index 4541a8457..36ce27ded 100644 --- a/src/render/safeopenglgraphics.h +++ b/src/render/safeopenglgraphics.h @@ -81,6 +81,9 @@ class SafeOpenGLGraphics final : public Graphics const Image *const image, int x, int y) const; + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); + bool mTexture; bool mIsByteColor; gcn::Color mByteColor; diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index 7c343ea09..92dfc3309 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -116,6 +116,12 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, bool SDLGraphics::drawImage2(const Image *const image, int dstX, int dstY) { + return drawImageInline(image, dstX, dstY); +} + +bool SDLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) +{ FUNC_BLOCK("Graphics::drawImage2", 1) // Check that preconditions for blitting are met. if (!mWindow || !image || !image->mTexture) diff --git a/src/render/sdl2graphics.h b/src/render/sdl2graphics.h index 378997738..15e8f04c5 100644 --- a/src/render/sdl2graphics.h +++ b/src/render/sdl2graphics.h @@ -176,6 +176,9 @@ class SDLGraphics final : public Graphics void inline calcTileVertexesInline(ImageVertexes *const vert, const Image *const image, int x, int y) const; + + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); }; #endif // USE_SDL2 diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index 03f6c2e41..daaa75387 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -111,6 +111,12 @@ bool SDL2SoftwareGraphics::drawRescaledImage(const Image *const image, bool SDL2SoftwareGraphics::drawImage2(const Image *const image, int dstX, int dstY) { + return drawImageInline(image, dstX, dstY); +} + +bool SDL2SoftwareGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) +{ FUNC_BLOCK("Graphics::drawImage2", 1) // Check that preconditions for blitting are met. if (!mSurface || !image || !image->mSDLSurface) diff --git a/src/render/sdl2softwaregraphics.h b/src/render/sdl2softwaregraphics.h index 231cd1a48..35c50a13e 100644 --- a/src/render/sdl2softwaregraphics.h +++ b/src/render/sdl2softwaregraphics.h @@ -188,6 +188,9 @@ class SDL2SoftwareGraphics final : public Graphics void inline calcTileVertexesInline(ImageVertexes *const vert, const Image *const image, int x, int y) const; + + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); }; #endif // USE_SDL2 diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 7bd6b82e0..37d26689e 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -104,6 +104,12 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, bool SDLGraphics::drawImage2(const Image *const image, int dstX, int dstY) { + drawImageInline(image, dstX, dstY); +} + +bool SDLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) +{ FUNC_BLOCK("Graphics::drawImage2", 1) // Check that preconditions for blitting are met. if (!mWindow || !image || !image->mSDLSurface) diff --git a/src/render/sdlgraphics.h b/src/render/sdlgraphics.h index 30cc3c876..6088da8a7 100644 --- a/src/render/sdlgraphics.h +++ b/src/render/sdlgraphics.h @@ -181,6 +181,8 @@ class SDLGraphics final : public Graphics void inline calcTileVertexesInline(ImageVertexes *const vert, const Image *const image, int x, int y) const; + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); }; #endif // USE_SDL2 |