diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-24 22:48:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-24 22:48:35 +0300 |
commit | b474de4a54c9b1d4d863971e40b807588d554436 (patch) | |
tree | 761e71f86ea232d1688ee2838bd2294c59dea947 /src/compoundsprite.cpp | |
parent | a316d537dce50f4b4e1e10f5c26a7851baddbd8b (diff) | |
download | plus-b474de4a54c9b1d4d863971e40b807588d554436.tar.gz plus-b474de4a54c9b1d4d863971e40b807588d554436.tar.bz2 plus-b474de4a54c9b1d4d863971e40b807588d554436.tar.xz plus-b474de4a54c9b1d4d863971e40b807588d554436.zip |
replace defines to consts.
Diffstat (limited to 'src/compoundsprite.cpp')
-rw-r--r-- | src/compoundsprite.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index 53caedc47..1ac054bbb 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -41,8 +41,8 @@ #include "debug.h" -#define BUFFER_WIDTH 100 -#define BUFFER_HEIGHT 100 +static const int BUFFER_WIDTH = 100; +static const int BUFFER_HEIGHT = 100; static const unsigned cache_max_size = 10; static const unsigned cache_clean_part = 3; @@ -175,13 +175,13 @@ int CompoundSprite::getWidth() const for (SpriteConstIterator it = mSprites.begin(), it_end = mSprites.end(); it != it_end; ++ it) { - if (base = *it) - break; + if ((base = *it)) + { + if (base) + return base->getWidth(); + } } - if (base) - return base->getWidth(); - return 0; } @@ -192,13 +192,13 @@ int CompoundSprite::getHeight() const for (SpriteConstIterator it = mSprites.begin(), it_end = mSprites.end(); it != it_end; ++ it) { - if (base = *it) - break; + if ((base = *it)) + { + if (base) + return base->getHeight(); + } } - if (base) - return base->getHeight(); - return 0; } |