diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-07 16:18:13 +0300 |
commit | 9fe21fcd8883b37bdc30224822e6e42afb35b8f0 (patch) | |
tree | 798117abd4dc7e610997d59d530a96ddc1509f53 /src/gui/windows/npcdialog.cpp | |
parent | 4429cb14e9e187edef27aba692a4266733f79c17 (diff) | |
download | plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.gz plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.bz2 plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.tar.xz plus-9fe21fcd8883b37bdc30224822e6e42afb35b8f0.zip |
Replace most static_cast<Type> to shorter versions from defines.
Diffstat (limited to 'src/gui/windows/npcdialog.cpp')
-rw-r--r-- | src/gui/windows/npcdialog.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index dc991097b..27386af5b 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -348,14 +348,14 @@ void NpcDialog::action(const ActionEvent &event) gui->resetClickCount(); const int selectedIndex = mItemList->getSelected(); - if (selectedIndex >= static_cast<int>(mItems.size()) + if (selectedIndex >= CAST_S32(mItems.size()) || selectedIndex < 0 || !PacketLimiter::limitPackets( PacketType::PACKET_NPC_INPUT)) { return; } - unsigned char choice = static_cast<unsigned char>( + unsigned char choice = CAST_U8( selectedIndex + 1); printText = mItems[selectedIndex]; @@ -678,7 +678,7 @@ void NpcDialog::closeDialog() int NpcDialog::getNumberOfElements() { - return static_cast<int>(mItems.size()); + return CAST_S32(mItems.size()); } std::string NpcDialog::getElementAt(int i) @@ -1118,7 +1118,7 @@ void NpcDialog::saveCamera() if (!viewport || mCameraMode >= 0) return; - mCameraMode = static_cast<int>(settings.cameraMode); + mCameraMode = CAST_S32(settings.cameraMode); mCameraX = viewport->getCameraRelativeX(); mCameraY = viewport->getCameraRelativeY(); } @@ -1128,7 +1128,7 @@ void NpcDialog::restoreCamera() if (!viewport || mCameraMode == -1) return; - if (static_cast<int>(settings.cameraMode) != mCameraMode) + if (CAST_S32(settings.cameraMode) != mCameraMode) viewport->toggleCameraMode(); if (mCameraMode) { @@ -1206,7 +1206,7 @@ void NpcDialog::logic() if (mShowAvatar && mAvatarBeing) { mAvatarBeing->logic(); - if (mPlayerBox->getWidth() < static_cast<signed>(3 * getPadding())) + if (mPlayerBox->getWidth() < CAST_S32(3 * getPadding())) { const Sprite *const sprite = mAvatarBeing->getSprite(0); if (sprite) |