diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-26 05:07:12 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-26 05:50:44 +0200 |
commit | 8403dcf857c9cc639e8162edd5d4df4af07274bc (patch) | |
tree | 2f127213e0df4691b06c549a8f20b3d5225b9220 /src/opengl1graphics.cpp | |
parent | fc24490f1ecd186f3c294915fadee62c3053d841 (diff) | |
download | manaverse-8403dcf857c9cc639e8162edd5d4df4af07274bc.tar.gz manaverse-8403dcf857c9cc639e8162edd5d4df4af07274bc.tar.bz2 manaverse-8403dcf857c9cc639e8162edd5d4df4af07274bc.tar.xz manaverse-8403dcf857c9cc639e8162edd5d4df4af07274bc.zip |
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.
Diffstat (limited to 'src/opengl1graphics.cpp')
-rw-r--r-- | src/opengl1graphics.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
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 <http://www.gnu.org/licenses/>. */ -#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<GLubyte>(mColor.b), static_cast<GLubyte>(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(); |