diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-12-15 14:00:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-12-15 14:00:29 +0300 |
commit | 76bd8cfad1f9dd7e1e61c69132dc02ec75e5ee8f (patch) | |
tree | 1aeaed7d8a8f16507572224cbd36cd2fc52b3289 | |
parent | 5546ac2f1a459b3fba47b42d546469cdae3c1c27 (diff) | |
download | manaverse-76bd8cfad1f9dd7e1e61c69132dc02ec75e5ee8f.tar.gz manaverse-76bd8cfad1f9dd7e1e61c69132dc02ec75e5ee8f.tar.bz2 manaverse-76bd8cfad1f9dd7e1e61c69132dc02ec75e5ee8f.tar.xz manaverse-76bd8cfad1f9dd7e1e61c69132dc02ec75e5ee8f.zip |
add final keyword to some renderers classes and remove useless virtual keywords.
-rw-r--r-- | src/render/sdl2graphics.h | 105 | ||||
-rw-r--r-- | src/render/sdl2softwaregraphics.h | 107 | ||||
-rw-r--r-- | src/render/sdlgraphics.h | 105 | ||||
-rw-r--r-- | src/render/surfacegraphics.h | 4 |
4 files changed, 150 insertions, 171 deletions
diff --git a/src/render/sdl2graphics.h b/src/render/sdl2graphics.h index ed58bc400..362d7cbc0 100644 --- a/src/render/sdl2graphics.h +++ b/src/render/sdl2graphics.h @@ -39,7 +39,7 @@ struct SDL_Surface; /** * A central point of control for graphics. */ -class SDLGraphics : public Graphics +class SDLGraphics final : public Graphics { public: /** @@ -52,7 +52,7 @@ class SDLGraphics : public Graphics /** * Destructor. */ - virtual ~SDLGraphics(); + ~SDLGraphics(); void _beginDraw() override final; @@ -62,68 +62,61 @@ class SDLGraphics : public Graphics void popClipArea() override final; - virtual bool drawRescaledImage(const Image *const image, int srcX, - int srcY, int dstX, int dstY, - const int width, const int height, - const int desiredWidth, - const int desiredHeight, - const bool useColor = false) - override final; + bool drawRescaledImage(const Image *const image, int srcX, + int srcY, int dstX, int dstY, + const int width, const int height, + const int desiredWidth, + const int desiredHeight, + const bool useColor = false) override final; - virtual void drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) override final; + void drawImagePattern(const Image *const image, + const int x, const int y, + const int w, const int h) override final; - virtual void drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) - override final; + void drawRescaledImagePattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) override final; - virtual void calcImagePattern(ImageVertexes *const vert, - const Image *const image, - const int x, - const int y, - const int w, - const int h) const override final; + void calcImagePattern(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; - virtual void calcImagePattern(ImageCollection *const vert, - const Image *const image, - const int x, - const int y, - const int w, - const int h) const override final; + void calcImagePattern(ImageCollection *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; - virtual void calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int x, int y) const override final; + void calcTileVertexes(ImageVertexes *const vert, + const Image *const image, + int x, int y) const override final; - virtual void calcTileSDL(ImageVertexes *const vert, - int x, int y) const override final; + void calcTileSDL(ImageVertexes *const vert, + int x, int y) const override final; - virtual void calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) override final; + void calcTileCollection(ImageCollection *const vertCol, + const Image *const image, + int x, int y) override final; - virtual void drawTileVertexes(const ImageVertexes - *const vert) override final; + void drawTileVertexes(const ImageVertexes *const vert) override final; - virtual void drawTileCollection(const ImageCollection *const vertCol) - override final; + void drawTileCollection(const ImageCollection *const vertCol) + override final; - virtual void updateScreen() override final; + void updateScreen() override final; - virtual SDL_Surface *getScreenshot() override final A_WARN_UNUSED; + SDL_Surface *getScreenshot() override final A_WARN_UNUSED; - virtual bool drawNet(const int x1, const int y1, - const int x2, const int y2, - const int width, const int height) override final; + bool drawNet(const int x1, const int y1, + const int x2, const int y2, + const int width, const int height) override final; - virtual bool calcWindow(ImageCollection *const vertCol, - const int x, const int y, - const int w, const int h, - const ImageRect &imgRect) override final; + bool calcWindow(ImageCollection *const vertCol, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) override final; void fillRectangle(const gcn::Rectangle &rect) override final; @@ -143,11 +136,11 @@ class SDLGraphics : public Graphics void setRendererFlags(const uint32_t flags) { mRendererFlags = flags; } - virtual bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) override final; + bool drawImage2(const Image *const image, + int srcX, int srcY, + int dstX, int dstY, + const int width, const int height, + const bool useColor) override final; protected: uint32_t mRendererFlags; diff --git a/src/render/sdl2softwaregraphics.h b/src/render/sdl2softwaregraphics.h index 079e1425f..54a45d4fe 100644 --- a/src/render/sdl2softwaregraphics.h +++ b/src/render/sdl2softwaregraphics.h @@ -39,7 +39,7 @@ struct SDL_Surface; /** * A central point of control for graphics. */ -class SDL2SoftwareGraphics : public Graphics +class SDL2SoftwareGraphics final : public Graphics { public: /** @@ -52,7 +52,7 @@ class SDL2SoftwareGraphics : public Graphics /** * Destructor. */ - virtual ~SDL2SoftwareGraphics(); + ~SDL2SoftwareGraphics(); void _beginDraw(); @@ -62,69 +62,62 @@ class SDL2SoftwareGraphics : public Graphics void popClipArea(); - virtual bool drawRescaledImage(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, - const int desiredHeight, - const bool useColor = false) - override final; + bool drawRescaledImage(const Image *const image, + int srcX, int srcY, + int dstX, int dstY, + const int width, const int height, + const int desiredWidth, + const int desiredHeight, + const bool useColor = false) override final; - virtual void drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) override final; + void drawImagePattern(const Image *const image, + const int x, const int y, + const int w, const int h) override final; - virtual void drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) - override final; + void drawRescaledImagePattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) override final; - virtual void calcImagePattern(ImageVertexes *const vert, - const Image *const image, - const int x, - const int y, - const int w, - const int h) const override final; + void calcImagePattern(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; - virtual void calcImagePattern(ImageCollection *const vert, - const Image *const image, - const int x, - const int y, - const int w, - const int h) const override final; + void calcImagePattern(ImageCollection *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; - virtual void calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int x, int y) const override final; + void calcTileVertexes(ImageVertexes *const vert, + const Image *const image, + int x, int y) const override final; - virtual void calcTileSDL(ImageVertexes *const vert, - int x, int y) const override final; + void calcTileSDL(ImageVertexes *const vert, + int x, int y) const override final; - virtual void calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) override final; + void calcTileCollection(ImageCollection *const vertCol, + const Image *const image, + int x, int y) override final; - virtual void drawTileVertexes(const ImageVertexes - *const vert) override final; + void drawTileVertexes(const ImageVertexes *const vert) override final; - virtual void drawTileCollection(const ImageCollection *const vertCol) - override final; + void drawTileCollection(const ImageCollection *const vertCol) + override final; - virtual void updateScreen() override final; + void updateScreen() override final; - virtual SDL_Surface *getScreenshot() override final A_WARN_UNUSED; + SDL_Surface *getScreenshot() override final A_WARN_UNUSED; - virtual bool drawNet(const int x1, const int y1, - const int x2, const int y2, - const int width, const int height) override final; + bool drawNet(const int x1, const int y1, + const int x2, const int y2, + const int width, const int height) override final; - virtual bool calcWindow(ImageCollection *const vertCol, - const int x, const int y, - const int w, const int h, - const ImageRect &imgRect) override final; + bool calcWindow(ImageCollection *const vertCol, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) override final; void fillRectangle(const gcn::Rectangle &rect) override final; @@ -146,11 +139,11 @@ class SDL2SoftwareGraphics : public Graphics bool resizeScreen(const int width, const int height) override final; - virtual bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) override final; + bool drawImage2(const Image *const image, + int srcX, int srcY, + int dstX, int dstY, + const int width, const int height, + const bool useColor) override final; protected: int SDL_FakeUpperBlit(const SDL_Surface *const src, diff --git a/src/render/sdlgraphics.h b/src/render/sdlgraphics.h index 5fc19d0b1..fcb624b12 100644 --- a/src/render/sdlgraphics.h +++ b/src/render/sdlgraphics.h @@ -39,7 +39,7 @@ class ImageVertexes; /** * A central point of control for graphics. */ -class SDLGraphics : public Graphics +class SDLGraphics final : public Graphics { public: /** @@ -52,7 +52,7 @@ class SDLGraphics : public Graphics /** * Destructor. */ - virtual ~SDLGraphics(); + ~SDLGraphics(); void _beginDraw() override final; @@ -62,68 +62,61 @@ class SDLGraphics : public Graphics void popClipArea() override final; - virtual bool drawRescaledImage(const Image *const image, int srcX, - int srcY, int dstX, int dstY, - const int width, const int height, - const int desiredWidth, - const int desiredHeight, - const bool useColor = false) - override final; + bool drawRescaledImage(const Image *const image, int srcX, + int srcY, int dstX, int dstY, + const int width, const int height, + const int desiredWidth, + const int desiredHeight, + const bool useColor = false) override final; - virtual void drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) override final; + void drawImagePattern(const Image *const image, + const int x, const int y, + const int w, const int h) override final; - virtual void drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) - override final; + void drawRescaledImagePattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) override final; - virtual void calcImagePattern(ImageVertexes *const vert, - const Image *const image, - const int x, - const int y, - const int w, - const int h) const override final; + void calcImagePattern(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; - virtual void calcImagePattern(ImageCollection *const vert, - const Image *const image, - const int x, - const int y, - const int w, - const int h) const override final; + void calcImagePattern(ImageCollection *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; - virtual void calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int x, int y) const override final; + void calcTileVertexes(ImageVertexes *const vert, + const Image *const image, + int x, int y) const override final; - virtual void calcTileSDL(ImageVertexes *const vert, - int x, int y) const override final; + void calcTileSDL(ImageVertexes *const vert, + int x, int y) const override final; - virtual void calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) override final; + void calcTileCollection(ImageCollection *const vertCol, + const Image *const image, + int x, int y) override final; - virtual void drawTileVertexes(const ImageVertexes - *const vert) override final; + void drawTileVertexes(const ImageVertexes *const vert) override final; - virtual void drawTileCollection(const ImageCollection *const vertCol) - override final; + void drawTileCollection(const ImageCollection *const vertCol) + override final; - virtual void updateScreen() override final; + void updateScreen() override final; - virtual SDL_Surface *getScreenshot() override final A_WARN_UNUSED; + SDL_Surface *getScreenshot() override final A_WARN_UNUSED; - virtual bool drawNet(const int x1, const int y1, - const int x2, const int y2, - const int width, const int height) override final; + bool drawNet(const int x1, const int y1, + const int x2, const int y2, + const int width, const int height) override final; - virtual bool calcWindow(ImageCollection *const vertCol, - const int x, const int y, - const int w, const int h, - const ImageRect &imgRect) override final; + bool calcWindow(ImageCollection *const vertCol, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) override final; void fillRectangle(const gcn::Rectangle &rect) override final; @@ -140,11 +133,11 @@ class SDLGraphics : public Graphics const bool resize, const bool noFrame) override final; - virtual bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) override final; + bool drawImage2(const Image *const image, + int srcX, int srcY, + int dstX, int dstY, + const int width, const int height, + const bool useColor) override final; protected: int SDL_FakeUpperBlit(const SDL_Surface *const src, diff --git a/src/render/surfacegraphics.h b/src/render/surfacegraphics.h index 7a130dd30..a81ff590c 100644 --- a/src/render/surfacegraphics.h +++ b/src/render/surfacegraphics.h @@ -36,7 +36,7 @@ struct SDL_Surface; /** * A central point of control for graphics. */ -class SurfaceGraphics : public Graphics +class SurfaceGraphics final : public Graphics { public: enum BlitMode @@ -49,7 +49,7 @@ class SurfaceGraphics : public Graphics A_DELETE_COPY(SurfaceGraphics) - virtual ~SurfaceGraphics(); + ~SurfaceGraphics(); void setTarget(SDL_Surface *const target) { mTarget = target; } |