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/graphics.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/graphics.h') diff --git a/src/graphics.h b/src/graphics.h index a8e593ba1..23ce0bb91 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -25,12 +25,15 @@ #include +//include "graphicsvertexes.h" + #ifdef __GNUC__ #define _UNUSED_ __attribute__ ((unused)) #else #define _UNUSED_ #endif +class GraphicsVertexes; class Image; class ImageRect; @@ -161,6 +164,8 @@ class Graphics : public gcn::SDLGraphics int x, int y, int w, int h); + void drawImagePatternDebug(GraphicsVertexes* vert, Image *image, int x, int y, int w, int h); + /** * Draw a pattern based on a rescaled version of the given image... */ @@ -187,6 +192,27 @@ class Graphics : public gcn::SDLGraphics void drawImageRect(int x, int y, int w, int h, const ImageRect &imgRect); + virtual bool calcImageRect(GraphicsVertexes* vert, + int x, int y, int w, int h, + Image *topLeft, Image *topRight, + Image *bottomLeft, Image *bottomRight, + Image *top, Image *right, + Image *bottom, Image *left, + Image *center); + + virtual void calcImagePattern(GraphicsVertexes* vert, Image *image, + int x, int y, + int w, int h); + + virtual void drawImageRect2(GraphicsVertexes* vert, + const ImageRect &imgRect); + + virtual void drawImagePattern2(GraphicsVertexes *vert, Image *img); + + bool calcWindow(GraphicsVertexes* vert, + int x, int y, int w, int h, + const ImageRect &imgRect); + /** * Draws a rectangle using images. 4 corner images, 4 side images and 1 * image for the inside. @@ -228,6 +254,9 @@ class Graphics : public gcn::SDLGraphics gcn::Font *getFont() const { return mFont; } + gcn::ClipRectangle &getTopClip() + { return mClipStack.top(); } + protected: int mWidth; int mHeight; -- cgit v1.2.3-70-g09d2