summaryrefslogtreecommitdiff
path: root/src/actorsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-18 17:49:18 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-18 17:49:18 +0300
commit70b520b1e876f9698bb95baa2d274ea289a0c6bd (patch)
tree152c7519b0d9b8fb424af2373ec48db823a85575 /src/actorsprite.cpp
parent62ec17f6e489ec50f17219444468aeb8969dc961 (diff)
parent3b999f51c740d0541c53d223518e5e4bb482d996 (diff)
downloadplus-stripped1.1.9.18.tar.gz
plus-stripped1.1.9.18.tar.bz2
plus-stripped1.1.9.18.tar.xz
plus-stripped1.1.9.18.zip
Merge branch 'master' into strippedstripped1.1.9.18
Conflicts: src/guichan/cliprectangle.cpp src/guichan/focushandler.cpp src/guichan/gui.cpp src/guichan/include/guichan/cliprectangle.hpp src/guichan/include/guichan/inputevent.hpp src/guichan/include/guichan/keyevent.hpp src/guichan/include/guichan/mouseevent.hpp src/guichan/include/guichan/widgets/button.hpp src/guichan/include/guichan/widgets/checkbox.hpp src/guichan/include/guichan/widgets/dropdown.hpp src/guichan/include/guichan/widgets/radiobutton.hpp src/guichan/include/guichan/widgets/slider.hpp src/guichan/include/guichan/widgets/tab.hpp src/guichan/include/guichan/widgets/tabbedarea.hpp src/guichan/include/guichan/widgets/textfield.hpp src/guichan/include/guichan/widgets/window.hpp src/guichan/inputevent.cpp src/guichan/keyevent.cpp src/guichan/mouseevent.cpp src/guichan/widget.cpp src/guichan/widgets/button.cpp src/guichan/widgets/checkbox.cpp src/guichan/widgets/dropdown.cpp src/guichan/widgets/radiobutton.cpp src/guichan/widgets/slider.cpp src/guichan/widgets/tab.cpp src/guichan/widgets/tabbedarea.cpp src/guichan/widgets/textfield.cpp src/guichan/widgets/window.cpp
Diffstat (limited to 'src/actorsprite.cpp')
-rw-r--r--src/actorsprite.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/actorsprite.cpp b/src/actorsprite.cpp
index 2b133eca5..6155bb7af 100644
--- a/src/actorsprite.cpp
+++ b/src/actorsprite.cpp
@@ -68,9 +68,10 @@ ActorSprite::~ActorSprite()
// Notify listeners of the destruction.
for (ActorSpriteListenerIterator iter = mActorSpriteListeners.begin(),
- end = mActorSpriteListeners.end(); iter != end; ++iter)
+ e = mActorSpriteListeners.end(); iter != e; ++iter)
{
- (*iter)->actorSpriteDestroyed(*this);
+ if (*iter)
+ (*iter)->actorSpriteDestroyed(*this);
}
}
@@ -113,7 +114,7 @@ void ActorSprite::logic()
if (mMustResetParticles)
{
mMustResetParticles = false;
- for (std::set<int>::iterator it = mStatusEffects.begin();
+ for (std::set<int>::const_iterator it = mStatusEffects.begin();
it != mStatusEffects.end(); ++it)
{
const StatusEffect *effect
@@ -330,7 +331,7 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display,
}
// Ensure that something is shown, if desired
- if (size() == 0 && forceDisplay)
+ if (empty() && forceDisplay)
{
if (display.image.empty())
{
@@ -366,11 +367,12 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display,
//setup particle effects
if (Particle::enabled && particleEngine)
{
- std::vector<std::string>::const_iterator it, it_end;
- for (it = display.particles.begin(), it_end = display.particles.end();
- it != it_end; ++it)
+ std::vector<std::string>::const_iterator itr, itr_end;
+ for (itr = display.particles.begin(),
+ itr_end = display.particles.end();
+ itr != itr_end; ++itr)
{
- Particle *p = particleEngine->addEffect(*it, 0, 0);
+ Particle *p = particleEngine->addEffect(*itr, 0, 0);
controlParticle(p);
}
}
@@ -435,7 +437,7 @@ static const char *cursorSize(int size)
void ActorSprite::initTargetCursor()
{
- static std::string targetCursor = "graphics/target-cursor-%s-%s.png";
+ static std::string targetCursorFile = "graphics/target-cursor-%s-%s.png";
static int targetWidths[NUM_TC] = {44, 62, 82};
static int targetHeights[NUM_TC] = {35, 44, 60};
@@ -444,9 +446,9 @@ void ActorSprite::initTargetCursor()
{
for (int type = TCT_NORMAL; type < NUM_TCT; type++)
{
- loadTargetCursor(strprintf(targetCursor.c_str(), cursorType(type),
- cursorSize(size)), targetWidths[size],
- targetHeights[size], type, size);
+ loadTargetCursor(strprintf(targetCursorFile.c_str(),
+ cursorType(type), cursorSize(size)), targetWidths[size],
+ targetHeights[size], type, size);
}
}
}