diff options
-rw-r--r-- | src/dragdrop.h | 2 | ||||
-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 | ||||
-rw-r--r-- | src/resources/monsterdb.cpp | 1 | ||||
-rw-r--r-- | src/resources/npcdb.cpp | 1 | ||||
-rw-r--r-- | src/resources/npcdb.h | 2 |
11 files changed, 16 insertions, 14 deletions
diff --git a/src/dragdrop.h b/src/dragdrop.h index 6d45a69e1..d67c2623e 100644 --- a/src/dragdrop.h +++ b/src/dragdrop.h @@ -57,6 +57,8 @@ class DragDrop mItemImage->incRef(); } + A_DELETE_COPY(DragDrop) + ~DragDrop() { if (mItemImage) 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); diff --git a/src/resources/monsterdb.cpp b/src/resources/monsterdb.cpp index 9a47b7c61..3d6473fd6 100644 --- a/src/resources/monsterdb.cpp +++ b/src/resources/monsterdb.cpp @@ -244,7 +244,6 @@ void MonsterDB::loadXmlFile(const std::string &fileName) mMonsterInfos[XML::getProperty( monsterNode, "id", 0) + offset] = currentInfo; } - } void MonsterDB::unload() diff --git a/src/resources/npcdb.cpp b/src/resources/npcdb.cpp index fe10370a5..bafef22c8 100644 --- a/src/resources/npcdb.cpp +++ b/src/resources/npcdb.cpp @@ -136,7 +136,6 @@ void NPCDB::loadXmlFile(const std::string &fileName) currentInfo->setDisplay(display); mNPCInfos[id] = currentInfo; } - } void NPCDB::unload() diff --git a/src/resources/npcdb.h b/src/resources/npcdb.h index 83d938f5a..9614c2052 100644 --- a/src/resources/npcdb.h +++ b/src/resources/npcdb.h @@ -45,6 +45,6 @@ namespace NPCDB uint16_t getAvatarFor(const int id); void loadXmlFile(const std::string &fileName); -} +} // namespace NPCDB #endif // RESOURCES_NPCDB_H |