diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-15 20:31:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-15 20:31:52 +0300 |
commit | 29f929794c7519b049de0be3af635f05d7e83be6 (patch) | |
tree | 5627bfcb7f19a349f065c207476c871bc5c3aa40 /src/render | |
parent | 41d545176ffad2fb33158ca3415d2a0a983fffdb (diff) | |
download | manaplus-29f929794c7519b049de0be3af635f05d7e83be6.tar.gz manaplus-29f929794c7519b049de0be3af635f05d7e83be6.tar.bz2 manaplus-29f929794c7519b049de0be3af635f05d7e83be6.tar.xz manaplus-29f929794c7519b049de0be3af635f05d7e83be6.zip |
move some methods from base/graphics into render/graphics.
Remove base/graphcs.
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/graphics.cpp | 124 | ||||
-rw-r--r-- | src/render/graphics.h | 163 | ||||
-rw-r--r-- | src/render/mobileopenglgraphics.cpp | 4 | ||||
-rw-r--r-- | src/render/normalopenglgraphics.cpp | 4 | ||||
-rw-r--r-- | src/render/nullopenglgraphics.cpp | 4 | ||||
-rw-r--r-- | src/render/safeopenglgraphics.cpp | 4 | ||||
-rw-r--r-- | src/render/sdl2graphics.cpp | 47 | ||||
-rw-r--r-- | src/render/sdl2graphics.h | 43 | ||||
-rw-r--r-- | src/render/sdl2softwaregraphics.cpp | 4 | ||||
-rw-r--r-- | src/render/sdlgraphics.cpp | 4 |
10 files changed, 369 insertions, 32 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index 7e3687006..653b4d4c0 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -20,6 +20,49 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/* _______ __ __ __ ______ __ __ _______ __ __ + * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ + * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / + * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / + * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / + * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / + * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ + * + * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson + * + * + * Per Larsson a.k.a finalman + * Olof Naessén a.k.a jansem/yakslem + * + * Visit: http://guichan.sourceforge.net + * + * License: (BSD) + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Guichan nor the names of its contributors may + * be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #include "render/graphics.h" #include "main.h" @@ -48,11 +91,11 @@ Graphics *mainGraphics = nullptr; Graphics::Graphics() : - gcn::Graphics(), mWidth(0), mHeight(0), mActualWidth(0), mActualHeight(0), + mClipStack(), mWindow(nullptr), #ifdef USE_SDL2 mRenderer(nullptr), @@ -503,3 +546,82 @@ void Graphics::setWindowSize(const int width A_UNUSED, SDL_SetWindowSize(mWindow, width, height); #endif } + +bool Graphics::pushClipArea(gcn::Rectangle area) +{ + // Ignore area with a negate width or height + // by simple pushing an empty clip area + // to the stack. + if (area.width < 0 || area.height < 0) + { + gcn::ClipRectangle carea; + mClipStack.push(carea); + return true; + } + + if (mClipStack.empty()) + { + gcn::ClipRectangle carea; + carea.x = area.x; + carea.y = area.y; + carea.width = area.width; + carea.height = area.height; + carea.xOffset = area.x; + carea.yOffset = area.y; + mClipStack.push(carea); + return true; + } + + const gcn::ClipRectangle &top = mClipStack.top(); + gcn::ClipRectangle carea; + carea = area; + carea.xOffset = top.xOffset + carea.x; + carea.yOffset = top.yOffset + carea.y; + carea.x += top.xOffset; + carea.y += top.yOffset; + + // Clamp the pushed clip rectangle. + if (carea.x < top.x) + carea.x = top.x; + + if (carea.y < top.y) + carea.y = top.y; + + if (carea.x + carea.width > top.x + top.width) + { + carea.width = top.x + top.width - carea.x; + + if (carea.width < 0) + carea.width = 0; + } + + if (carea.y + carea.height > top.y + top.height) + { + carea.height = top.y + top.height - carea.y; + + if (carea.height < 0) + carea.height = 0; + } + + const bool result = carea.isIntersecting(top); + + mClipStack.push(carea); + + return result; +} + +void Graphics::popClipArea() +{ + if (mClipStack.empty()) + return; + + mClipStack.pop(); +} + +const gcn::ClipRectangle *Graphics::getCurrentClipArea() const +{ + if (mClipStack.empty()) + return nullptr; + + return &mClipStack.top(); +} diff --git a/src/render/graphics.h b/src/render/graphics.h index 93d46b475..53eb4af12 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -20,6 +20,49 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/* _______ __ __ __ ______ __ __ _______ __ __ + * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ + * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / + * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / + * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / + * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / + * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ + * + * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson + * + * + * Per Larsson a.k.a finalman + * Olof Naessén a.k.a jansem/yakslem + * + * Visit: http://guichan.sourceforge.net + * + * License: (BSD) + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Guichan nor the names of its contributors may + * be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #ifndef RENDER_GRAPHICS_H #define RENDER_GRAPHICS_H @@ -29,13 +72,15 @@ #include "render/renderers.h" +#include "gui/base/cliprectangle.hpp" #include "gui/base/color.hpp" -#include "gui/base/graphics.hpp" #ifdef USE_SDL2 #include <SDL_render.h> #endif +#include <stack> + #include "localconsts.h" class Image; @@ -94,7 +139,7 @@ class ImageRect final /** * A central point of control for graphics. */ -class Graphics : public gcn::Graphics +class Graphics { public: A_DELETE_COPY(Graphics) @@ -104,6 +149,16 @@ class Graphics : public gcn::Graphics */ virtual ~Graphics(); + /** + * Alignments for text drawing. + */ + enum Alignment + { + LEFT = 0, + CENTER, + RIGHT + }; + void setWindow(SDL_Window *const window, const int width, const int height) { @@ -145,14 +200,6 @@ class Graphics : public gcn::Graphics */ virtual bool resizeScreen(const int width, const int height); - // 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 final - { - } - /** * Draws a resclaled version of the image */ @@ -211,8 +258,7 @@ class Graphics : public gcn::Graphics const int w, const int h, const ImageRect &imgRect) = 0; - virtual void fillRectangle(const gcn::Rectangle& rectangle) - override = 0; + virtual void fillRectangle(const gcn::Rectangle& rectangle) = 0; /** * Updates the screen. This is done by either copying the buffer to the @@ -246,9 +292,6 @@ class Graphics : public gcn::Graphics const int x2, const int y2, const int width, const int height); - const gcn::Font *getFont() const A_WARN_UNUSED - { return mFont; } - gcn::ClipRectangle &getTopClip() A_WARN_UNUSED { return mClipStack.top(); } @@ -288,7 +331,7 @@ class Graphics : public gcn::Graphics virtual void initArrays() { } - void setColor(const gcn::Color &color) override + virtual void setColor(const gcn::Color &color) { mColor = color; mColor2 = color; @@ -305,7 +348,7 @@ class Graphics : public gcn::Graphics mAlpha = (color.a != 255); } - const gcn::Color &getColor() const override + const gcn::Color &getColor() const { return mColor; } const gcn::Color &getColor2() const @@ -353,6 +396,87 @@ class Graphics : public gcn::Graphics void setScale(int scale); + /** + * Pushes a clip area onto the stack. The x and y coordinates in the + * rectangle is relative to the last pushed clip area. + * If the new area falls outside the current clip area, it will be + * clipped as necessary. + * + * If a clip area is outside of the top clip area a clip area with + * zero width and height will be pushed. + * + * @param area The clip area to be pushed onto the stack. + * @return False if the the new area lays outside the current clip + * area. + */ + virtual bool pushClipArea(gcn::Rectangle area); + + /** + * Removes the top most clip area from the stack. + * + * @throws Exception if the stack is empty. + */ + virtual void popClipArea(); + + /** + * Ddraws a line. + * + * @param x1 The first x coordinate. + * @param y1 The first y coordinate. + * @param x2 The second x coordinate. + * @param y2 The second y coordinate. + */ + virtual void drawLine(int x1, int y1, int x2, int y2) = 0; + + /** + * Draws a simple, non-filled, rectangle with a one pixel width. + * + * @param rectangle The rectangle to draw. + */ + virtual void drawRectangle(const gcn::Rectangle &rectangle) = 0; + + /** + * Gets the current clip area. Usefull if you want to do drawing + * bypassing Graphics. + * + * @return The current clip area. + */ + virtual const gcn::ClipRectangle *getCurrentClipArea() const; + + /** + * Draws a single point/pixel. + * + * @param x The x coordinate. + * @param y The y coordinate. + */ + virtual void drawPoint(int x, int y) = 0; + + /** + * Initializes drawing. Called by the Gui when Gui::draw() is called. + * It is needed by some implementations of Graphics to perform + * preparations before drawing. An example of such an implementation + * is the OpenGLGraphics. + * + * NOTE: You will never need to call this function yourself, unless + * you use a Graphics object outside of Guichan. + * + * @see _endDraw, Gui::draw + */ + virtual void _beginDraw() + { } + + /** + * Deinitializes drawing. Called by the Gui when a Gui::draw() is done. + * done. It should reset any state changes made by _beginDraw(). + * + * NOTE: You will never need to call this function yourself, unless + * you use a Graphics object outside of Guichan. + * + * @see _beginDraw, Gui::draw + */ + virtual void _endDraw() + { } + int mWidth; int mHeight; int mActualWidth; @@ -382,6 +506,11 @@ class Graphics : public gcn::Graphics bool videoInfo(); + /** + * Holds the clip area stack. + */ + std::stack<gcn::ClipRectangle> mClipStack; + SDL_Window *mWindow; #ifdef USE_SDL2 diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 82bf04dc8..252dc0766 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -963,7 +963,7 @@ bool MobileOpenGLGraphics::pushClipArea(gcn::Rectangle area) transY = -clipArea.yOffset; } - const bool result = gcn::Graphics::pushClipArea(area); + const bool result = Graphics::pushClipArea(area); const gcn::ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; @@ -990,7 +990,7 @@ void MobileOpenGLGraphics::popClipArea() int transX = -clipArea1.xOffset; int transY = -clipArea1.yOffset; - gcn::Graphics::popClipArea(); + Graphics::popClipArea(); if (mClipStack.empty()) return; diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index e8e1a2116..aea3f5d24 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -1223,7 +1223,7 @@ bool NormalOpenGLGraphics::pushClipArea(gcn::Rectangle area) transY = -clipArea.yOffset; } - const bool result = gcn::Graphics::pushClipArea(area); + const bool result = Graphics::pushClipArea(area); const gcn::ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; @@ -1251,7 +1251,7 @@ void NormalOpenGLGraphics::popClipArea() int transX = -clipArea1.xOffset; int transY = -clipArea1.yOffset; - gcn::Graphics::popClipArea(); + Graphics::popClipArea(); if (mClipStack.empty()) return; diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index 3ea1e4182..d1c6ed0a6 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -947,7 +947,7 @@ bool NullOpenGLGraphics::pushClipArea(gcn::Rectangle area) transY = -clipArea.yOffset; } - const bool result = gcn::Graphics::pushClipArea(area); + const bool result = Graphics::pushClipArea(area); const gcn::ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; @@ -958,7 +958,7 @@ bool NullOpenGLGraphics::pushClipArea(gcn::Rectangle area) void NullOpenGLGraphics::popClipArea() { - gcn::Graphics::popClipArea(); + Graphics::popClipArea(); if (mClipStack.empty()) return; diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index bf9334655..c27db4f47 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -535,7 +535,7 @@ bool SafeOpenGLGraphics::pushClipArea(gcn::Rectangle area) transY = -clipArea.yOffset; } - const bool result = gcn::Graphics::pushClipArea(area); + const bool result = Graphics::pushClipArea(area); const gcn::ClipRectangle &clipArea = mClipStack.top(); @@ -551,7 +551,7 @@ bool SafeOpenGLGraphics::pushClipArea(gcn::Rectangle area) void SafeOpenGLGraphics::popClipArea() { - gcn::Graphics::popClipArea(); + Graphics::popClipArea(); if (mClipStack.empty()) return; diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index 285b2dac2..46d8360b6 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -20,6 +20,49 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/* _______ __ __ __ ______ __ __ _______ __ __ + * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ + * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / + * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / + * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / + * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / + * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ + * + * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson + * + * + * Per Larsson a.k.a finalman + * Olof Naessén a.k.a jansem/yakslem + * + * Visit: http://guichan.sourceforge.net + * + * License: (BSD) + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Guichan nor the names of its contributors may + * be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #ifdef USE_SDL2 #include "render/sdl2graphics.h" @@ -621,7 +664,7 @@ void SDLGraphics::_endDraw() bool SDLGraphics::pushClipArea(gcn::Rectangle area) { - const bool result = gcn::Graphics::pushClipArea(area); + const bool result = Graphics::pushClipArea(area); const gcn::ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = @@ -637,7 +680,7 @@ bool SDLGraphics::pushClipArea(gcn::Rectangle area) void SDLGraphics::popClipArea() { - gcn::Graphics::popClipArea(); + Graphics::popClipArea(); if (mClipStack.empty()) return; diff --git a/src/render/sdl2graphics.h b/src/render/sdl2graphics.h index c4e0d74a7..1e581dc39 100644 --- a/src/render/sdl2graphics.h +++ b/src/render/sdl2graphics.h @@ -20,6 +20,49 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/* _______ __ __ __ ______ __ __ _______ __ __ + * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ + * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / + * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / + * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / + * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / + * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ + * + * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson + * + * + * Per Larsson a.k.a finalman + * Olof Naessén a.k.a jansem/yakslem + * + * Visit: http://guichan.sourceforge.net + * + * License: (BSD) + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of Guichan nor the names of its contributors may + * be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + #ifndef RENDER_SDL2GRAPHICS_H #define RENDER_SDL2GRAPHICS_H diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index c158844ae..e78a87c7e 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -1126,7 +1126,7 @@ void SDL2SoftwareGraphics::_endDraw() bool SDL2SoftwareGraphics::pushClipArea(gcn::Rectangle area) { - const bool result = gcn::Graphics::pushClipArea(area); + const bool result = Graphics::pushClipArea(area); const gcn::ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = @@ -1142,7 +1142,7 @@ bool SDL2SoftwareGraphics::pushClipArea(gcn::Rectangle area) void SDL2SoftwareGraphics::popClipArea() { - gcn::Graphics::popClipArea(); + Graphics::popClipArea(); if (mClipStack.empty()) return; diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 9e950c12f..2226be0da 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -1122,7 +1122,7 @@ void SDLGraphics::_endDraw() bool SDLGraphics::pushClipArea(gcn::Rectangle area) { - const bool result = gcn::Graphics::pushClipArea(area); + const bool result = Graphics::pushClipArea(area); const gcn::ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { @@ -1138,7 +1138,7 @@ bool SDLGraphics::pushClipArea(gcn::Rectangle area) void SDLGraphics::popClipArea() { - gcn::Graphics::popClipArea(); + Graphics::popClipArea(); if (mClipStack.empty()) return; |