diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-22 14:59:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-22 14:59:26 +0300 |
commit | 63f0b730767b1185dc33f8892068d697e26a09bb (patch) | |
tree | 9f3bcba891cb747b2b4696651b8df464a8a1fc86 /src/render | |
parent | 48646db55005a0da079bd2c945875dc8225e2f86 (diff) | |
download | manaverse-63f0b730767b1185dc33f8892068d697e26a09bb.tar.gz manaverse-63f0b730767b1185dc33f8892068d697e26a09bb.tar.bz2 manaverse-63f0b730767b1185dc33f8892068d697e26a09bb.tar.xz manaverse-63f0b730767b1185dc33f8892068d697e26a09bb.zip |
Move Rectangle and ClipRectangle into gui directory.
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/graphics.cpp | 12 | ||||
-rw-r--r-- | src/render/graphics.h | 14 | ||||
-rw-r--r-- | src/render/mobileopenglgraphics.cpp | 18 | ||||
-rw-r--r-- | src/render/normalopenglgraphics.cpp | 18 | ||||
-rw-r--r-- | src/render/nullopenglgraphics.cpp | 14 | ||||
-rw-r--r-- | src/render/openglgraphicsdef.hpp | 8 | ||||
-rw-r--r-- | src/render/safeopenglgraphics.cpp | 16 | ||||
-rw-r--r-- | src/render/sdl2graphics.cpp | 36 | ||||
-rw-r--r-- | src/render/sdl2graphics.h | 6 | ||||
-rw-r--r-- | src/render/sdl2softwaregraphics.cpp | 38 | ||||
-rw-r--r-- | src/render/sdl2softwaregraphics.h | 6 | ||||
-rw-r--r-- | src/render/sdlgraphics.cpp | 38 | ||||
-rw-r--r-- | src/render/sdlgraphics.h | 6 | ||||
-rw-r--r-- | src/render/surfacegraphics.h | 6 |
14 files changed, 118 insertions, 118 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index 653b4d4c0..bac987695 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -547,21 +547,21 @@ void Graphics::setWindowSize(const int width A_UNUSED, #endif } -bool Graphics::pushClipArea(gcn::Rectangle area) +bool Graphics::pushClipArea(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; + ClipRectangle carea; mClipStack.push(carea); return true; } if (mClipStack.empty()) { - gcn::ClipRectangle carea; + ClipRectangle carea; carea.x = area.x; carea.y = area.y; carea.width = area.width; @@ -572,8 +572,8 @@ bool Graphics::pushClipArea(gcn::Rectangle area) return true; } - const gcn::ClipRectangle &top = mClipStack.top(); - gcn::ClipRectangle carea; + const ClipRectangle &top = mClipStack.top(); + ClipRectangle carea; carea = area; carea.xOffset = top.xOffset + carea.x; carea.yOffset = top.yOffset + carea.y; @@ -618,7 +618,7 @@ void Graphics::popClipArea() mClipStack.pop(); } -const gcn::ClipRectangle *Graphics::getCurrentClipArea() const +const ClipRectangle *Graphics::getCurrentClipArea() const { if (mClipStack.empty()) return nullptr; diff --git a/src/render/graphics.h b/src/render/graphics.h index 2356d2d31..35e2a3ba3 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -74,7 +74,7 @@ #include "render/renderers.h" -#include "gui/base/cliprectangle.hpp" +#include "gui/cliprectangle.h" #ifdef USE_SDL2 #include <SDL_render.h> @@ -259,7 +259,7 @@ class Graphics const int w, const int h, const ImageRect &imgRect) = 0; - virtual void fillRectangle(const gcn::Rectangle& rectangle) = 0; + virtual void fillRectangle(const Rectangle& rectangle) = 0; /** * Updates the screen. This is done by either copying the buffer to the @@ -293,7 +293,7 @@ class Graphics const int x2, const int y2, const int width, const int height); - gcn::ClipRectangle &getTopClip() A_WARN_UNUSED + ClipRectangle &getTopClip() A_WARN_UNUSED { return mClipStack.top(); } void setRedraw(const bool n) @@ -410,7 +410,7 @@ class Graphics * @return False if the the new area lays outside the current clip * area. */ - virtual bool pushClipArea(gcn::Rectangle area); + virtual bool pushClipArea(Rectangle area); /** * Removes the top most clip area from the stack. @@ -434,7 +434,7 @@ class Graphics * * @param rectangle The rectangle to draw. */ - virtual void drawRectangle(const gcn::Rectangle &rectangle) = 0; + virtual void drawRectangle(const Rectangle &rectangle) = 0; /** * Gets the current clip area. Usefull if you want to do drawing @@ -442,7 +442,7 @@ class Graphics * * @return The current clip area. */ - virtual const gcn::ClipRectangle *getCurrentClipArea() const; + virtual const ClipRectangle *getCurrentClipArea() const; /** * Draws a single point/pixel. @@ -510,7 +510,7 @@ class Graphics /** * Holds the clip area stack. */ - std::stack<gcn::ClipRectangle> mClipStack; + std::stack<ClipRectangle> mClipStack; SDL_Window *mWindow; diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 252dc0766..a2f7909ff 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -884,7 +884,7 @@ void MobileOpenGLGraphics::_beginDraw() // glScalef(0.5F, 0.5F, 0.5F); - pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); } void MobileOpenGLGraphics::_endDraw() @@ -951,21 +951,21 @@ SDL_Surface* MobileOpenGLGraphics::getScreenshot() return screenshot; } -bool MobileOpenGLGraphics::pushClipArea(gcn::Rectangle area) +bool MobileOpenGLGraphics::pushClipArea(Rectangle area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; @@ -986,7 +986,7 @@ void MobileOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &clipArea1 = mClipStack.top(); + const ClipRectangle &clipArea1 = mClipStack.top(); int transX = -clipArea1.xOffset; int transY = -clipArea1.yOffset; @@ -995,7 +995,7 @@ void MobileOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; if (transX || transY) @@ -1040,12 +1040,12 @@ void MobileOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) drawLineArrays(4); } -void MobileOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect) +void MobileOpenGLGraphics::drawRectangle(const Rectangle& rect) { drawRectangle(rect, false); } -void MobileOpenGLGraphics::fillRectangle(const gcn::Rectangle& rect) +void MobileOpenGLGraphics::fillRectangle(const Rectangle& rect) { drawRectangle(rect, true); } @@ -1090,7 +1090,7 @@ void MobileOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void MobileOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, +void MobileOpenGLGraphics::drawRectangle(const Rectangle& rect, const bool filled) { BLOCK_START("Graphics::drawRectangle") diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index aea3f5d24..67a18bde5 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -1145,7 +1145,7 @@ void NormalOpenGLGraphics::_beginDraw() #endif #endif - pushClipArea(gcn::Rectangle(0, 0, w, h)); + pushClipArea(Rectangle(0, 0, w, h)); } void NormalOpenGLGraphics::_endDraw() @@ -1211,21 +1211,21 @@ SDL_Surface* NormalOpenGLGraphics::getScreenshot() return screenshot; } -bool NormalOpenGLGraphics::pushClipArea(gcn::Rectangle area) +bool NormalOpenGLGraphics::pushClipArea(Rectangle area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; @@ -1247,7 +1247,7 @@ void NormalOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &clipArea1 = mClipStack.top(); + const ClipRectangle &clipArea1 = mClipStack.top(); int transX = -clipArea1.xOffset; int transY = -clipArea1.yOffset; @@ -1256,7 +1256,7 @@ void NormalOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; if (transX || transY) @@ -1297,12 +1297,12 @@ void NormalOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) drawLineArrayf(4); } -void NormalOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect) +void NormalOpenGLGraphics::drawRectangle(const Rectangle& rect) { drawRectangle(rect, false); } -void NormalOpenGLGraphics::fillRectangle(const gcn::Rectangle& rect) +void NormalOpenGLGraphics::fillRectangle(const Rectangle& rect) { drawRectangle(rect, true); } @@ -1347,7 +1347,7 @@ void NormalOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void NormalOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, +void NormalOpenGLGraphics::drawRectangle(const Rectangle& rect, const bool filled) { BLOCK_START("Graphics::drawRectangle") diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index d1c6ed0a6..6018247f9 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -918,7 +918,7 @@ void NullOpenGLGraphics::updateScreen() void NullOpenGLGraphics::_beginDraw() { - pushClipArea(gcn::Rectangle(0, 0, 640, 480)); + pushClipArea(Rectangle(0, 0, 640, 480)); } void NullOpenGLGraphics::_endDraw() @@ -935,21 +935,21 @@ SDL_Surface* NullOpenGLGraphics::getScreenshot() return nullptr; } -bool NullOpenGLGraphics::pushClipArea(gcn::Rectangle area) +bool NullOpenGLGraphics::pushClipArea(Rectangle area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; @@ -984,12 +984,12 @@ void NullOpenGLGraphics::drawLine(int x1, int y1, drawLineArrayf(4); } -void NullOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect) +void NullOpenGLGraphics::drawRectangle(const Rectangle& rect) { drawRectangle(rect, false); } -void NullOpenGLGraphics::fillRectangle(const gcn::Rectangle& rect) +void NullOpenGLGraphics::fillRectangle(const Rectangle& rect) { drawRectangle(rect, true); } @@ -1017,7 +1017,7 @@ void NullOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void NullOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect A_UNUSED, +void NullOpenGLGraphics::drawRectangle(const Rectangle& rect A_UNUSED, const bool filled A_UNUSED) { BLOCK_START("Graphics::drawRectangle") diff --git a/src/render/openglgraphicsdef.hpp b/src/render/openglgraphicsdef.hpp index 99bf8e82a..a582d9043 100644 --- a/src/render/openglgraphicsdef.hpp +++ b/src/render/openglgraphicsdef.hpp @@ -88,7 +88,7 @@ void _endDraw() override final; - bool pushClipArea(gcn::Rectangle area) override final; + bool pushClipArea(Rectangle area) override final; void popClipArea() override final; @@ -110,12 +110,12 @@ void drawLine(int x1, int y1, int x2, int y2) override final; - void drawRectangle(const gcn::Rectangle &rect, + void drawRectangle(const Rectangle &rect, const bool filled); - void drawRectangle(const gcn::Rectangle &rect) override final; + void drawRectangle(const Rectangle &rect) override final; - void fillRectangle(const gcn::Rectangle &rect) override final; + void fillRectangle(const Rectangle &rect) override final; static void dumpSettings(); diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index c27db4f47..c1c266464 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -459,7 +459,7 @@ void SafeOpenGLGraphics::_beginDraw() glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); } void SafeOpenGLGraphics::_endDraw() @@ -523,21 +523,21 @@ SDL_Surface* SafeOpenGLGraphics::getScreenshot() return screenshot; } -bool SafeOpenGLGraphics::pushClipArea(gcn::Rectangle area) +bool SafeOpenGLGraphics::pushClipArea(Rectangle area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); glPushMatrix(); glTranslatef(static_cast<GLfloat>(transX + clipArea.xOffset), @@ -557,7 +557,7 @@ void SafeOpenGLGraphics::popClipArea() return; glPopMatrix(); - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); glScissor(clipArea.x * mScale, (mRect.h - clipArea.y - clipArea.height) * mScale, clipArea.width * mScale, @@ -613,12 +613,12 @@ void SafeOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) glEnd(); } -void SafeOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect) +void SafeOpenGLGraphics::drawRectangle(const Rectangle& rect) { drawRectangle(rect, false); } -void SafeOpenGLGraphics::fillRectangle(const gcn::Rectangle& rect) +void SafeOpenGLGraphics::fillRectangle(const Rectangle& rect) { drawRectangle(rect, true); } @@ -661,7 +661,7 @@ void SafeOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void SafeOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, +void SafeOpenGLGraphics::drawRectangle(const Rectangle& rect, const bool filled) { BLOCK_START("Graphics::drawRectangle") diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index 933120080..053049cef 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -136,7 +136,7 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, if (!image->mTexture) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; const SDL_Rect srcRect = { @@ -171,7 +171,7 @@ bool SDLGraphics::drawImageInline(const Image *const image, if (!mWindow || !image || !image->mTexture) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return false; @@ -203,7 +203,7 @@ void SDLGraphics::drawImageCached(const Image *const image, if (!mWindow || !image || !image->mTexture) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -238,7 +238,7 @@ void SDLGraphics::drawPatternCached(const Image *const image, if (!image->mTexture) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -296,7 +296,7 @@ void SDLGraphics::drawPatternInline(const Image *const image, if (!image->mTexture) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -347,7 +347,7 @@ void SDLGraphics::drawRescaledPattern(const Image *const image, if (scaledHeight == 0 || scaledWidth == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -407,7 +407,7 @@ void SDLGraphics::calcPatternInline(ImageVertexes* const vert, if (!vert || !mWindow || !image || !image->mTexture) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -492,7 +492,7 @@ void SDLGraphics::calcTileSDL(ImageVertexes *const vert, int x, int y) const if (!vert || !vert->image || !vert->image->mTexture) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -638,9 +638,9 @@ void SDLGraphics::calcWindow(ImageCollection *const vertCol, calcImageRect(vert, x, y, w, h, imgRect); } -void SDLGraphics::fillRectangle(const gcn::Rectangle &rectangle) +void SDLGraphics::fillRectangle(const Rectangle &rectangle) { - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect rect = { static_cast<int32_t>(rectangle.x + top.xOffset), @@ -655,7 +655,7 @@ void SDLGraphics::fillRectangle(const gcn::Rectangle &rectangle) void SDLGraphics::_beginDraw() { - pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); } void SDLGraphics::_endDraw() @@ -663,11 +663,11 @@ void SDLGraphics::_endDraw() popClipArea(); } -bool SDLGraphics::pushClipArea(gcn::Rectangle area) +bool SDLGraphics::pushClipArea(Rectangle area) { const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int32_t>(carea.x), @@ -686,7 +686,7 @@ void SDLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int32_t>(carea.x), @@ -703,7 +703,7 @@ void SDLGraphics::drawPoint(int x, int y) if (mClipStack.empty()) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); x += top.xOffset; y += top.yOffset; @@ -722,9 +722,9 @@ void SDLGraphics::drawPoint(int x, int y) } -void SDLGraphics::drawRectangle(const gcn::Rectangle &rectangle) +void SDLGraphics::drawRectangle(const Rectangle &rectangle) { - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); SDL_SetRenderDrawColor(mRenderer, mColor.r, mColor.g, mColor.b, mColor.a); @@ -746,7 +746,7 @@ void SDLGraphics::drawRectangle(const gcn::Rectangle &rectangle) void SDLGraphics::drawLine(int x1, int y1, int x2, int y2) { - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); SDL_SetRenderDrawColor(mRenderer, mColor.r, mColor.g, mColor.b, mColor.a); diff --git a/src/render/sdl2graphics.h b/src/render/sdl2graphics.h index 1e581dc39..cce15e270 100644 --- a/src/render/sdl2graphics.h +++ b/src/render/sdl2graphics.h @@ -101,7 +101,7 @@ class SDLGraphics final : public Graphics void _endDraw() override final; - bool pushClipArea(gcn::Rectangle rect) override final; + bool pushClipArea(Rectangle rect) override final; void popClipArea() override final; @@ -163,9 +163,9 @@ class SDLGraphics final : public Graphics const int w, const int h, const ImageRect &imgRect) override final; - void fillRectangle(const gcn::Rectangle &rect) override final; + void fillRectangle(const Rectangle &rect) override final; - void drawRectangle(const gcn::Rectangle &rect) override final; + void drawRectangle(const Rectangle &rect) override final; void drawPoint(int x, int y) override final; diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index e6cce9c35..05b1fa2ef 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -82,7 +82,7 @@ bool SDL2SoftwareGraphics::drawRescaledImage(const Image *const image, if (!tmpImage->mSDLSurface) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Rect srcRect = @@ -123,7 +123,7 @@ bool SDL2SoftwareGraphics::drawImageInline(const Image *const image, if (!mSurface || !image || !image->mSDLSurface) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Surface *const src = image->mSDLSurface; @@ -211,7 +211,7 @@ void SDL2SoftwareGraphics::drawImageCached(const Image *const image, if (!mSurface || !image || !image->mSDLSurface) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Surface *const src = image->mSDLSurface; @@ -307,7 +307,7 @@ void SDL2SoftwareGraphics::drawPatternCached(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -428,7 +428,7 @@ void SDL2SoftwareGraphics::drawPatternInline(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -547,7 +547,7 @@ void SDL2SoftwareGraphics::drawRescaledPattern(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -610,7 +610,7 @@ void SDL2SoftwareGraphics::calcPatternInline(ImageVertexes* const vert, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -695,7 +695,7 @@ void SDL2SoftwareGraphics::calcTileSDL(ImageVertexes *const vert, return; const Image *const image = vert->image; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; DoubleRect *rect = new DoubleRect(); @@ -917,15 +917,15 @@ int SDL2SoftwareGraphics::SDL_FakeUpperBlit(const SDL_Surface *const src, return 0; } -void SDL2SoftwareGraphics::fillRectangle(const gcn::Rectangle &rectangle) +void SDL2SoftwareGraphics::fillRectangle(const Rectangle &rectangle) { FUNC_BLOCK("Graphics::fillRectangle", 1) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); - gcn::Rectangle area = rectangle; + Rectangle area = rectangle; area.x += top.xOffset; area.y += top.yOffset; @@ -1117,7 +1117,7 @@ void SDL2SoftwareGraphics::fillRectangle(const gcn::Rectangle &rectangle) void SDL2SoftwareGraphics::_beginDraw() { - pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); } void SDL2SoftwareGraphics::_endDraw() @@ -1125,11 +1125,11 @@ void SDL2SoftwareGraphics::_endDraw() popClipArea(); } -bool SDL2SoftwareGraphics::pushClipArea(gcn::Rectangle area) +bool SDL2SoftwareGraphics::pushClipArea(Rectangle area) { const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int32_t>(carea.x), @@ -1148,7 +1148,7 @@ void SDL2SoftwareGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int32_t>(carea.x), @@ -1165,7 +1165,7 @@ void SDL2SoftwareGraphics::drawPoint(int x, int y) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); x += top.xOffset; y += top.yOffset; @@ -1184,7 +1184,7 @@ void SDL2SoftwareGraphics::drawHLine(int x1, int y, int x2) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); const int xOffset = top.xOffset; x1 += xOffset; @@ -1310,7 +1310,7 @@ void SDL2SoftwareGraphics::drawVLine(int x, int y1, int y2) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); const int yOffset = top.yOffset; x += top.xOffset; @@ -1440,7 +1440,7 @@ void SDL2SoftwareGraphics::drawVLine(int x, int y1, int y2) SDL_UnlockSurface(mSurface); } -void SDL2SoftwareGraphics::drawRectangle(const gcn::Rectangle &rectangle) +void SDL2SoftwareGraphics::drawRectangle(const Rectangle &rectangle) { const int x1 = rectangle.x; const int x2 = x1 + rectangle.width - 1; diff --git a/src/render/sdl2softwaregraphics.h b/src/render/sdl2softwaregraphics.h index 3ac6cb212..270536e11 100644 --- a/src/render/sdl2softwaregraphics.h +++ b/src/render/sdl2softwaregraphics.h @@ -58,7 +58,7 @@ class SDL2SoftwareGraphics final : public Graphics void _endDraw(); - bool pushClipArea(gcn::Rectangle rect); + bool pushClipArea(Rectangle rect); void popClipArea(); @@ -120,9 +120,9 @@ class SDL2SoftwareGraphics final : public Graphics const int w, const int h, const ImageRect &imgRect) override final; - void fillRectangle(const gcn::Rectangle &rect) override final; + void fillRectangle(const Rectangle &rect) override final; - void drawRectangle(const gcn::Rectangle &rect) override final; + void drawRectangle(const Rectangle &rect) override final; void drawPoint(int x, int y) override final; diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 2f4f6c0c2..9694eb0fb 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -76,7 +76,7 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, if (!tmpImage->mSDLSurface) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Rect srcRect = @@ -117,7 +117,7 @@ bool SDLGraphics::drawImageInline(const Image *const image, if (!mWindow || !image || !image->mSDLSurface) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Surface *const src = image->mSDLSurface; @@ -205,7 +205,7 @@ void SDLGraphics::drawImageCached(const Image *const image, if (!mWindow || !image || !image->mSDLSurface) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Surface *const src = image->mSDLSurface; @@ -301,7 +301,7 @@ void SDLGraphics::drawPatternCached(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -422,7 +422,7 @@ void SDLGraphics::drawPatternInline(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -541,7 +541,7 @@ void SDLGraphics::drawRescaledPattern(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -604,7 +604,7 @@ void SDLGraphics::calcPatternInline(ImageVertexes* const vert, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -688,7 +688,7 @@ void SDLGraphics::calcTileSDL(ImageVertexes *const vert, int x, int y) const return; const Image *const image = vert->image; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; DoubleRect *rect = new DoubleRect(); @@ -914,15 +914,15 @@ int SDLGraphics::SDL_FakeUpperBlit(const SDL_Surface *const src, return 0; } -void SDLGraphics::fillRectangle(const gcn::Rectangle& rectangle) +void SDLGraphics::fillRectangle(const Rectangle& rectangle) { FUNC_BLOCK("Graphics::fillRectangle", 1) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); - gcn::Rectangle area = rectangle; + Rectangle area = rectangle; area.x += top.xOffset; area.y += top.yOffset; @@ -1114,7 +1114,7 @@ void SDLGraphics::fillRectangle(const gcn::Rectangle& rectangle) void SDLGraphics::_beginDraw() { - pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); } void SDLGraphics::_endDraw() @@ -1122,10 +1122,10 @@ void SDLGraphics::_endDraw() popClipArea(); } -bool SDLGraphics::pushClipArea(gcn::Rectangle area) +bool SDLGraphics::pushClipArea(Rectangle area) { const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int16_t>(carea.x), @@ -1145,7 +1145,7 @@ void SDLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int16_t>(carea.x), @@ -1162,7 +1162,7 @@ void SDLGraphics::drawPoint(int x, int y) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); x += top.xOffset; y += top.yOffset; @@ -1181,7 +1181,7 @@ void SDLGraphics::drawHLine(int x1, int y, int x2) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); const int xOffset = top.xOffset; x1 += xOffset; @@ -1307,7 +1307,7 @@ void SDLGraphics::drawVLine(int x, int y1, int y2) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); const int yOffset = top.yOffset; x += top.xOffset; @@ -1437,7 +1437,7 @@ void SDLGraphics::drawVLine(int x, int y1, int y2) SDL_UnlockSurface(mWindow); } -void SDLGraphics::drawRectangle(const gcn::Rectangle &rectangle) +void SDLGraphics::drawRectangle(const Rectangle &rectangle) { const int x1 = rectangle.x; const int x2 = x1 + rectangle.width - 1; diff --git a/src/render/sdlgraphics.h b/src/render/sdlgraphics.h index 484b24e31..f5ca099de 100644 --- a/src/render/sdlgraphics.h +++ b/src/render/sdlgraphics.h @@ -58,7 +58,7 @@ class SDLGraphics final : public Graphics void _endDraw() override final; - bool pushClipArea(gcn::Rectangle rect) override final; + bool pushClipArea(Rectangle rect) override final; void popClipArea() override final; @@ -120,9 +120,9 @@ class SDLGraphics final : public Graphics const int w, const int h, const ImageRect &imgRect) override final; - void fillRectangle(const gcn::Rectangle &rect) override final; + void fillRectangle(const Rectangle &rect) override final; - void drawRectangle(const gcn::Rectangle &rect) override final; + void drawRectangle(const Rectangle &rect) override final; void drawPoint(int x, int y) override final; diff --git a/src/render/surfacegraphics.h b/src/render/surfacegraphics.h index c3e6cb2ee..cadd19876 100644 --- a/src/render/surfacegraphics.h +++ b/src/render/surfacegraphics.h @@ -63,7 +63,7 @@ class SurfaceGraphics final : public Graphics void _endDraw() override final { } - bool pushClipArea(gcn::Rectangle rect A_UNUSED) override final + bool pushClipArea(Rectangle rect A_UNUSED) override final { return true; } void popClipArea() override final @@ -158,10 +158,10 @@ class SurfaceGraphics final : public Graphics BlitMode getBlitMode() const A_WARN_UNUSED { return mBlitMode; } - void fillRectangle(const gcn::Rectangle &rect A_UNUSED) override final + void fillRectangle(const Rectangle &rect A_UNUSED) override final { } - void drawRectangle(const gcn::Rectangle &rect A_UNUSED) override final + void drawRectangle(const Rectangle &rect A_UNUSED) override final { } void drawPoint(int x A_UNUSED, int y A_UNUSED) override final |