summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-04-22 07:15:35 -0600
committerJared Adams <jaxad0127@gmail.com>2010-04-23 08:33:25 -0600
commitc22ea2f169f58e765fc699fcd71bfd3a3cd4f859 (patch)
tree9e19b57d562d3fe24cd69e6441db41162aa6d3e4 /src/being.cpp
parent93d4de19fdffb6d568c907729449f169c3520c7b (diff)
downloadmana-c22ea2f169f58e765fc699fcd71bfd3a3cd4f859.tar.gz
mana-c22ea2f169f58e765fc699fcd71bfd3a3cd4f859.tar.bz2
mana-c22ea2f169f58e765fc699fcd71bfd3a3cd4f859.tar.xz
mana-c22ea2f169f58e765fc699fcd71bfd3a3cd4f859.zip
Add an Actor class to replace the Sprite class
The Actor class manages the Map reference, position vector, and alpha float. These are the common parts from it's children.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 5c737c0c..40a6befd 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -78,13 +78,11 @@ Being::Being(int id, int subtype, Map *map):
mId(id),
mDirection(DOWN),
mSpriteDirection(DIRECTION_DOWN),
- mMap(NULL),
mDispName(0),
mShowName(false),
mEquippedWeapon(NULL),
mText(0),
mStunMode(0),
- mAlpha(1.0f),
mStatusParticleEffects(&mStunParticleEffects, false),
mChildParticleEffects(&mStatusParticleEffects, false),
mMustResetParticles(false),
@@ -109,8 +107,6 @@ Being::~Being()
if (player_node && player_node->getTarget() == this)
player_node->setTarget(NULL);
- setMap(NULL);
-
delete mSpeechBubble;
delete mDispName;
delete mText;
@@ -118,7 +114,7 @@ Being::~Being()
void Being::setPosition(const Vector &pos)
{
- mPos = pos;
+ Actor::setPosition(pos);
updateCoords();
@@ -362,15 +358,7 @@ void Being::setGuildPos(const std::string &pos)
void Being::setMap(Map *map)
{
- // Remove sprite from potential previous map
- if (mMap)
- mMap->removeSprite(mMapSprite);
-
- mMap = map;
-
- // Add sprite to potential new map
- if (mMap)
- mMapSprite = mMap->addSprite(this);
+ Actor::setMap(map);
// Clear particle effect list because child particles became invalid
mChildParticleEffects.clear();