From b85fd67fb14f6a49c7e71f2265254150ba7a1240 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 30 Dec 2013 23:11:20 +0300 Subject: add drawImageInline into renders for internal usage. --- src/render/graphics_drawImageRect.hpp | 8 ++++---- src/render/mobileopenglgraphics.cpp | 9 +++++++-- src/render/mobileopenglgraphics.h | 3 +++ src/render/normalopenglgraphics.cpp | 9 +++++++-- src/render/normalopenglgraphics.h | 3 +++ src/render/nullopenglgraphics.cpp | 9 +++++++-- src/render/nullopenglgraphics.h | 3 +++ src/render/safeopenglgraphics.cpp | 9 +++++++-- src/render/safeopenglgraphics.h | 3 +++ src/render/sdl2graphics.cpp | 6 ++++++ src/render/sdl2graphics.h | 3 +++ src/render/sdl2softwaregraphics.cpp | 6 ++++++ src/render/sdl2softwaregraphics.h | 3 +++ src/render/sdlgraphics.cpp | 6 ++++++ src/render/sdlgraphics.h | 2 ++ 15 files changed, 70 insertions(+), 12 deletions(-) (limited to 'src/render') 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,9 +216,14 @@ 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) @@ -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,9 +283,14 @@ 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) @@ -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,9 +136,14 @@ 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) @@ -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,9 +138,14 @@ 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) @@ -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 @@ -115,6 +115,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. 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 @@ -110,6 +110,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. 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 @@ -103,6 +103,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. 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 -- cgit v1.2.3-60-g2f50