From 924dfdb11eb71a2b45bac78362e7b111b9dfce98 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 18 Aug 2013 15:09:34 +0300 Subject: Remove gcn::SDLGraphics from basic classes. --- src/graphics.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/graphics.h') diff --git a/src/graphics.h b/src/graphics.h index 60313fdaf..62bf064b1 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -23,7 +23,10 @@ #ifndef GRAPHICS_H #define GRAPHICS_H -#include +#include "SDL.h" + +#include +#include #include "localconsts.h" @@ -87,7 +90,7 @@ class ImageRect final /** * A central point of control for graphics. */ -class Graphics : public gcn::SDLGraphics +class Graphics : public gcn::Graphics { public: /** @@ -102,6 +105,12 @@ class Graphics : public gcn::SDLGraphics */ virtual ~Graphics(); + void setTarget(SDL_Surface *const target) + { mTarget = target; } + + SDL_Surface *getTarget() const + { return mTarget; } + /** * Sets whether vertical refresh syncing is enabled. Takes effect after * the next call to setVideoMode(). Only implemented on MacOS for now. @@ -136,6 +145,14 @@ class Graphics : public gcn::SDLGraphics */ bool drawImage(const Image *image, int x, int y); + // override unused abstract function + void drawImage(const gcn::Image* image A_UNUSED, + int srcX A_UNUSED, int srcY A_UNUSED, + int dstX A_UNUSED, int dstY A_UNUSED, + int width A_UNUSED, int height A_UNUSED) override + { + } + /** * Draws a resclaled version of the image */ @@ -326,6 +343,9 @@ class Graphics : public gcn::SDLGraphics mAlpha = (color.a != 255); } + const gcn::Color &getColor() const override + { return mColor; } + const gcn::Color &getColor2() const { return mColor2; } @@ -367,7 +387,9 @@ class Graphics : public gcn::SDLGraphics bool videoInfo(); + SDL_Surface* mTarget; int mBpp; + bool mAlpha; bool mFullscreen; bool mHWAccel; bool mRedraw; @@ -380,6 +402,7 @@ class Graphics : public gcn::SDLGraphics std::string mName; int mStartFreeMem; bool mSync; + gcn::Color mColor; gcn::Color mColor2; }; -- cgit v1.2.3-70-g09d2