diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-28 00:39:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-28 11:04:23 +0300 |
commit | 0c35dab0ba366f85b40ef1795125521f1df8c264 (patch) | |
tree | dde6abde3288f543ae96a2468b2275af8a03e704 /src/being/compoundsprite.cpp | |
parent | 47cc515695fcd0b16467506e4984d2ec38fad4e4 (diff) | |
download | manaverse-0c35dab0ba366f85b40ef1795125521f1df8c264.tar.gz manaverse-0c35dab0ba366f85b40ef1795125521f1df8c264.tar.bz2 manaverse-0c35dab0ba366f85b40ef1795125521f1df8c264.tar.xz manaverse-0c35dab0ba366f85b40ef1795125521f1df8c264.zip |
simplify variables cleanup.
Diffstat (limited to 'src/being/compoundsprite.cpp')
-rw-r--r-- | src/being/compoundsprite.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp index 63dd32fec..6c159821d 100644 --- a/src/being/compoundsprite.cpp +++ b/src/being/compoundsprite.cpp @@ -36,6 +36,7 @@ #include "resources/image.h" #include "resources/imagehelper.h" +#include "utils/delete2.h" #include "utils/dtor.h" #include "utils/sdlcheckutils.h" #include "utils/timer.h" @@ -252,8 +253,7 @@ void CompoundSprite::removeSprite(const int layer) if (!mSprites.at(layer)) return; - delete mSprites.at(layer); - mSprites.at(layer) = nullptr; + delete2(mSprites.at(layer)); mNeedsRedraw = true; } @@ -268,8 +268,7 @@ void CompoundSprite::clear() mNeedsRedraw = true; delete_all(imagesCache); imagesCache.clear(); - delete mCacheItem; - mCacheItem = nullptr; + delete2(mCacheItem); } void CompoundSprite::ensureSize(size_t layerCount) @@ -361,8 +360,7 @@ void CompoundSprite::redraw() const drawSpritesSDL(graphics, posX, posY); - delete graphics; - graphics = nullptr; + delete2(graphics); SDL_Surface *const surfaceA = MSDL_CreateRGBSurface(SDL_HWSURFACE, BUFFER_WIDTH, BUFFER_HEIGHT, 32, rmask, gmask, bmask, amask); |