diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-07 21:47:00 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-07 21:47:00 +0300 |
commit | 4f8e8c36290e46c00fa0266c4e4af553fac59a4c (patch) | |
tree | 618c1c9359a44aae173d5f7276e4bbfafccd7111 /src/gui | |
parent | b638b4ca0dbe20e83e30a18f30357ddcc85c64d8 (diff) | |
download | manaverse-4f8e8c36290e46c00fa0266c4e4af553fac59a4c.tar.gz manaverse-4f8e8c36290e46c00fa0266c4e4af553fac59a4c.tar.bz2 manaverse-4f8e8c36290e46c00fa0266c4e4af553fac59a4c.tar.xz manaverse-4f8e8c36290e46c00fa0266c4e4af553fac59a4c.zip |
Fix code style.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui.cpp | 1 | ||||
-rw-r--r-- | src/gui/outfitwindow.cpp | 8 | ||||
-rw-r--r-- | src/gui/outfitwindow.h | 2 | ||||
-rw-r--r-- | src/gui/whoisonline.cpp | 3 | ||||
-rw-r--r-- | src/gui/whoisonline.h | 3 | ||||
-rw-r--r-- | src/gui/widgets/browserbox_unittest.cc | 3 | ||||
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 4 |
7 files changed, 13 insertions, 11 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 95a94900a..d751c6ec0 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -761,7 +761,6 @@ void Gui::handleMouseReleased(const gcn::MouseInput &mouseInput) mouseInput.getButton(), mouseInput.getX(), mouseInput.getY()); - } } diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index 45ee8465f..ca3f504ad 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -487,12 +487,12 @@ void OutfitWindow::mouseReleased(gcn::MouseEvent &event) int OutfitWindow::getIndexFromGrid(const int pointX, const int pointY) const { - const gcn::Rectangle tRect = gcn::Rectangle( - mPadding, mTitleBarHeight, mGridWidth * mBoxWidth, mGridHeight * mBoxHeight); + const gcn::Rectangle tRect = gcn::Rectangle(mPadding, mTitleBarHeight, + mGridWidth * mBoxWidth, mGridHeight * mBoxHeight); if (!tRect.isPointInRect(pointX, pointY)) return -1; - const int index = (((pointY - mTitleBarHeight) / mBoxHeight) * mGridWidth) + - (pointX - mPadding) / mBoxWidth; + const int index = (((pointY - mTitleBarHeight) / mBoxHeight) * mGridWidth) + + (pointX - mPadding) / mBoxWidth; if (index >= static_cast<int>(OUTFIT_ITEM_COUNT) || index < 0) return -1; return index; diff --git a/src/gui/outfitwindow.h b/src/gui/outfitwindow.h index efb59346a..b756b1e75 100644 --- a/src/gui/outfitwindow.h +++ b/src/gui/outfitwindow.h @@ -111,8 +111,6 @@ class OutfitWindow final : public Window, int mBoxWidth; int mBoxHeight; - int mCursorPosX; - int mCursorPosY; int mGridWidth; int mGridHeight; diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp index 3e101338e..b2810aa0b 100644 --- a/src/gui/whoisonline.cpp +++ b/src/gui/whoisonline.cpp @@ -711,7 +711,8 @@ void WhoIsOnline::updateSize() mBrowserBox->setWidth(area.width - 10); } -const std::string WhoIsOnline::prepareNick(const std::string &nick, const int level, +const std::string WhoIsOnline::prepareNick(const std::string &nick, + const int level, const std::string &color) const { const std::string text = encodeLinkText(nick); diff --git a/src/gui/whoisonline.h b/src/gui/whoisonline.h index edbdc068c..8301897cb 100644 --- a/src/gui/whoisonline.h +++ b/src/gui/whoisonline.h @@ -171,7 +171,8 @@ private: FILE *stream); const std::string prepareNick(const std::string &nick, const int level, - const std::string &color) const A_WARN_UNUSED; + const std::string &color) + const A_WARN_UNUSED; void updateWindow(std::vector<OnlinePlayer*> &friends, std::vector<OnlinePlayer*> &neutral, diff --git a/src/gui/widgets/browserbox_unittest.cc b/src/gui/widgets/browserbox_unittest.cc index de42597e4..ad964eb2b 100644 --- a/src/gui/widgets/browserbox_unittest.cc +++ b/src/gui/widgets/browserbox_unittest.cc @@ -27,6 +27,8 @@ #include "gui/widgets/browserbox.h" +#include "resources/sdlimagehelper.h" + #include "gtest/gtest.h" #include <physfs.h> @@ -47,6 +49,7 @@ TEST(browserbox, test1) Client client(options); logger = new Logger(); + imageHelper = new SDLImageHelper(); Theme *theme = Theme::instance(); gcn::Widget::setGlobalFont(new SDLFont("/usr/share/fonts/truetype/" "ttf-dejavu/DejaVuSans-Oblique.ttf", 18)); diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index fb0093b7a..7f4846fce 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -534,8 +534,8 @@ void ItemContainer::updateMatrix() std::string temp = mName; toLower(temp); - const int invSize = mInventory->getSize(); - for (unsigned idx = 0; idx < invSize; idx ++) + const unsigned int invSize = mInventory->getSize(); + for (unsigned int idx = 0; idx < invSize; idx ++) { Item *const item = mInventory->getItem(idx); |