From b474de4a54c9b1d4d863971e40b807588d554436 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 24 Aug 2012 22:48:35 +0300 Subject: replace defines to consts. --- src/compoundsprite.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/compoundsprite.cpp') 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; } -- cgit v1.2.3-60-g2f50