From 9baedc27191c82bbf1fedee2a7e738bc5b267c0e Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sun, 2 May 2010 14:43:40 -0600 Subject: Add support for floor item sprites This commit adds a sprite hierarchy (Sprite->ImageSprite,AnimatedSprite,CompundSprite; CompoundSprite,Actor->ActorSprite;ActorSprite->Being,FloorItem) to collect common functionailty into new base classes which will make other Mantis tickets easier to do. Also allows monsters to use particle effects. Reviewed-by: Bertram --- src/animatedsprite.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/animatedsprite.cpp') diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index 59bf2f88..bc595f79 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -41,11 +41,12 @@ AnimatedSprite::AnimatedSprite(SpriteDef *sprite): mSprite(sprite), mAction(0), mAnimation(0), - mFrame(0), - mAlpha(1.0f) + mFrame(0) { assert(mSprite); + mAlpha = 1.0f; + // Take possession of the sprite mSprite->incRef(); @@ -193,3 +194,8 @@ int AnimatedSprite::getHeight() const else return 0; } + +Image* AnimatedSprite::getImage() const +{ + return mFrame ? mFrame->image : 0; +} -- cgit v1.2.3-70-g09d2