diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-03-18 17:48:29 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-03-18 17:49:00 +0200 |
commit | f98d003e354a1792117b7cbc771d1dd91475a156 (patch) | |
tree | dc2a297f7c4026394c9954ae4bfd4abd22ef9612 /src/being.cpp | |
parent | bb0a6cb25b2985fd1f74c9d27d5a46f6863e2dee (diff) | |
download | manaverse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.gz manaverse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.bz2 manaverse-f98d003e354a1792117b7cbc771d1dd91475a156.tar.xz manaverse-f98d003e354a1792117b7cbc771d1dd91475a156.zip |
Fix most old style cast except manaserv and libxml2 defines.
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/being.cpp b/src/being.cpp index 1d3b78293..8604f0053 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -340,8 +340,8 @@ void Being::setPosition(const Vector &pos) if (mText) { - mText->adviseXY((int)pos.x, - (int)pos.y - getHeight() - mText->getHeight() - 6); + mText->adviseXY(static_cast<int>(pos.x), static_cast<int>(pos.y) + - getHeight() - mText->getHeight() - 6); } } @@ -379,8 +379,8 @@ void Being::setDestination(int dstX, int dstY) { // If there is no path but the destination is on the same walkable tile, // we accept it. - if ((int)mPos.x / 32 == dest.x / 32 - && (int)mPos.y / 32 == dest.y / 32) + if (static_cast<int>(mPos.x) / 32 == dest.x / 32 + && static_cast<int>(mPos.y) / 32 == dest.y / 32) { mDest.x = static_cast<float>(dest.x); mDest.y = static_cast<float>(dest.y); @@ -1044,7 +1044,7 @@ void Being::nextTile() mX = pos.x; mY = pos.y; setAction(MOVE); - mActionTime += (int)(mWalkSpeed.x / 10); + mActionTime += static_cast<int>(mWalkSpeed.x / 10); } int Being::getCollisionRadius() const @@ -1162,9 +1162,9 @@ void Being::logic() case MOVE: { - if (getWalkSpeed().x - && (int) ((get_elapsed_time(mActionTime) * frameCount) - / getWalkSpeed().x) >= frameCount) + if (getWalkSpeed().x && static_cast<int> ((get_elapsed_time( + mActionTime) * frameCount) / getWalkSpeed().x) + >= frameCount) { nextTile(); } @@ -1249,7 +1249,7 @@ void Being::logic() if (!isAlive() && getWalkSpeed().x && Net::getGameHandler()->removeDeadBeings() - && (int) ((get_elapsed_time(mActionTime) + && static_cast<int> ((get_elapsed_time(mActionTime) / getWalkSpeed().x) >= static_cast<float>(frameCount))) { if (getType() != PLAYER && actorSpriteManager) @@ -1335,10 +1335,10 @@ int Being::getOffset(char pos, char neg) const if (mMap) { offset = (pos == LEFT && neg == RIGHT) ? - (int)((static_cast<float>(get_elapsed_time(mActionTime)) + static_cast<int>((static_cast<float>(get_elapsed_time(mActionTime)) * static_cast<float>(mMap->getTileWidth())) / static_cast<float>(mWalkSpeed.x)) : - (int)((static_cast<float>(get_elapsed_time(mActionTime)) + static_cast<int>((static_cast<float>(get_elapsed_time(mActionTime)) * static_cast<float>(mMap->getTileHeight())) / static_cast<float>(mWalkSpeed.y)); } |