From bbed1413d3ea2ef67f7fd7db146c372a7181ad43 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 30 Dec 2013 20:04:35 +0300 Subject: add calcImageRect into each renderer. but copy function body to shared file. --- src/render/normalopenglgraphics.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/render/normalopenglgraphics.cpp') diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index 6626564eb..e3e0d7e19 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -1024,7 +1024,7 @@ void NormalOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) drawVertexes(vert->ogl); } -bool NormalOpenGLGraphics::calcWindow(ImageCollection *const vertCol, +void NormalOpenGLGraphics::calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) @@ -1032,7 +1032,7 @@ bool NormalOpenGLGraphics::calcWindow(ImageCollection *const vertCol, ImageVertexes *vert = nullptr; Image *const image = imgRect.grid[4]; if (!image) - return false; + return; if (vertCol->currentGLImage != image->mGLImage) { vert = new ImageVertexes(); @@ -1045,9 +1045,7 @@ bool NormalOpenGLGraphics::calcWindow(ImageCollection *const vertCol, { vert = vertCol->currentVert; } - - const Image *const *const grid = &imgRect.grid[0]; - return calcImageRect(vert, x, y, w, h, imgRect); + calcImageRect(vert, x, y, w, h, imgRect); } void NormalOpenGLGraphics::updateScreen() @@ -1559,6 +1557,14 @@ void NormalOpenGLGraphics::drawImageRect(const int x, const int y, #include "render/openglgraphics_drawImageRect.hpp" } +void NormalOpenGLGraphics::calcImageRect(ImageVertexes *const vert, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/openglgraphics_calcImageRect.hpp" +} + #ifdef DEBUG_BIND_TEXTURE void NormalOpenGLGraphics::debugBindTexture(const Image *const image) { -- cgit v1.2.3-60-g2f50