summaryrefslogtreecommitdiff
path: root/src/compoundsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-24 22:48:35 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-24 22:48:35 +0300
commitb474de4a54c9b1d4d863971e40b807588d554436 (patch)
tree761e71f86ea232d1688ee2838bd2294c59dea947 /src/compoundsprite.cpp
parenta316d537dce50f4b4e1e10f5c26a7851baddbd8b (diff)
downloadmv-b474de4a54c9b1d4d863971e40b807588d554436.tar.gz
mv-b474de4a54c9b1d4d863971e40b807588d554436.tar.bz2
mv-b474de4a54c9b1d4d863971e40b807588d554436.tar.xz
mv-b474de4a54c9b1d4d863971e40b807588d554436.zip
replace defines to consts.
Diffstat (limited to 'src/compoundsprite.cpp')
-rw-r--r--src/compoundsprite.cpp24
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;
}