From c91a3307224f79d08f8f85787310aea6a5d03c5f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 31 May 2015 01:25:52 +0300 Subject: Move blitmode enum into separate file. --- src/render/surfacegraphics.cpp | 6 +++--- src/render/surfacegraphics.h | 14 +++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'src/render') diff --git a/src/render/surfacegraphics.cpp b/src/render/surfacegraphics.cpp index c74351b92..e94aba5a5 100644 --- a/src/render/surfacegraphics.cpp +++ b/src/render/surfacegraphics.cpp @@ -29,7 +29,7 @@ SurfaceGraphics::SurfaceGraphics() : Graphics(), - mBlitMode(BLIT_NORMAL), + mBlitMode(BlitMode::BLIT_NORMAL), mTarget(nullptr) { mOpenGL = RENDER_SOFTWARE; @@ -61,7 +61,7 @@ void SurfaceGraphics::drawImage(const Image *const image, #ifdef USE_SDL2 SDL_BlitSurface(image->mSDLSurface, &srcRect, mTarget, &dstRect); #else - if (mBlitMode == BLIT_NORMAL) + if (mBlitMode == BlitMode::BLIT_NORMAL) { SDL_BlitSurface(image->mSDLSurface, &srcRect, mTarget, &dstRect); } @@ -121,7 +121,7 @@ void SurfaceGraphics::drawImageCached(const Image *const image, #ifdef USE_SDL2 SDL_BlitSurface(image->mSDLSurface, &srcRect, mTarget, &dstRect); #else - if (mBlitMode == BLIT_NORMAL) + if (mBlitMode == BlitMode::BLIT_NORMAL) { SDL_BlitSurface(image->mSDLSurface, &srcRect, mTarget, &dstRect); } diff --git a/src/render/surfacegraphics.h b/src/render/surfacegraphics.h index 4a12f54d8..c8f5d3880 100644 --- a/src/render/surfacegraphics.h +++ b/src/render/surfacegraphics.h @@ -23,6 +23,8 @@ #ifndef RENDER_SURFACEGRAPHICS_H #define RENDER_SURFACEGRAPHICS_H +#include "enums/render/blitmode.h" + #include "render/graphics.h" #include "localconsts.h" @@ -39,12 +41,6 @@ struct SDL_Surface; class SurfaceGraphics final : public Graphics { public: - enum BlitMode - { - BLIT_NORMAL = 0, - BLIT_GFX - }; - SurfaceGraphics(); A_DELETE_COPY(SurfaceGraphics) @@ -152,10 +148,10 @@ class SurfaceGraphics final : public Graphics const ImageRect &imgRect A_UNUSED) override final { } - void setBlitMode(const BlitMode mode) + void setBlitMode(const BlitModeT mode) { mBlitMode = mode; } - BlitMode getBlitMode() const A_WARN_UNUSED + BlitModeT getBlitMode() const A_WARN_UNUSED { return mBlitMode; } void fillRectangle(const Rect &rect A_UNUSED) override final @@ -207,7 +203,7 @@ class SurfaceGraphics final : public Graphics { } protected: - BlitMode mBlitMode; + BlitModeT mBlitMode; SDL_Surface *mTarget; }; -- cgit v1.2.3-70-g09d2