diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-28 15:46:02 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-28 16:41:19 +0300 |
commit | f146cd42ce84a08879eb286ecd2ed2aa8ad82300 (patch) | |
tree | f689f832f54f361be8cff61deb47c0e32febd486 | |
parent | 409cee51fe11e2495a2741226432666a8702dceb (diff) | |
download | manaplus-f146cd42ce84a08879eb286ecd2ed2aa8ad82300.tar.gz manaplus-f146cd42ce84a08879eb286ecd2ed2aa8ad82300.tar.bz2 manaplus-f146cd42ce84a08879eb286ecd2ed2aa8ad82300.tar.xz manaplus-f146cd42ce84a08879eb286ecd2ed2aa8ad82300.zip |
fix code style.
54 files changed, 64 insertions, 148 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp index 72ab8c21c..bc325abe8 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -1256,7 +1256,7 @@ void ActorManager::printAllToChat() const } void ActorManager::printBeingsToChat(const ActorSprites &beings, - const std::string &header) const + const std::string &header) { if (!debugChatTab) return; @@ -1281,7 +1281,7 @@ void ActorManager::printBeingsToChat(const ActorSprites &beings, } void ActorManager::printBeingsToChat(const std::vector<Being*> &beings, - const std::string &header) const + const std::string &header) { if (!debugChatTab) return; diff --git a/src/actormanager.h b/src/actormanager.h index 17bd696d6..f7e306b2a 100644 --- a/src/actormanager.h +++ b/src/actormanager.h @@ -211,11 +211,11 @@ class ActorManager final: public ConfigListener void printAllToChat() const; - void printBeingsToChat(const ActorSprites &beings, - const std::string &header) const; + static void printBeingsToChat(const ActorSprites &beings, + const std::string &header); - void printBeingsToChat(const std::vector<Being*> &beings, - const std::string &header) const; + static void printBeingsToChat(const std::vector<Being*> &beings, + const std::string &header); void getPlayerNames(StringVect &names, const bool npcNames) const; diff --git a/src/commands.cpp b/src/commands.cpp index d4134c560..0cc5cee8a 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -1339,7 +1339,7 @@ static void uploadFile(const std::string &str, upload->start(); } -impHandler0(uploadConfig) +impHandler2(uploadConfig) { uploadFile(_("Uploaded config into:"), config.getFileName(), @@ -1347,7 +1347,7 @@ impHandler0(uploadConfig) tab); } -impHandler0(uploadServerConfig) +impHandler2(uploadServerConfig) { uploadFile(_("Uploaded server config into:"), serverConfig.getFileName(), @@ -1355,7 +1355,7 @@ impHandler0(uploadServerConfig) tab); } -impHandler0(uploadLog) +impHandler2(uploadLog) { uploadFile(_("Uploaded log into:"), client->getLogFileName(), diff --git a/src/gui/base/basiccontainer.cpp b/src/gui/base/basiccontainer.cpp index e854e15ff..f323366ad 100644 --- a/src/gui/base/basiccontainer.cpp +++ b/src/gui/base/basiccontainer.cpp @@ -69,8 +69,6 @@ #include <algorithm> -#include "render/graphics.h" - #include "debug.h" namespace gcn diff --git a/src/gui/cliprect.h b/src/gui/cliprect.h index 3bbf5e47e..88a7ab5a4 100644 --- a/src/gui/cliprect.h +++ b/src/gui/cliprect.h @@ -61,8 +61,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef GUI_CLIPRECTANGLE_H -#define GUI_CLIPRECTANGLE_H +#ifndef GUI_CLIPRECT_H +#define GUI_CLIPRECT_H #include "gui/rect.h" @@ -97,11 +97,11 @@ class ClipRect final : public Rect * the relative screen coordinate. */ ClipRect(const int x0, - const int y0, - const int width0, - const int height0, - const int xOffset0, - const int yOffset0); + const int y0, + const int width0, + const int height0, + const int xOffset0, + const int yOffset0); /** * Copy constructor. Copies x, y, width and height @@ -123,4 +123,4 @@ class ClipRect final : public Rect int yOffset; }; -#endif // GUI_CLIPRECTANGLE_H +#endif // GUI_CLIPRECT_H diff --git a/src/gui/color.cpp b/src/gui/color.cpp index 9a0034257..aa9ffe840 100644 --- a/src/gui/color.cpp +++ b/src/gui/color.cpp @@ -86,9 +86,9 @@ Color::Color(const unsigned int color) : } Color::Color(const unsigned int ar, - const unsigned int ag, - const unsigned int ab, - const unsigned int aa) : + const unsigned int ag, + const unsigned int ab, + const unsigned int aa) : r(ar), g(ag), b(ab), @@ -149,7 +149,7 @@ bool Color::operator!=(const Color& color) const } std::ostream& operator<<(std::ostream& out, - const Color& color) + const Color& color) { out << "Color [r = " << color.r diff --git a/src/gui/color.h b/src/gui/color.h index 646680d96..db8fda970 100644 --- a/src/gui/color.h +++ b/src/gui/color.h @@ -81,7 +81,8 @@ class Color final /** * Constructor. Constructs a color from the bytes in an integer. - * Call it with a hexadecimal constant for HTML-style color representation. + * Call it with a hexadecimal constant for HTML-style color + * representation. * The alpha component is 255 by default. * * EXAMPLE: Color(0xff50a0) constructs a very nice pinkish color. diff --git a/src/gui/focushandler.h b/src/gui/focushandler.h index ed3a08e98..f12819e75 100644 --- a/src/gui/focushandler.h +++ b/src/gui/focushandler.h @@ -335,7 +335,7 @@ class FocusHandler final * @param focusEvent the event to distribute. * @since 0.7.0 */ - void distributeFocusLostEvent(const Event& focusEvent); + static void distributeFocusLostEvent(const Event& focusEvent); /** * Distributes a focus gained event. @@ -343,7 +343,7 @@ class FocusHandler final * @param focusEvent the event to distribute. * @since 0.7.0 */ - void distributeFocusGainedEvent(const Event& focusEvent); + static void distributeFocusGainedEvent(const Event& focusEvent); /** * Typedef. diff --git a/src/gui/font.h b/src/gui/font.h index bdf81dadc..12ba473d8 100644 --- a/src/gui/font.h +++ b/src/gui/font.h @@ -76,6 +76,7 @@ #include "localconsts.h" +class Color; class Graphics; class Image; diff --git a/src/gui/models/ignorechoiceslistmodel.h b/src/gui/models/ignorechoiceslistmodel.h index 7234b57f2..8ba3eadb1 100644 --- a/src/gui/models/ignorechoiceslistmodel.h +++ b/src/gui/models/ignorechoiceslistmodel.h @@ -38,8 +38,8 @@ class IgnoreChoicesListModel final : public ListModel int getNumberOfElements() override final { - return static_cast<int>(player_relations.getPlayerIgnoreStrategies( - )->size()); + return static_cast<int>(player_relations. + getPlayerIgnoreStrategies()->size()); } std::string getElementAt(int i) override final diff --git a/src/gui/models/playerrelationlistmodel.h b/src/gui/models/playerrelationlistmodel.h index 9251631f7..bc343de02 100644 --- a/src/gui/models/playerrelationlistmodel.h +++ b/src/gui/models/playerrelationlistmodel.h @@ -64,4 +64,4 @@ class PlayerRelationListModel final : public ListModel } }; -#endif +#endif // GUI_MODELS_PLAYERRELATIONLISTMODEL_H diff --git a/src/gui/models/soundsmodel.h b/src/gui/models/soundsmodel.h index 2f645e666..3ac679d37 100644 --- a/src/gui/models/soundsmodel.h +++ b/src/gui/models/soundsmodel.h @@ -19,6 +19,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#ifndef GUI_MODELS_SOUNDSMODEL_H +#define GUI_MODELS_SOUNDSMODEL_H + #include "gui/theme.h" #include "gui/models/namesmodel.h" @@ -40,3 +43,5 @@ class SoundsModel final : public NamesModel ~SoundsModel() { } }; + +#endif // GUI_MODELS_SOUNDSMODEL_H diff --git a/src/gui/models/tablemodel.h b/src/gui/models/tablemodel.h index ff752e6f1..032facadd 100644 --- a/src/gui/models/tablemodel.h +++ b/src/gui/models/tablemodel.h @@ -151,8 +151,7 @@ public: int getHeight() const A_WARN_UNUSED; int getColumnWidth(const int index) const override final A_WARN_UNUSED; Widget *getElementAt(const int row, - const int column) const - override final A_WARN_UNUSED; + const int column) const override final A_WARN_UNUSED; protected: int mRows, mColumns; diff --git a/src/gui/models/touchactionmodel.cpp b/src/gui/models/touchactionmodel.cpp index e6cc4d046..b32d1479f 100644 --- a/src/gui/models/touchactionmodel.cpp +++ b/src/gui/models/touchactionmodel.cpp @@ -18,19 +18,10 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "gui/widgets/setuptouchitem.h" - #include "gui/setupactiondata.h" #include "gui/models/touchactionmodel.h" -#include "gui/widgets/dropdown.h" -#include "gui/widgets/horizontcontainer.h" -#include "gui/widgets/label.h" -#include "gui/widgets/vertcontainer.h" - -#include "gui/widgets/tabs/setuptabscroll.h" - #include <algorithm> #include "debug.h" diff --git a/src/gui/rect.h b/src/gui/rect.h index f7cb7ae92..69c0120ca 100644 --- a/src/gui/rect.h +++ b/src/gui/rect.h @@ -159,4 +159,4 @@ class Rect int height; }; -#endif // GUI_RECTANGEL_H +#endif // GUI_RECT_H diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp index d8a63b60c..ffb90a883 100644 --- a/src/gui/sdlinput.cpp +++ b/src/gui/sdlinput.cpp @@ -98,7 +98,7 @@ SDLInput::SDLInput() : { } -bool SDLInput::isKeyQueueEmpty() +bool SDLInput::isKeyQueueEmpty() const { return mKeyInputQueue.empty(); } @@ -114,7 +114,7 @@ KeyInput SDLInput::dequeueKeyInput2() return keyInput; } -bool SDLInput::isMouseQueueEmpty() +bool SDLInput::isMouseQueueEmpty() const { return mMouseInputQueue.empty(); } diff --git a/src/gui/sdlinput.h b/src/gui/sdlinput.h index 29cb5ce1f..8197aa110 100644 --- a/src/gui/sdlinput.h +++ b/src/gui/sdlinput.h @@ -107,14 +107,6 @@ public: */ void pushInput(const SDL_Event &event); - /** - * Polls all input. It exists for input driver compatibility. If you - * only use SDL and plan sticking with SDL you can safely ignore this - * function as it in the SDL case does nothing. - */ - void _pollInput() - { } - KeyInput dequeueKeyInput2() A_WARN_UNUSED; KeyInput dequeueKeyInput() A_WARN_UNUSED @@ -122,9 +114,9 @@ public: // Inherited from SDLInput - bool isKeyQueueEmpty() A_WARN_UNUSED; + bool isKeyQueueEmpty() const A_WARN_UNUSED; - bool isMouseQueueEmpty() A_WARN_UNUSED; + bool isMouseQueueEmpty() const A_WARN_UNUSED; MouseInput dequeueMouseInput() A_WARN_UNUSED; diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h index e4f65a992..e0711a7b7 100644 --- a/src/gui/widgets/avatarlistbox.h +++ b/src/gui/widgets/avatarlistbox.h @@ -22,14 +22,10 @@ #ifndef GUI_WIDGETS_AVATARLISTBOX_H #define GUI_WIDGETS_AVATARLISTBOX_H -#include "avatar.h" - #include "listeners/configlistener.h" #include "gui/widgets/listbox.h" -#include "gui/models/listmodel.h" - #include <string> class AvatarListModel; diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index 0c3a62609..64faa6eb5 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -27,8 +27,6 @@ #include "gui/base/widgets/listbox.hpp" -#include "render/graphics.h" - #include "localconsts.h" class Skin; diff --git a/src/gui/widgets/radiogroup.h b/src/gui/widgets/radiogroup.h index b553c629a..41193b3d6 100644 --- a/src/gui/widgets/radiogroup.h +++ b/src/gui/widgets/radiogroup.h @@ -23,8 +23,6 @@ #include "gui/widgets/widgetgroup.h" -#include "gui/widgets/widget.h" - class RadioGroup final : public WidgetGroup { public: diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h index 51f2eb94e..7dee860be 100644 --- a/src/gui/widgets/setupitem.h +++ b/src/gui/widgets/setupitem.h @@ -95,7 +95,7 @@ class SetupItem : public ActionListener, virtual void rereadValue(); - void setValue(const std::string str) + void setValue(const std::string &str) { mValue = str; } std::string getValue() const diff --git a/src/gui/widgets/setuptouchitem.cpp b/src/gui/widgets/setuptouchitem.cpp index 99a774ecd..3c8238fd0 100644 --- a/src/gui/widgets/setuptouchitem.cpp +++ b/src/gui/widgets/setuptouchitem.cpp @@ -20,8 +20,6 @@ #include "gui/widgets/setuptouchitem.h" -#include "gui/setupactiondata.h" - #include "gui/models/touchactionmodel.h" #include "gui/widgets/dropdown.h" @@ -31,7 +29,7 @@ #include "gui/widgets/tabs/setuptabscroll.h" -#include <algorithm> +#include "utils/stringutils.h" #include "debug.h" diff --git a/src/gui/widgets/setuptouchitem.h b/src/gui/widgets/setuptouchitem.h index 2c1aa05d0..f7bbf2691 100644 --- a/src/gui/widgets/setuptouchitem.h +++ b/src/gui/widgets/setuptouchitem.h @@ -21,8 +21,6 @@ #ifndef GUI_WIDGETS_SETUPTOUCHITEM_H #define GUI_WIDGETS_SETUPTOUCHITEM_H -#include "gui/models/namesmodel.h" - #include "gui/widgets/setupitem.h" class TouchActionsModel; diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index d3781b421..0d9aa64a6 100644 --- a/src/gui/widgets/shortcutcontainer.cpp +++ b/src/gui/widgets/shortcutcontainer.cpp @@ -61,7 +61,7 @@ void ShortcutContainer::widgetResized(const Event &event A_UNUSED) if (mGridWidth < 1) mGridWidth = 1; - mGridHeight = mMaxItems / mGridWidth; + mGridHeight = mMaxItems / static_cast<unsigned int>(mGridWidth); if (mMaxItems % mGridWidth != 0 || mGridHeight < 1) ++mGridHeight; diff --git a/src/gui/widgets/tabs/setup_audio.cpp b/src/gui/widgets/tabs/setup_audio.cpp index c8e625ca4..6cf675635 100644 --- a/src/gui/widgets/tabs/setup_audio.cpp +++ b/src/gui/widgets/tabs/setup_audio.cpp @@ -30,7 +30,6 @@ #include "gui/viewport.h" -#include "gui/models/namesmodel.h" #include "gui/models/soundsmodel.h" #include "gui/widgets/layouthelper.h" diff --git a/src/gui/widgets/tabs/setup_theme.cpp b/src/gui/widgets/tabs/setup_theme.cpp index 419400853..424828694 100644 --- a/src/gui/widgets/tabs/setup_theme.cpp +++ b/src/gui/widgets/tabs/setup_theme.cpp @@ -28,7 +28,6 @@ #include "gui/models/extendedlistmodel.h" #include "gui/models/fontsmodel.h" -#include "gui/models/namesmodel.h" #include "gui/models/themesmodel.h" #include "gui/widgets/button.h" diff --git a/src/gui/widgets/tabstrip.h b/src/gui/widgets/tabstrip.h index b2dfc99e2..a89dd5144 100644 --- a/src/gui/widgets/tabstrip.h +++ b/src/gui/widgets/tabstrip.h @@ -23,8 +23,6 @@ #include "gui/widgets/widgetgroup.h" -#include "gui/widgets/widget.h" - class TabStrip final : public WidgetGroup { public: diff --git a/src/gui/widgets/widget.cpp b/src/gui/widgets/widget.cpp index 23edadac0..5b2024b1f 100644 --- a/src/gui/widgets/widget.cpp +++ b/src/gui/widgets/widget.cpp @@ -604,16 +604,6 @@ void Widget::setInternalFocusHandler(FocusHandler* focusHandler) mInternalFocusHandler = focusHandler; } -void Widget::setId(const std::string& id) -{ - mId = id; -} - -const std::string& Widget::getId() -{ - return mId; -} - void Widget::distributeResizedEvent() { for (WidgetListenerIterator iter = mWidgetListeners.begin(); diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h index e05844e4c..17f016c76 100644 --- a/src/gui/widgets/widget.h +++ b/src/gui/widgets/widget.h @@ -973,7 +973,8 @@ class Widget : public Widget2 * @see getId, BasicContainer::findWidgetById * @since 0.8.0 */ - void setId(const std::string& id); + void setId(const std::string& id) + { mId = id; } /** * Gets the id of a widget. An id can be useful if a widget needs to be @@ -985,7 +986,8 @@ class Widget : public Widget2 * @see setId, BasicContainer::findWidgetById * @since 0.8.0 */ - const std::string& getId() A_WARN_UNUSED; + const std::string& getId() const A_WARN_UNUSED + { return mId; } /** * Shows a certain part of a widget in the widget's parent. diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 8b106b489..ec83af9a8 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -99,7 +99,6 @@ Window::Window(const std::string &caption, const bool modal, mPadding(2), mTitleBarHeight(16), mMovable(true), - mOpaque(true), mDragOffsetX(0), mDragOffsetY(0), mMoved(false), diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 7cf34c67c..6369990bb 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -555,25 +555,6 @@ class Window : public gcn::Container, bool isMovable() const { return mMovable; } - /** - * Sets the window to be opaque or not. An opaque window will draw it's background - * and it's content. A non opaque window will only draw it's content. - * - * @param opaque True if the window should be opaque, false otherwise. - * @see isOpaque - */ - void setOpaque(bool opaque) - { mOpaque = opaque; } - - /** - * Checks if the window is opaque. - * - * @return True if the window is opaque, false otherwise. - * @see setOpaque - */ - bool isOpaque() - { return mOpaque; } - virtual Rect getChildrenArea(); /** @@ -626,11 +607,6 @@ class Window : public gcn::Container, bool mMovable; /** - * True if the window is opaque, false otherwise. - */ - bool mOpaque; - - /** * Holds a drag offset as an x coordinate where the drag of the window * started if the window is being dragged. It's used to move the window * correctly when dragged. diff --git a/src/gui/windows/editserverdialog.h b/src/gui/windows/editserverdialog.h index 215666394..b70d1031b 100644 --- a/src/gui/windows/editserverdialog.h +++ b/src/gui/windows/editserverdialog.h @@ -35,8 +35,6 @@ class TypeListModel; #include "listeners/actionlistener.h" #include "listeners/keylistener.h" -#include "gui/models/listmodel.h" - /** * The custom server addition dialog. * diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 5323854fb..ee8c85f06 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -36,7 +36,6 @@ #include "gui/gui.h" #include "gui/viewport.h" -#include "gui/models/listmodel.h" #include "gui/models/sortlistmodelinv.h" #include "gui/popups/textpopup.h" diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index dba69b424..fc0c5880b 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -34,7 +34,6 @@ #include "gui/viewport.h" #include "gui/models/itemsmodel.h" -#include "gui/models/listmodel.h" #include "gui/popups/itempopup.h" diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index be0c840f6..6fcea7d3a 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -325,7 +325,7 @@ void OutfitWindow::draw(Graphics *graphics) { const int itemX = mPadding + ((i % mGridWidth) * mBoxWidth); const int itemY = mPadding + mTitleBarHeight - + ((i / mGridWidth) * mBoxHeight); + + ((i / static_cast<unsigned int>(mGridWidth)) * mBoxHeight); graphics->setColor(mBorderColor); graphics->drawRectangle(Rect(itemX, itemY, 32, 32)); diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index 319bf5df0..eee3e4259 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -29,7 +29,6 @@ #include "gui/font.h" #include "gui/gui.h" -#include "gui/models/extendednamesmodel.h" #include "gui/models/questsmodel.h" #include "gui/widgets/browserbox.h" diff --git a/src/gui/windows/serverdialog.h b/src/gui/windows/serverdialog.h index 07e2b5dcc..39c82279e 100644 --- a/src/gui/windows/serverdialog.h +++ b/src/gui/windows/serverdialog.h @@ -34,16 +34,12 @@ #include "listeners/keylistener.h" #include "listeners/selectionlistener.h" -#include "gui/models/listmodel.h" - #include <string> -#include <vector> class Button; class CheckBox; class Label; class ListBox; -class ServerDialog; class ServersListModel; /** diff --git a/src/gui/windows/textcommandeditor.cpp b/src/gui/windows/textcommandeditor.cpp index 17703388f..dead469bc 100644 --- a/src/gui/windows/textcommandeditor.cpp +++ b/src/gui/windows/textcommandeditor.cpp @@ -28,7 +28,6 @@ #include "input/keyboardconfig.h" #include "gui/models/iconsmodel.h" -#include "gui/models/listmodel.h" #include "gui/models/magicschoolmodel.h" #include "gui/models/targettypemodel.h" @@ -41,10 +40,6 @@ #include "utils/gettext.h" -#include "resources/iteminfo.h" - -#include "resources/db/itemdb.h" - #include "debug.h" TextCommandEditor::TextCommandEditor(TextCommand *const command) : diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index 7fe1a1e36..506f25c17 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -130,8 +130,7 @@ TradeWindow::TradeWindow(): place(1, 0, mMoneyLabel); place(0, 1, myScroll).setPadding(3); place(1, 1, partnerScroll).setPadding(3); - ContainerPlacer placer; - placer = getPlacer(0, 0); + ContainerPlacer placer = getPlacer(0, 0); placer(0, 0, moneyLabel2); placer(1, 0, mMoneyField, 2); placer(3, 0, mMoneyChangeButton).setHAlign(LayoutCell::LEFT); diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp index db17820db..77d167c82 100644 --- a/src/gui/windows/worldselectdialog.cpp +++ b/src/gui/windows/worldselectdialog.cpp @@ -33,7 +33,6 @@ #include "gui/widgets/listbox.h" #include "gui/widgets/scrollarea.h" -#include "gui/models/listmodel.h" #include "gui/models/worldlistmodel.h" #include "net/loginhandler.h" diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index d64050e1a..2262a79f9 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -152,7 +152,7 @@ int InventoryHandler::convertFromServerSlot(const int serverSlot) const return EQUIP_CONVERT[serverSlot]; } -int InventoryHandler::getSlot(const int eAthenaSlot) const +int InventoryHandler::getSlot(const int eAthenaSlot) { if (eAthenaSlot == 0) return Equipment::EQUIP_VECTOREND; @@ -566,7 +566,7 @@ void InventoryHandler::processPlayerUnEquip(Net::MessageIn &msg) miniStatusWindow->updateArrows(); } -void InventoryHandler::processPlayerAttackRange(Net::MessageIn &msg) const +void InventoryHandler::processPlayerAttackRange(Net::MessageIn &msg) { const int range = msg.readInt16(); if (player_node) diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h index 494b9145a..ac88c1d6c 100644 --- a/src/net/ea/inventoryhandler.h +++ b/src/net/ea/inventoryhandler.h @@ -175,7 +175,7 @@ class InventoryHandler : public Net::InventoryHandler void pushPickup(const int floorId) { mSentPickups.push(floorId); } - int getSlot(const int eAthenaSlot) const A_WARN_UNUSED; + static int getSlot(const int eAthenaSlot) A_WARN_UNUSED; void processPlayerInventory(Net::MessageIn &msg, const bool playerInvintory); @@ -204,7 +204,7 @@ class InventoryHandler : public Net::InventoryHandler void processPlayerUnEquip(Net::MessageIn &msg); - void processPlayerAttackRange(Net::MessageIn &msg) const; + static void processPlayerAttackRange(Net::MessageIn &msg); void processPlayerArrowEquip(Net::MessageIn &msg); diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index 7f29f277a..4e4cac3df 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -60,7 +60,7 @@ void PartyHandler::join(const int partyId A_UNUSED) const { } -void PartyHandler::reload() const +void PartyHandler::reload() { taParty = Party::getParty(1); } diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h index 29f242285..24923bd4a 100644 --- a/src/net/ea/partyhandler.h +++ b/src/net/ea/partyhandler.h @@ -52,7 +52,7 @@ class PartyHandler : public Net::PartyHandler PartyShare getShareItems() const override final A_WARN_UNUSED { return mShareItems; } - void reload() const; + static void reload(); void clear() const override final; diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 6925f47d0..86707fac8 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -220,7 +220,7 @@ static inline void drawRescaledQuad(const Image *const image, } bool MobileOpenGLGraphics::drawImage(const Image *const image, - int dstX, int dstY) + int dstX, int dstY) { return drawImageInline(image, dstX, dstY); } diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index 916002f26..6bc25be32 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -287,7 +287,7 @@ static inline void drawRescaledQuad(const Image *const image, } bool NormalOpenGLGraphics::drawImage(const Image *const image, - int dstX, int dstY) + int dstX, int dstY) { return drawImageInline(image, dstX, dstY); } diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index 159ccea94..d09d7b13b 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -140,7 +140,7 @@ static inline void drawRescaledQuad(const Image *const image A_UNUSED, } bool NullOpenGLGraphics::drawImage(const Image *const image, - int dstX, int dstY) + int dstX, int dstY) { return drawImageInline(image, dstX, dstY); } diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index a739a4904..faf2de76e 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -143,7 +143,7 @@ static inline void drawRescaledQuad(const Image *const image, } bool SafeOpenGLGraphics::drawImage(const Image *const image, - int dstX, int dstY) + int dstX, int dstY) { return drawImageInline(image, dstX, dstY); } diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index ebfcdb226..8c78c8cdd 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -158,7 +158,7 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, } bool SDLGraphics::drawImage(const Image *const image, - int dstX, int dstY) + int dstX, int dstY) { return drawImageInline(image, dstX, dstY); } diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index 8fe83188f..0844cd52e 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -110,7 +110,7 @@ bool SDL2SoftwareGraphics::drawRescaledImage(const Image *const image, } bool SDL2SoftwareGraphics::drawImage(const Image *const image, - int dstX, int dstY) + int dstX, int dstY) { return drawImageInline(image, dstX, dstY); } diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 5d1589424..44dcc426d 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -104,7 +104,7 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, } bool SDLGraphics::drawImage(const Image *const image, - int dstX, int dstY) + int dstX, int dstY) { return drawImageInline(image, dstX, dstY); } diff --git a/src/render/surfacegraphics.cpp b/src/render/surfacegraphics.cpp index d9cb03136..e6aee752f 100644 --- a/src/render/surfacegraphics.cpp +++ b/src/render/surfacegraphics.cpp @@ -43,7 +43,7 @@ SurfaceGraphics::~SurfaceGraphics() } bool SurfaceGraphics::drawImage(const Image *const image, - int dstX, int dstY) + int dstX, int dstY) { FUNC_BLOCK("Graphics::drawImage", 1) // Check that preconditions for blitting are met. diff --git a/src/resources/db/weaponsdb.cpp b/src/resources/db/weaponsdb.cpp index 82892cc5f..6e8e4ce1f 100644 --- a/src/resources/db/weaponsdb.cpp +++ b/src/resources/db/weaponsdb.cpp @@ -20,13 +20,8 @@ #include "resources/db/weaponsdb.h" -#include "logger.h" - -#include "utils/gettext.h" #include "utils/xmlutils.h" -#include "configuration.h" - #include "debug.h" namespace @@ -37,7 +32,7 @@ namespace bool mLoaded = false; } -static void loadDB(const std::string name, WeaponsInfos &arr) +static void loadDB(const std::string &name, WeaponsInfos &arr) { readXmlIntVector("weapons.xml", "weapons", diff --git a/src/resources/db/weaponsdb.h b/src/resources/db/weaponsdb.h index 287237c48..33688b338 100644 --- a/src/resources/db/weaponsdb.h +++ b/src/resources/db/weaponsdb.h @@ -21,7 +21,6 @@ #ifndef RESOURCES_DB_WEAPONSDB_H #define RESOURCES_DB_WEAPONSDB_H -#include <string> #include <vector> #include "localconsts.h" |