diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-30 18:45:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-30 18:45:00 +0300 |
commit | e29a87a240fe2f33c51f4e15067122960f667d66 (patch) | |
tree | ec58d6c28e3ce18966b32495df860bc85aa94f87 | |
parent | 00d8cfee5bc76c59e5c3195f4434c4a4fb741d0e (diff) | |
download | manaverse-e29a87a240fe2f33c51f4e15067122960f667d66.tar.gz manaverse-e29a87a240fe2f33c51f4e15067122960f667d66.tar.bz2 manaverse-e29a87a240fe2f33c51f4e15067122960f667d66.tar.xz manaverse-e29a87a240fe2f33c51f4e15067122960f667d66.zip |
add drawPatternInline into renders for internal usage.
-rw-r--r-- | src/render/mobileopenglgraphics.cpp | 7 | ||||
-rw-r--r-- | src/render/normalopenglgraphics.cpp | 7 | ||||
-rw-r--r-- | src/render/nullopenglgraphics.cpp | 7 | ||||
-rw-r--r-- | src/render/openglgraphics_drawImageRect.hpp | 10 | ||||
-rw-r--r-- | src/render/openglgraphicsdef.hpp | 4 | ||||
-rw-r--r-- | src/render/safeopenglgraphics.cpp | 9 | ||||
-rw-r--r-- | src/render/sdl2graphics.cpp | 7 | ||||
-rw-r--r-- | src/render/sdl2graphics.h | 4 | ||||
-rw-r--r-- | src/render/sdl2softwaregraphics.cpp | 7 | ||||
-rw-r--r-- | src/render/sdl2softwaregraphics.h | 4 | ||||
-rw-r--r-- | src/render/sdlgraphics.cpp | 7 | ||||
-rw-r--r-- | src/render/sdlgraphics.h | 4 |
12 files changed, 70 insertions, 7 deletions
diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 33adf6e92..d716582ef 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -403,6 +403,13 @@ void MobileOpenGLGraphics::drawPattern(const Image *const image, const int x, const int y, const int w, const int h) { + drawPatternInline(image, x, y, w, h); +} + +void MobileOpenGLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) return; diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index 2088214c0..6626564eb 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -517,6 +517,13 @@ void NormalOpenGLGraphics::drawPattern(const Image *const image, const int x, const int y, const int w, const int h) { + drawPatternInline(image, x, y, w, h); +} + +void NormalOpenGLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) return; diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index aa5a5861b..3883d7134 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -208,6 +208,13 @@ void NullOpenGLGraphics::drawPattern(const Image *const image, const int x, const int y, const int w, const int h) { + drawPatternInline(image, x, y, w, h); +} + +void NullOpenGLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) return; diff --git a/src/render/openglgraphics_drawImageRect.hpp b/src/render/openglgraphics_drawImageRect.hpp index 734bc8b83..5c4bba0a1 100644 --- a/src/render/openglgraphics_drawImageRect.hpp +++ b/src/render/openglgraphics_drawImageRect.hpp @@ -46,7 +46,7 @@ if (center && drawMain) { const int tlw = topLeft->getWidth(); const int tlh = topLeft->getHeight(); - drawPattern(center, tlw + x, tlh + y, + drawPatternInline(center, tlw + x, tlh + y, w - tlw - topRight->getWidth(), h - tlh - bottomLeft->getHeight()); } @@ -58,11 +58,11 @@ if (top && left && bottom && right) const int rw = right->getWidth(); const int th = top->getHeight(); const int bh = bottom->getHeight(); - drawPattern(top, x + lw, y, w - lw - rw, th); - drawPattern(bottom, x + lw, h - bh + y, w - lw - rw, bh); - drawPattern(left, x, y + th, lw, h - th - bh); + drawPatternInline(top, x + lw, y, w - lw - rw, th); + drawPatternInline(bottom, x + lw, h - bh + y, w - lw - rw, bh); + drawPatternInline(left, x, y + th, lw, h - th - bh); if (w > rw) - drawPattern(right, x + w - rw, th + y, rw, h - th - bh); + drawPatternInline(right, x + w - rw, th + y, rw, h - th - bh); } // Draw the corners if (drawMain) diff --git a/src/render/openglgraphicsdef.hpp b/src/render/openglgraphicsdef.hpp index 70789f023..f935f9062 100644 --- a/src/render/openglgraphicsdef.hpp +++ b/src/render/openglgraphicsdef.hpp @@ -36,6 +36,10 @@ const int desiredWidth, const int desiredHeight) override final; + void inline drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h); + void drawPattern(const Image *const image, const int x, const int y, const int w, const int h) override final; diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index b2e7cd3c0..41d9b7f77 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -249,12 +249,17 @@ bool SafeOpenGLGraphics::drawRescaledImage(const Image *const image, return true; } -/* Optimising the functions that Graphics::drawPattern would call, - * so that glBegin...glEnd are outside the main loop. */ void SafeOpenGLGraphics::drawPattern(const Image *const image, const int x, const int y, const int w, const int h) { + drawPatternInline(image, x, y, w, h); +} + +void SafeOpenGLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) return; diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index dbfe7ed1e..a91548416 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -232,6 +232,13 @@ void SDLGraphics::drawPattern(const Image *const image, const int x, const int y, const int w, const int h) { + drawParrernInline(image, x, y, w, h); +} + +void SDLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ FUNC_BLOCK("Graphics::drawPattern", 1) // Check that preconditions for blitting are met. if (!mWindow || !image) diff --git a/src/render/sdl2graphics.h b/src/render/sdl2graphics.h index 91e789640..25a3a74b3 100644 --- a/src/render/sdl2graphics.h +++ b/src/render/sdl2graphics.h @@ -71,6 +71,10 @@ class SDLGraphics final : public Graphics const int x, const int y, const int w, const int h) override final; + void inline drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h); + void drawRescaledPattern(const Image *const image, const int x, const int y, const int w, const int h, diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index fbd6e670b..cbcc5f1cb 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -401,6 +401,13 @@ void SDL2SoftwareGraphics::drawPattern(const Image *const image, const int x, const int y, const int w, const int h) { + drawPatternInline(image, x, y, w, h); +} + +void SDL2SoftwareGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ FUNC_BLOCK("Graphics::drawPattern", 1) // Check that preconditions for blitting are met. if (!mSurface || !image) diff --git a/src/render/sdl2softwaregraphics.h b/src/render/sdl2softwaregraphics.h index 441167d01..f6f92a065 100644 --- a/src/render/sdl2softwaregraphics.h +++ b/src/render/sdl2softwaregraphics.h @@ -71,6 +71,10 @@ class SDL2SoftwareGraphics final : public Graphics const int x, const int y, const int w, const int h) override final; + void inline drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h); + void drawRescaledPattern(const Image *const image, const int x, const int y, const int w, const int h, diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 2860f871c..2f13f53f0 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -394,6 +394,13 @@ void SDLGraphics::drawPattern(const Image *const image, const int x, const int y, const int w, const int h) { + drawPatternInline(image, x, y, w, h); +} + +void SDLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ FUNC_BLOCK("Graphics::drawPattern", 1) // Check that preconditions for blitting are met. if (!mWindow || !image) diff --git a/src/render/sdlgraphics.h b/src/render/sdlgraphics.h index 1b447c4a4..6fb1fd337 100644 --- a/src/render/sdlgraphics.h +++ b/src/render/sdlgraphics.h @@ -71,6 +71,10 @@ class SDLGraphics final : public Graphics const int x, const int y, const int w, const int h) override final; + void inline drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h); + void drawRescaledPattern(const Image *const image, const int x, const int y, const int w, const int h, |