diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-05-31 01:25:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-05-31 01:25:52 +0300 |
commit | c91a3307224f79d08f8f85787310aea6a5d03c5f (patch) | |
tree | b6e2551e758b802a7439bd7cb77a169b27a7e43d /src | |
parent | f363a257dac02ca844677e7cf258a57b0f34cb8d (diff) | |
download | manaplus-c91a3307224f79d08f8f85787310aea6a5d03c5f.tar.gz manaplus-c91a3307224f79d08f8f85787310aea6a5d03c5f.tar.bz2 manaplus-c91a3307224f79d08f8f85787310aea6a5d03c5f.tar.xz manaplus-c91a3307224f79d08f8f85787310aea6a5d03c5f.zip |
Move blitmode enum into separate file.
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/being/compoundsprite.cpp | 2 | ||||
-rw-r--r-- | src/enums/render/blitmode.h | 37 | ||||
-rw-r--r-- | src/render/surfacegraphics.cpp | 6 | ||||
-rw-r--r-- | src/render/surfacegraphics.h | 14 |
6 files changed, 48 insertions, 13 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cf2436da1..af5eb8b2b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -995,6 +995,7 @@ SET(SRCS render/renderers.h render/rendererslistsdl.h render/rendererslistsdl2.h + enums/render/blitmode.h enums/render/rendertype.h particle/particle.cpp particle/particle.h diff --git a/src/Makefile.am b/src/Makefile.am index c53304bdb..a3cfe0558 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1128,6 +1128,7 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ render/renderers.h \ render/rendererslistsdl.h \ render/rendererslistsdl2.h \ + enums/render/blitmode.h \ enums/render/rendertype.h \ particle/particle.cpp \ particle/particle.h \ diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp index ed8aacbe9..98313cc15 100644 --- a/src/being/compoundsprite.cpp +++ b/src/being/compoundsprite.cpp @@ -340,7 +340,7 @@ void CompoundSprite::redraw() const return; SurfaceGraphics *graphics = new SurfaceGraphics(); - graphics->setBlitMode(SurfaceGraphics::BLIT_GFX); + graphics->setBlitMode(BlitMode::BLIT_GFX); graphics->setTarget(surface); graphics->beginDraw(); diff --git a/src/enums/render/blitmode.h b/src/enums/render/blitmode.h new file mode 100644 index 000000000..2bac6334b --- /dev/null +++ b/src/enums/render/blitmode.h @@ -0,0 +1,37 @@ +/* + * The ManaPlus Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2015 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef ENUMS_RENDER_BLITMODE_H +#define ENUMS_RENDER_BLITMODE_H + +namespace BlitMode +{ + enum T + { + BLIT_NORMAL = 0, + BLIT_GFX + }; +} // namespace BlitMode + +typedef BlitMode::T BlitModeT; + +#endif // ENUMS_RENDER_BLITMODE_H 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; }; |