summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-24 18:28:47 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-24 21:06:51 +0300
commita306ecf96736779b08d1de7ec994d3d741d5dc61 (patch)
tree5a64809354d2c5f672a34fc9578975ab76920b5b /src/gui
parent6053e0797465a15da30b8d645c8ac7c95b596c69 (diff)
downloadmv-a306ecf96736779b08d1de7ec994d3d741d5dc61.tar.gz
mv-a306ecf96736779b08d1de7ec994d3d741d5dc61.tar.bz2
mv-a306ecf96736779b08d1de7ec994d3d741d5dc61.tar.xz
mv-a306ecf96736779b08d1de7ec994d3d741d5dc61.zip
fix code style.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/outfitwindow.cpp3
-rw-r--r--src/gui/selldialog.cpp12
-rw-r--r--src/gui/setup_video.h3
-rw-r--r--src/gui/viewport.cpp4
4 files changed, 9 insertions, 13 deletions
diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp
index f548116f6..dbe084c17 100644
--- a/src/gui/outfitwindow.cpp
+++ b/src/gui/outfitwindow.cpp
@@ -260,13 +260,12 @@ void OutfitWindow::wearOutfit(const int outfit, const bool unwearEmpty,
{
bool isEmpty = true;
- const Item *item;
if (outfit < 0 || outfit > static_cast<int>(OUTFITS_COUNT))
return;
for (unsigned i = 0; i < OUTFIT_ITEM_COUNT; i++)
{
- item = PlayerInfo::getInventory()->findItem(
+ const Item *const item = PlayerInfo::getInventory()->findItem(
mItems[outfit][i], mItemColors[outfit][i]);
if (item && !item->isEquipped() && item->getQuantity())
{
diff --git a/src/gui/selldialog.cpp b/src/gui/selldialog.cpp
index cb9a5abf8..e9ec38423 100644
--- a/src/gui/selldialog.cpp
+++ b/src/gui/selldialog.cpp
@@ -226,7 +226,6 @@ void SellDialog::action(const gcn::ActionEvent &event)
{
// Attempt sell
ShopItem *const item = mShopItems->at(selectedItem);
- int sellCount, itemIndex;
mPlayerMoney +=
mAmountItems * mShopItems->at(selectedItem)->getPrice();
mMaxItems -= mAmountItems;
@@ -234,16 +233,17 @@ void SellDialog::action(const gcn::ActionEvent &event)
{
// This order is important, item->getCurrentInvIndex() would return
// the inventory index of the next Duplicate otherwise.
- itemIndex = item->getCurrentInvIndex();
- sellCount = item->sellCurrentDuplicate(mAmountItems);
-
+ const int sellCount = item->sellCurrentDuplicate(mAmountItems);
#ifdef MANASERV_SUPPORT
+ int itemIndex = item->getCurrentInvIndex();
// For Manaserv, the Item id is to be given as index.
if ((Net::getNetworkType() == ServerInfo::MANASERV))
itemIndex = item->getId();
-#endif
-
Net::getNpcHandler()->sellItem(mNpcId, itemIndex, sellCount);
+#else
+ Net::getNpcHandler()->sellItem(mNpcId,
+ item->getCurrentInvIndex(), sellCount);
+#endif
mAmountItems -= sellCount;
}
diff --git a/src/gui/setup_video.h b/src/gui/setup_video.h
index 8ccfa5bb2..dc1a180b3 100644
--- a/src/gui/setup_video.h
+++ b/src/gui/setup_video.h
@@ -70,9 +70,6 @@ class Setup_Video final : public SetupTab, public gcn::KeyListener
OpenGLListModel *mOpenGLListModel;
- Label *scrollRadiusLabel;
- Label *scrollLazinessLabel;
-
ListBox *mModeList;
CheckBox *mFsCheckBox;
DropDown *mOpenGLDropDown;
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 2e4ff851b..e7e0a2766 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -152,10 +152,10 @@ void Viewport::draw(gcn::Graphics *gcnGraphics)
if (mScrollLaziness < 1)
mScrollLaziness = 1; // Avoids division by zero
- int cnt = 0;
-
if (mEnableLazyScrolling)
{
+ int cnt = 0;
+
// Apply lazy scrolling
while (lastTick < tick_time && cnt < 32)
{