diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-05-20 01:35:17 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-05-20 12:25:37 -0600 |
commit | 487a86fe7dc9904f445d91667095f641f72f7c81 (patch) | |
tree | 57191d175f7b2fe771f6b2da225bc2d9cb5ff1d9 /src/actorsprite.cpp | |
parent | 36832f3a5378f739da7040f0711b7101dbc2af02 (diff) | |
download | mana-487a86fe7dc9904f445d91667095f641f72f7c81.tar.gz mana-487a86fe7dc9904f445d91667095f641f72f7c81.tar.bz2 mana-487a86fe7dc9904f445d91667095f641f72f7c81.tar.xz mana-487a86fe7dc9904f445d91667095f641f72f7c81.zip |
Buffer layered sprites under SDL
This improves framerate and allows transparent overlay for complex
sprites. Two copies of the buffer are kept, one at full opacity,
one with variable opactiy, to reduce calls to setAlpha.
Reviewed-by: Bertram
Diffstat (limited to 'src/actorsprite.cpp')
-rw-r--r-- | src/actorsprite.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/actorsprite.cpp b/src/actorsprite.cpp index da81873f..92894b04 100644 --- a/src/actorsprite.cpp +++ b/src/actorsprite.cpp @@ -304,14 +304,14 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display, { std::string file = "graphics/sprites/" + (*it)->sprite; int variant = (*it)->variant; - push_back(AnimatedSprite::load(file, variant)); + addSprite(AnimatedSprite::load(file, variant)); } // Ensure that something is shown, if desired if (size() == 0 && forceDisplay) { if (display.image.empty()) - push_back(AnimatedSprite::load("graphics/sprites/error.xml")); + addSprite(AnimatedSprite::load("graphics/sprites/error.xml")); else { ResourceManager *resman = ResourceManager::getInstance(); @@ -321,7 +321,7 @@ void ActorSprite::setupSpriteDisplay(const SpriteDisplay &display, if (!img) img = Theme::getImageFromTheme("unknown-item.png"); - push_back(new ImageSprite(img)); + addSprite(new ImageSprite(img)); } } |