From 6356ac19cd30dd2774de08834ec6b7afba54a3c8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 30 Dec 2013 17:04:01 +0300 Subject: Improve calcImageRect in renderers. --- src/render/graphics.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/render/graphics.cpp') 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; -- cgit v1.2.3-70-g09d2