From 8403dcf857c9cc639e8162edd5d4df4af07274bc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 26 Mar 2011 05:07:12 +0200 Subject: Precalculation vertexes for improving draw speed. Implemented in Software and fast OpenGL backends. Not all controls using this mode because some limitations. Known issue: impossible compile without opengl. Will be fixed in next commits. --- src/opengl1graphics.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/opengl1graphics.cpp') diff --git a/src/opengl1graphics.cpp b/src/opengl1graphics.cpp index 3dfe06ecf..e1d44de23 100644 --- a/src/opengl1graphics.cpp +++ b/src/opengl1graphics.cpp @@ -20,9 +20,11 @@ * along with this program. If not, see . */ -#include "log.h" #include "opengl1graphics.h" +#include "graphicsvertexes.h" +#include "log.h" + #include "resources/image.h" #ifdef USE_OPENGL @@ -391,6 +393,29 @@ void OpenGL1Graphics::drawRescaledImagePattern(Image *image, int x, int y, static_cast(mColor.b), static_cast(mColor.a)); } +bool OpenGL1Graphics::calcImageRect(GraphicsVertexes* vert, + int x, int y, int w, int h, + Image *topLeft _UNUSED_, + Image *topRight _UNUSED_, + Image *bottomLeft _UNUSED_, + Image *bottomRight _UNUSED_, + Image *top _UNUSED_, Image *right _UNUSED_, + Image *bottom _UNUSED_, + Image *left _UNUSED_, + Image *center _UNUSED_) +{ + vert->init(x, y, w, h); + return true; +} + +void OpenGL1Graphics::drawImageRect2(GraphicsVertexes* vert, const ImageRect &imgRect) +{ + drawImageRect(vert->getX(), vert->getY(), vert->getW(), vert->getH(), + imgRect.grid[0], imgRect.grid[2], imgRect.grid[6], imgRect.grid[8], + imgRect.grid[1], imgRect.grid[5], imgRect.grid[7], imgRect.grid[3], + imgRect.grid[4]); +} + void OpenGL1Graphics::updateScreen() { glFlush(); -- cgit v1.2.3-70-g09d2