diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-12-28 23:52:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-12-28 23:52:14 +0300 |
commit | 3790bff33c3a05c5895dab6c21761253f640a395 (patch) | |
tree | b41c94ded84044056235ad7aeee2c4e9f92d3d43 /src/being/being.cpp | |
parent | 13f0d3f3c5725dd5838bf425760d82484fcfad25 (diff) | |
download | manaplus-3790bff33c3a05c5895dab6c21761253f640a395.tar.gz manaplus-3790bff33c3a05c5895dab6c21761253f640a395.tar.bz2 manaplus-3790bff33c3a05c5895dab6c21761253f640a395.tar.xz manaplus-3790bff33c3a05c5895dab6c21761253f640a395.zip |
Use templated parameters in Being::getOffset.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r-- | src/being/being.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 56d6aa9c6..f2a3f26e9 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1858,10 +1858,10 @@ void Being::logic() restrict2 if (mAction == BeingAction::MOVE || mNeedPosUpdate) { - const int xOffset = getOffset( - BeingDirection::LEFT, BeingDirection::RIGHT); - const int yOffset = getOffset( - BeingDirection::UP, BeingDirection::DOWN); + const int xOffset = getOffset<BeingDirection::LEFT, + BeingDirection::RIGHT>(); + const int yOffset = getOffset<BeingDirection::UP, + BeingDirection::DOWN>(); int offset = xOffset; if (!offset) offset = yOffset; @@ -2343,8 +2343,8 @@ void Being::drawSpeech(const int offsetX, } } -int Being::getOffset(const signed char pos, - const signed char neg) const restrict2 +template<signed char pos, signed char neg> +int Being::getOffset() const restrict2 { // Check whether we're walking in the requested direction if (mAction != BeingAction::MOVE || !(mDirection & (pos | neg))) |