diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-11 17:00:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-11 17:00:44 +0300 |
commit | 10cf17f8d83d2d925641f722acc004828dba3094 (patch) | |
tree | 46a746d5bfe79e067cd25a3caca476ecbafa0af5 /src/being | |
parent | 77bb74bd2d944be1a1dc719027dbf37ad088b828 (diff) | |
download | mv-10cf17f8d83d2d925641f722acc004828dba3094.tar.gz mv-10cf17f8d83d2d925641f722acc004828dba3094.tar.bz2 mv-10cf17f8d83d2d925641f722acc004828dba3094.tar.xz mv-10cf17f8d83d2d925641f722acc004828dba3094.zip |
Move blockmask into separate file.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 22 | ||||
-rw-r--r-- | src/being/localplayer.cpp | 2 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 386c07e92..c9af368b2 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1004,11 +1004,11 @@ std::string Being::getSitAction() const if (mMap) { const unsigned char mask = mMap->getBlockMask(mX, mY); - if (mask & Map::BLOCKMASK_GROUNDTOP) + if (mask & BlockMask::GROUNDTOP) return SpriteAction::SITTOP; - else if (mask & Map::BLOCKMASK_AIR) + else if (mask & BlockMask::AIR) return SpriteAction::SITSKY; - else if (mask & Map::BLOCKMASK_WATER) + else if (mask & BlockMask::WATER) return SpriteAction::SITWATER; } return SpriteAction::SIT; @@ -1027,9 +1027,9 @@ std::string Being::getMoveAction() const if (mMap) { const unsigned char mask = mMap->getBlockMask(mX, mY); - if (mask & Map::BLOCKMASK_AIR) + if (mask & BlockMask::AIR) return SpriteAction::FLY; - else if (mask & Map::BLOCKMASK_WATER) + else if (mask & BlockMask::WATER) return SpriteAction::SWIM; } return SpriteAction::MOVE; @@ -1050,9 +1050,9 @@ std::string Being::getWeaponAttackAction(const ItemInfo *const weapon) const if (mMap) { const unsigned char mask = mMap->getBlockMask(mX, mY); - if (mask & Map::BLOCKMASK_AIR) + if (mask & BlockMask::AIR) return weapon->getSkyAttackAction(); - else if (mask & Map::BLOCKMASK_WATER) + else if (mask & BlockMask::WATER) return weapon->getWaterAttackAction(); } return weapon->getAttackAction(); @@ -1073,9 +1073,9 @@ std::string Being::getAttackAction(const Attack *const attack1) const if (mMap) { const unsigned char mask = mMap->getBlockMask(mX, mY); - if (mask & Map::BLOCKMASK_AIR) + if (mask & BlockMask::AIR) return attack1->mSkyAction; - else if (mask & Map::BLOCKMASK_WATER) + else if (mask & BlockMask::WATER) return attack1->mWaterAction; } return attack1->mAction; @@ -1094,9 +1094,9 @@ std::string Being::getAttackAction(const Attack *const attack1) const if (mMap) \ { \ const unsigned char mask = mMap->getBlockMask(mX, mY); \ - if (mask & Map::BLOCKMASK_AIR) \ + if (mask & BlockMask::AIR) \ return SpriteAction::action##SKY; \ - else if (mask & Map::BLOCKMASK_WATER) \ + else if (mask & BlockMask::WATER) \ return SpriteAction::action##WATER; \ } \ return SpriteAction::action; \ diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 94edde0ab..7efaaa907 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -3689,7 +3689,7 @@ void LocalPlayer::resetYellowBar() unsigned char LocalPlayer::getWalkMask() const { // for now blocking all types of collisions - return Map::BLOCKMASK_WALL | Map::BLOCKMASK_AIR | Map::BLOCKMASK_WATER; + return BlockMask::WALL | BlockMask::AIR | BlockMask::WATER; } void LocalPlayer::removeHome() |