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/graphics.h | |
parent | fc24490f1ecd186f3c294915fadee62c3053d841 (diff) | |
download | plus-8403dcf857c9cc639e8162edd5d4df4af07274bc.tar.gz plus-8403dcf857c9cc639e8162edd5d4df4af07274bc.tar.bz2 plus-8403dcf857c9cc639e8162edd5d4df4af07274bc.tar.xz plus-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/graphics.h')
-rw-r--r-- | src/graphics.h | 29 |
1 files changed, 29 insertions, 0 deletions
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 <guichan/sdl/sdlgraphics.hpp> +//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; |