From ab7cbe78ea676d5932881152631e6a6eafa530de Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 29 Jun 2014 23:14:53 +0300 Subject: Remove useless bool return value from renderers. --- src/render/sdlgraphics.cpp | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) (limited to 'src/render/sdlgraphics.cpp') diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index e9b6bef4a..a54087864 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -57,25 +57,21 @@ SDLGraphics::~SDLGraphics() { } -bool SDLGraphics::drawRescaledImage(const Image *const image, +void SDLGraphics::drawRescaledImage(const Image *const image, int dstX, int dstY, const int desiredWidth, const int desiredHeight) { FUNC_BLOCK("Graphics::drawRescaledImage", 1) // Check that preconditions for blitting are met. - if (!mWindow || !image) - return false; - if (!image->mSDLSurface) - return false; + if (!mWindow || !image || !image->mSDLSurface) + return; Image *const tmpImage = image->SDLgetScaledImage( desiredWidth, desiredHeight); - if (!tmpImage) - return false; - if (!tmpImage->mSDLSurface) - return false; + if (!tmpImage || !tmpImage->mSDLSurface) + return; const ClipRect &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; @@ -96,27 +92,23 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, 0 }; - const bool returnValue = !(SDL_BlitSurface(tmpImage->mSDLSurface, - &srcRect, mWindow, &dstRect) < 0); - + SDL_BlitSurface(tmpImage->mSDLSurface, &srcRect, mWindow, &dstRect); delete tmpImage; - - return returnValue; } -bool SDLGraphics::drawImage(const Image *const image, +void SDLGraphics::drawImage(const Image *const image, int dstX, int dstY) { - return drawImageInline(image, dstX, dstY); + drawImageInline(image, dstX, dstY); } -bool SDLGraphics::drawImageInline(const Image *const image, +void SDLGraphics::drawImageInline(const Image *const image, int dstX, int dstY) { FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. if (!mWindow || !image || !image->mSDLSurface) - return false; + return; const ClipRect &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; @@ -193,15 +185,14 @@ bool SDLGraphics::drawImageInline(const Image *const image, static_cast(h) }; - return SDL_LowerBlit(src, &srcRect, mWindow, &dstRect); + SDL_LowerBlit(src, &srcRect, mWindow, &dstRect); } - return 0; } -bool SDLGraphics::copyImage(const Image *const image, +void SDLGraphics::copyImage(const Image *const image, int dstX, int dstY) { - return drawImageInline(image, dstX, dstY); + drawImageInline(image, dstX, dstY); } void SDLGraphics::drawImageCached(const Image *const image, @@ -1119,9 +1110,9 @@ void SDLGraphics::endDraw() popClipArea(); } -bool SDLGraphics::pushClipArea(const Rect &area) +void SDLGraphics::pushClipArea(const Rect &area) { - const bool result = Graphics::pushClipArea(area); + Graphics::pushClipArea(area); const ClipRect &carea = mClipStack.top(); const SDL_Rect rect = { @@ -1131,8 +1122,6 @@ bool SDLGraphics::pushClipArea(const Rect &area) static_cast(carea.height) }; SDL_SetClipRect(mWindow, &rect); - - return result; } void SDLGraphics::popClipArea() -- cgit v1.2.3-70-g09d2