diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-30 18:19:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-30 18:21:13 +0300 |
commit | 00d8cfee5bc76c59e5c3195f4434c4a4fb741d0e (patch) | |
tree | c536958c8cf2308bd38d92a414e6af0a64a3c844 /src/render/graphics.cpp | |
parent | 252bfdaf28d9cfa449e6b0af7a15b66483b9c5bd (diff) | |
download | manaverse-00d8cfee5bc76c59e5c3195f4434c4a4fb741d0e.tar.gz manaverse-00d8cfee5bc76c59e5c3195f4434c4a4fb741d0e.tar.bz2 manaverse-00d8cfee5bc76c59e5c3195f4434c4a4fb741d0e.tar.xz manaverse-00d8cfee5bc76c59e5c3195f4434c4a4fb741d0e.zip |
add drawImageRect into each renderer. but copy function body to shared file.
Diffstat (limited to 'src/render/graphics.cpp')
-rw-r--r-- | src/render/graphics.cpp | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index c83595b56..abb696bc9 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -440,70 +440,6 @@ int Graphics::getHeight() const return mHeight; } -void Graphics::drawImageRect(const int x, const int y, - const int w, const int h, - const ImageRect &imgRect) -{ - BLOCK_START("Graphics::drawImageRect") - - const Image *const *const grid = imgRect.grid; - const Image *const topLeft = grid[0]; - const Image *const topRight = grid[2]; - const Image *const bottomLeft = grid[6]; - const Image *const bottomRight = grid[8]; - const Image *const top = grid[1]; - const Image *const right = grid[5]; - const Image *const bottom = grid[7]; - const Image *const left = grid[3]; - const Image *const center = grid[4]; - - const bool drawMain = center && topLeft && topRight - && bottomLeft && bottomRight; - - // Draw the center area - if (center && drawMain) - { - const int tlw = topLeft->getWidth(); - const int tlh = topLeft->getHeight(); - drawPattern(center, tlw + x, tlh + y, - w - tlw - topRight->getWidth(), - h - tlh - bottomLeft->getHeight()); - } - - // Draw the sides - if (top && left && bottom && right) - { - const int lw = left->getWidth(); - 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); - if (w > rw) - drawPattern(right, x + w - rw, th + y, rw, h - th - bh); - } - // Draw the corners - if (drawMain) - { - drawImage2(topLeft, x, y); - const int trw = topRight->getWidth(); - if (w > trw) - { - drawImage2(topRight, x + w - trw, y); - } - drawImage2(bottomLeft, x, h - bottomLeft->getHeight() + y); - const int brw = bottomRight->getWidth(); - if (w > brw) - { - drawImage2(bottomRight, - x + w - brw, - y + h - bottomRight->getHeight()); - } - } - BLOCK_END("Graphics::drawImageRect") -} - bool Graphics::drawNet(const int x1, const int y1, const int x2, const int y2, const int width, const int height) { |