]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/CGraphics.h
Cache text surfaces.
[quix0rs-blobwars.git] / src / CGraphics.h
index 5b1a5b5ac088d1e6e4452dae67b1486878a329ee..3ad2c5213d439cad412fe134ed3f7168f51c6de4 100755 (executable)
@@ -49,6 +49,11 @@ class Graphics {
                SDL_Surface *infoMessage;
 
        public:
+               struct SurfaceCache {
+                       char *text;
+                       SDL_Surface *surface;
+                       SurfaceCache(): text(NULL), surface(NULL) {}    
+               };
 
                bool takeRandomScreenShots;
 
@@ -56,6 +61,7 @@ class Graphics {
                SDL_Surface *tile[MAX_TILES];
                
                SDL_Surface *medal[4];
+               SDL_Surface *license[2];
                
                SDL_Surface *infoBar;
 
@@ -73,7 +79,7 @@ class Graphics {
        void delay(int time);
        void RGBtoHSV(float r, float g, float b, float *h, float *s, float *v);
        void HSVtoRGB(float *r, float *g, float *b, float h, float s, float v);
-       SDL_Surface *loadImage(const char *filename);
+       SDL_Surface *loadImage(const char *filename, bool srcalpha = false);
        SDL_Surface *loadImage(const char *filename, int hue, int sat, int value);
        SDL_Surface *quickSprite(const char *name, SDL_Surface *image);
        void fade(int amount);
@@ -100,6 +106,7 @@ class Graphics {
        void setFontSize(int size);
        SDL_Surface *getString(const char *in, bool transparent);
        void drawString(const char *in, int x, int y, int alignment, SDL_Surface *dest);
+       void drawString(const char *in, int x, int y, int alignment, SDL_Surface *dest, SurfaceCache &cache);
        void clearChatString();
        void createChatString(const char *in);
        void showMedalMessage(int type, const char *in);