summaryrefslogtreecommitdiff
path: root/src/render/graphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-30 17:04:01 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-30 17:04:01 +0300
commit6356ac19cd30dd2774de08834ec6b7afba54a3c8 (patch)
treeec8667e401f603c88a2f64357433336e867a6a0f /src/render/graphics.cpp
parentf98e1eb985bd5d694cd8fce323e5f4c3767dfe71 (diff)
downloadmanaverse-6356ac19cd30dd2774de08834ec6b7afba54a3c8.tar.gz
manaverse-6356ac19cd30dd2774de08834ec6b7afba54a3c8.tar.bz2
manaverse-6356ac19cd30dd2774de08834ec6b7afba54a3c8.tar.xz
manaverse-6356ac19cd30dd2774de08834ec6b7afba54a3c8.zip
Improve calcImageRect in renderers.
Diffstat (limited to 'src/render/graphics.cpp')
-rw-r--r--src/render/graphics.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp
index 3e8f2c46a..c83595b56 100644
--- a/src/render/graphics.cpp
+++ b/src/render/graphics.cpp
@@ -519,20 +519,24 @@ bool Graphics::drawNet(const int x1, const int y1, const int x2, const int y2,
bool Graphics::calcImageRect(ImageVertexes *const vert,
const int x, const int y,
const int w, const int h,
- const Image *const topLeft,
- const Image *const topRight,
- const Image *const bottomLeft,
- const Image *const bottomRight,
- const Image *const top,
- const Image *const right,
- const Image *const bottom,
- const Image *const left,
- const Image *const center)
+ const ImageRect &imgRect)
{
if (!vert)
return false;
BLOCK_START("Graphics::calcImageRect")
+
+ 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;