diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-24 14:01:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-24 21:18:57 +0300 |
commit | 0a8b5d325f2d2c326b6da27399711b198417a499 (patch) | |
tree | 9e89aa7610f3f74ef9df53f6afce6655fc95ab07 /src/render | |
parent | 779b65f15d3350b2d95a095e24a90526c64dcecb (diff) | |
download | mv-0a8b5d325f2d2c326b6da27399711b198417a499.tar.gz mv-0a8b5d325f2d2c326b6da27399711b198417a499.tar.bz2 mv-0a8b5d325f2d2c326b6da27399711b198417a499.tar.xz mv-0a8b5d325f2d2c326b6da27399711b198417a499.zip |
Rename Rectangle into Rect.
Rename ClipRectangle into ClipRect.
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 bac987695..17f444eb8 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(Rectangle area) +bool Graphics::pushClipArea(Rect 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) { - ClipRectangle carea; + ClipRect carea; mClipStack.push(carea); return true; } if (mClipStack.empty()) { - ClipRectangle carea; + ClipRect carea; carea.x = area.x; carea.y = area.y; carea.width = area.width; @@ -572,8 +572,8 @@ bool Graphics::pushClipArea(Rectangle area) return true; } - const ClipRectangle &top = mClipStack.top(); - ClipRectangle carea; + const ClipRect &top = mClipStack.top(); + ClipRect 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 ClipRectangle *Graphics::getCurrentClipArea() const +const ClipRect *Graphics::getCurrentClipArea() const { if (mClipStack.empty()) return nullptr; diff --git a/src/render/graphics.h b/src/render/graphics.h index 14784a408..75b26a241 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -74,7 +74,7 @@ #include "render/renderers.h" -#include "gui/cliprectangle.h" +#include "gui/cliprect.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 Rectangle& rectangle) = 0; + virtual void fillRectangle(const Rect& 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); - ClipRectangle &getTopClip() A_WARN_UNUSED + ClipRect &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(Rectangle area); + virtual bool pushClipArea(Rect 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 Rectangle &rectangle) = 0; + virtual void drawRectangle(const Rect &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 ClipRectangle *getCurrentClipArea() const; + virtual const ClipRect *getCurrentClipArea() const; /** * Draws a single point/pixel. @@ -510,7 +510,7 @@ class Graphics /** * Holds the clip area stack. */ - std::stack<ClipRectangle> mClipStack; + std::stack<ClipRect> mClipStack; SDL_Window *mWindow; diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index b306cf021..6925f47d0 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(Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } void MobileOpenGLGraphics::_endDraw() @@ -951,21 +951,21 @@ SDL_Surface* MobileOpenGLGraphics::getScreenshot() return screenshot; } -bool MobileOpenGLGraphics::pushClipArea(Rectangle area) +bool MobileOpenGLGraphics::pushClipArea(Rect area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const ClipRectangle &clipArea = mClipStack.top(); + const ClipRect &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const ClipRectangle &clipArea = mClipStack.top(); + const ClipRect &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; @@ -986,7 +986,7 @@ void MobileOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const ClipRectangle &clipArea1 = mClipStack.top(); + const ClipRect &clipArea1 = mClipStack.top(); int transX = -clipArea1.xOffset; int transY = -clipArea1.yOffset; @@ -995,7 +995,7 @@ void MobileOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const ClipRectangle &clipArea = mClipStack.top(); + const ClipRect &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 Rectangle& rect) +void MobileOpenGLGraphics::drawRectangle(const Rect& rect) { drawRectangle(rect, false); } -void MobileOpenGLGraphics::fillRectangle(const Rectangle& rect) +void MobileOpenGLGraphics::fillRectangle(const Rect& rect) { drawRectangle(rect, true); } @@ -1090,7 +1090,7 @@ void MobileOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void MobileOpenGLGraphics::drawRectangle(const Rectangle& rect, +void MobileOpenGLGraphics::drawRectangle(const Rect& rect, const bool filled) { BLOCK_START("Graphics::drawRectangle") diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index 0a57c8341..916002f26 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -1145,7 +1145,7 @@ void NormalOpenGLGraphics::_beginDraw() #endif #endif - pushClipArea(Rectangle(0, 0, w, h)); + pushClipArea(Rect(0, 0, w, h)); } void NormalOpenGLGraphics::_endDraw() @@ -1211,21 +1211,21 @@ SDL_Surface* NormalOpenGLGraphics::getScreenshot() return screenshot; } -bool NormalOpenGLGraphics::pushClipArea(Rectangle area) +bool NormalOpenGLGraphics::pushClipArea(Rect area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const ClipRectangle &clipArea = mClipStack.top(); + const ClipRect &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const ClipRectangle &clipArea = mClipStack.top(); + const ClipRect &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; @@ -1247,7 +1247,7 @@ void NormalOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const ClipRectangle &clipArea1 = mClipStack.top(); + const ClipRect &clipArea1 = mClipStack.top(); int transX = -clipArea1.xOffset; int transY = -clipArea1.yOffset; @@ -1256,7 +1256,7 @@ void NormalOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const ClipRectangle &clipArea = mClipStack.top(); + const ClipRect &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 Rectangle& rect) +void NormalOpenGLGraphics::drawRectangle(const Rect& rect) { drawRectangle(rect, false); } -void NormalOpenGLGraphics::fillRectangle(const Rectangle& rect) +void NormalOpenGLGraphics::fillRectangle(const Rect& rect) { drawRectangle(rect, true); } @@ -1347,7 +1347,7 @@ void NormalOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void NormalOpenGLGraphics::drawRectangle(const Rectangle& rect, +void NormalOpenGLGraphics::drawRectangle(const Rect& rect, const bool filled) { BLOCK_START("Graphics::drawRectangle") diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index 8dd4ca91f..159ccea94 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -918,7 +918,7 @@ void NullOpenGLGraphics::updateScreen() void NullOpenGLGraphics::_beginDraw() { - pushClipArea(Rectangle(0, 0, 640, 480)); + pushClipArea(Rect(0, 0, 640, 480)); } void NullOpenGLGraphics::_endDraw() @@ -935,21 +935,21 @@ SDL_Surface* NullOpenGLGraphics::getScreenshot() return nullptr; } -bool NullOpenGLGraphics::pushClipArea(Rectangle area) +bool NullOpenGLGraphics::pushClipArea(Rect area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const ClipRectangle &clipArea = mClipStack.top(); + const ClipRect &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const ClipRectangle &clipArea = mClipStack.top(); + const ClipRect &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 Rectangle& rect) +void NullOpenGLGraphics::drawRectangle(const Rect& rect) { drawRectangle(rect, false); } -void NullOpenGLGraphics::fillRectangle(const Rectangle& rect) +void NullOpenGLGraphics::fillRectangle(const Rect& rect) { drawRectangle(rect, true); } @@ -1017,7 +1017,7 @@ void NullOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void NullOpenGLGraphics::drawRectangle(const Rectangle& rect A_UNUSED, +void NullOpenGLGraphics::drawRectangle(const Rect& 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 d3fcebf81..5e8e3390c 100644 --- a/src/render/openglgraphicsdef.hpp +++ b/src/render/openglgraphicsdef.hpp @@ -88,7 +88,7 @@ void _endDraw() override final; - bool pushClipArea(Rectangle area) override final; + bool pushClipArea(Rect 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 Rectangle &rect, + void drawRectangle(const Rect &rect, const bool filled); - void drawRectangle(const Rectangle &rect) override final; + void drawRectangle(const Rect &rect) override final; - void fillRectangle(const Rectangle &rect) override final; + void fillRectangle(const Rect &rect) override final; static void dumpSettings(); diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index 342495a47..a739a4904 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(Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } void SafeOpenGLGraphics::_endDraw() @@ -523,21 +523,21 @@ SDL_Surface* SafeOpenGLGraphics::getScreenshot() return screenshot; } -bool SafeOpenGLGraphics::pushClipArea(Rectangle area) +bool SafeOpenGLGraphics::pushClipArea(Rect area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const ClipRectangle &clipArea = mClipStack.top(); + const ClipRect &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const ClipRectangle &clipArea = mClipStack.top(); + const ClipRect &clipArea = mClipStack.top(); glPushMatrix(); glTranslatef(static_cast<GLfloat>(transX + clipArea.xOffset), @@ -557,7 +557,7 @@ void SafeOpenGLGraphics::popClipArea() return; glPopMatrix(); - const ClipRectangle &clipArea = mClipStack.top(); + const ClipRect &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 Rectangle& rect) +void SafeOpenGLGraphics::drawRectangle(const Rect& rect) { drawRectangle(rect, false); } -void SafeOpenGLGraphics::fillRectangle(const Rectangle& rect) +void SafeOpenGLGraphics::fillRectangle(const Rect& rect) { drawRectangle(rect, true); } @@ -661,7 +661,7 @@ void SafeOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void SafeOpenGLGraphics::drawRectangle(const Rectangle& rect, +void SafeOpenGLGraphics::drawRectangle(const Rect& rect, const bool filled) { BLOCK_START("Graphics::drawRectangle") diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index ac7d8debc..ebfcdb226 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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 Rectangle &rectangle) +void SDLGraphics::fillRectangle(const Rect &rectangle) { - const ClipRectangle &top = mClipStack.top(); + const ClipRect &top = mClipStack.top(); const SDL_Rect rect = { static_cast<int32_t>(rectangle.x + top.xOffset), @@ -655,7 +655,7 @@ void SDLGraphics::fillRectangle(const Rectangle &rectangle) void SDLGraphics::_beginDraw() { - pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } void SDLGraphics::_endDraw() @@ -663,11 +663,11 @@ void SDLGraphics::_endDraw() popClipArea(); } -bool SDLGraphics::pushClipArea(Rectangle area) +bool SDLGraphics::pushClipArea(Rect area) { const bool result = Graphics::pushClipArea(area); - const ClipRectangle &carea = mClipStack.top(); + const ClipRect &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 ClipRectangle &carea = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &top = mClipStack.top(); x += top.xOffset; y += top.yOffset; @@ -722,9 +722,9 @@ void SDLGraphics::drawPoint(int x, int y) } -void SDLGraphics::drawRectangle(const Rectangle &rectangle) +void SDLGraphics::drawRectangle(const Rect &rectangle) { - const ClipRectangle &top = mClipStack.top(); + const ClipRect &top = mClipStack.top(); SDL_SetRenderDrawColor(mRenderer, mColor.r, mColor.g, mColor.b, mColor.a); @@ -746,7 +746,7 @@ void SDLGraphics::drawRectangle(const Rectangle &rectangle) void SDLGraphics::drawLine(int x1, int y1, int x2, int y2) { - const ClipRectangle &top = mClipStack.top(); + const ClipRect &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 6631e53f4..15692bca9 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(Rectangle rect) override final; + bool pushClipArea(Rect 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 Rectangle &rect) override final; + void fillRectangle(const Rect &rect) override final; - void drawRectangle(const Rectangle &rect) override final; + void drawRectangle(const Rect &rect) override final; void drawPoint(int x, int y) override final; diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index 016a9557e..8fe83188f 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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 Rectangle &rectangle) +void SDL2SoftwareGraphics::fillRectangle(const Rect &rectangle) { FUNC_BLOCK("Graphics::fillRectangle", 1) if (mClipStack.empty()) return; - const ClipRectangle& top = mClipStack.top(); + const ClipRect& top = mClipStack.top(); - Rectangle area = rectangle; + Rect area = rectangle; area.x += top.xOffset; area.y += top.yOffset; @@ -1117,7 +1117,7 @@ void SDL2SoftwareGraphics::fillRectangle(const Rectangle &rectangle) void SDL2SoftwareGraphics::_beginDraw() { - pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } void SDL2SoftwareGraphics::_endDraw() @@ -1125,11 +1125,11 @@ void SDL2SoftwareGraphics::_endDraw() popClipArea(); } -bool SDL2SoftwareGraphics::pushClipArea(Rectangle area) +bool SDL2SoftwareGraphics::pushClipArea(Rect area) { const bool result = Graphics::pushClipArea(area); - const ClipRectangle &carea = mClipStack.top(); + const ClipRect &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 ClipRectangle &carea = mClipStack.top(); + const ClipRect &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 ClipRectangle& top = mClipStack.top(); + const ClipRect& 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 ClipRectangle& top = mClipStack.top(); + const ClipRect& 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 ClipRectangle& top = mClipStack.top(); + const ClipRect& 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 Rectangle &rectangle) +void SDL2SoftwareGraphics::drawRectangle(const Rect &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 1211de5eb..265c9349d 100644 --- a/src/render/sdl2softwaregraphics.h +++ b/src/render/sdl2softwaregraphics.h @@ -58,7 +58,7 @@ class SDL2SoftwareGraphics final : public Graphics void _endDraw(); - bool pushClipArea(Rectangle rect); + bool pushClipArea(Rect 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 Rectangle &rect) override final; + void fillRectangle(const Rect &rect) override final; - void drawRectangle(const Rectangle &rect) override final; + void drawRectangle(const Rect &rect) override final; void drawPoint(int x, int y) override final; diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 05c57a952..5d1589424 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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 ClipRectangle &top = mClipStack.top(); + const ClipRect &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 Rectangle& rectangle) +void SDLGraphics::fillRectangle(const Rect& rectangle) { FUNC_BLOCK("Graphics::fillRectangle", 1) if (mClipStack.empty()) return; - const ClipRectangle& top = mClipStack.top(); + const ClipRect& top = mClipStack.top(); - Rectangle area = rectangle; + Rect area = rectangle; area.x += top.xOffset; area.y += top.yOffset; @@ -1114,7 +1114,7 @@ void SDLGraphics::fillRectangle(const Rectangle& rectangle) void SDLGraphics::_beginDraw() { - pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rect(0, 0, mRect.w, mRect.h)); } void SDLGraphics::_endDraw() @@ -1122,10 +1122,10 @@ void SDLGraphics::_endDraw() popClipArea(); } -bool SDLGraphics::pushClipArea(Rectangle area) +bool SDLGraphics::pushClipArea(Rect area) { const bool result = Graphics::pushClipArea(area); - const ClipRectangle &carea = mClipStack.top(); + const ClipRect &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 ClipRectangle &carea = mClipStack.top(); + const ClipRect &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 ClipRectangle& top = mClipStack.top(); + const ClipRect& 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 ClipRectangle& top = mClipStack.top(); + const ClipRect& 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 ClipRectangle& top = mClipStack.top(); + const ClipRect& 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 Rectangle &rectangle) +void SDLGraphics::drawRectangle(const Rect &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 c8565f4be..170c0010b 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(Rectangle rect) override final; + bool pushClipArea(Rect 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 Rectangle &rect) override final; + void fillRectangle(const Rect &rect) override final; - void drawRectangle(const Rectangle &rect) override final; + void drawRectangle(const Rect &rect) override final; void drawPoint(int x, int y) override final; diff --git a/src/render/surfacegraphics.h b/src/render/surfacegraphics.h index 89de995ee..8e85356da 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(Rectangle rect A_UNUSED) override final + bool pushClipArea(Rect 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 Rectangle &rect A_UNUSED) override final + void fillRectangle(const Rect &rect A_UNUSED) override final { } - void drawRectangle(const Rectangle &rect A_UNUSED) override final + void drawRectangle(const Rect &rect A_UNUSED) override final { } void drawPoint(int x A_UNUSED, int y A_UNUSED) override final |