diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-30 21:03:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-31 12:16:43 +0300 |
commit | c0197404a15a3937ef3cd21f48a09e691a96518f (patch) | |
tree | 582b01cfc1c716b19122fe28f57abefb3bf5b716 | |
parent | 9bb11133522836a9c5e251550ac88c9a4e091c0e (diff) | |
download | mv-c0197404a15a3937ef3cd21f48a09e691a96518f.tar.gz mv-c0197404a15a3937ef3cd21f48a09e691a96518f.tar.bz2 mv-c0197404a15a3937ef3cd21f48a09e691a96518f.tar.xz mv-c0197404a15a3937ef3cd21f48a09e691a96518f.zip |
fix code style.
66 files changed, 103 insertions, 244 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp index c7e091900..36fdf7c93 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -22,7 +22,6 @@ #include "actormanager.h" -#include "client.h" #include "configuration.h" #include "main.h" diff --git a/src/animatedsprite_unittest.cc b/src/animatedsprite_unittest.cc index 3e1695d10..c8c1e7d80 100644 --- a/src/animatedsprite_unittest.cc +++ b/src/animatedsprite_unittest.cc @@ -52,8 +52,7 @@ static void init() TEST(AnimatedSprite, basic) { - Client::Options options; - client = new Client(options); + client = new Client; init(); AnimatedSprite *sprite = AnimatedSprite::load( @@ -77,9 +76,7 @@ TEST(AnimatedSprite, basic) TEST(AnimatedSprite, basic2) { - Client::Options options; - client = new Client(options); - + client = new Client; init(); AnimatedSprite *sprite = AnimatedSprite::load( "graphics/sprites/test.xml", 0); diff --git a/src/being/being.cpp b/src/being/being.cpp index 8da2d43da..5aa95bbd6 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -67,7 +67,6 @@ #include "resources/emoteinfo.h" #include "resources/emotesprite.h" #include "resources/iteminfo.h" -#include "resources/resourcemanager.h" #include "resources/spriteaction.h" #include "resources/db/avatardb.h" diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 617671198..cc3e327cb 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -84,7 +84,9 @@ #include "utils/gettext.h" #include "utils/timer.h" +#ifdef USE_MUMBLE #include "mumblemanager.h" +#endif #include <climits> diff --git a/src/client.cpp b/src/client.cpp index 03c13a8cf..e4fe1b4db 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -39,13 +39,11 @@ #include "itemshortcut.h" #include "party.h" #include "settings.h" -#include "soundconsts.h" #include "soundmanager.h" #include "statuseffect.h" #include "units.h" #include "touchmanager.h" -#include "being/beingspeech.h" #include "being/playerinfo.h" #include "being/playerrelations.h" @@ -59,12 +57,9 @@ #include "gui/theme.h" #include "gui/windowmanager.h" -#include "gui/windows/buyselldialog.h" -#include "gui/windows/buydialog.h" #include "gui/windows/changeemaildialog.h" #include "gui/windows/changepassworddialog.h" #include "gui/windows/charselectdialog.h" -#include "gui/windows/confirmdialog.h" #include "gui/windows/connectiondialog.h" #include "gui/windows/didyouknowwindow.h" #include "gui/windows/helpwindow.h" @@ -72,7 +67,6 @@ #include "gui/windows/npcdialog.h" #include "gui/windows/okdialog.h" #include "gui/windows/registerdialog.h" -#include "gui/windows/selldialog.h" #include "gui/windows/serverdialog.h" #include "gui/windows/setupwindow.h" #include "gui/windows/unregisterdialog.h" @@ -118,15 +112,14 @@ #include "resources/db/petdb.h" #include "resources/db/weaponsdb.h" -#include "utils/base64.h" #include "utils/cpu.h" #include "utils/delete2.h" -#include "utils/files.h" #include "utils/fuzzer.h" #include "utils/gettext.h" #include "utils/gettexthelper.h" -#include "utils/mkdir.h" +#ifdef ANDROID #include "utils/paths.h" +#endif #include "utils/physfstools.h" #include "utils/sdlcheckutils.h" #include "utils/sdlhelper.h" @@ -134,6 +127,8 @@ #include "utils/translation/translationmanager.h" +#include "listeners/errorlistener.h" + #include "test/testlauncher.h" #include "test/testmain.h" @@ -141,8 +136,6 @@ #include <CoreFoundation/CFBundle.h> #endif -#include <SDL_image.h> - #ifdef WIN32 #include <SDL_syswm.h> #include "utils/specialfolder.h" @@ -159,7 +152,9 @@ #include <climits> #include <fstream> +#ifdef USE_MUMBLE #include "mumblemanager.h" +#endif #include "debug.h" @@ -448,7 +443,7 @@ void Client::gameInit() #ifdef ANDROID #ifndef USE_SDL2 - updateScreenKeyboard(SDL_GetScreenKeyboardHeight(nullptr)); + WindowManager::updateScreenKeyboard(SDL_GetScreenKeyboardHeight(nullptr)); #endif #endif } @@ -1010,7 +1005,8 @@ int Client::gameExec() // Allow changing this using a server choice dialog // We show the dialog box only if the command-line // options weren't set. - if (settings.options.serverName.empty() && settings.options.serverPort == 0 + if (settings.options.serverName.empty() + && settings.options.serverPort == 0 && !branding.getValue("onlineServerList", "a").empty()) { // Don't allow an alpha opacity @@ -1069,7 +1065,8 @@ int Client::gameExec() || settings.options.password.empty()) { mCurrentDialog = new LoginDialog(&loginData, - mCurrentServer.hostname, &settings.options.updateHost); + mCurrentServer.hostname, + &settings.options.updateHost); mCurrentDialog->postInit(); } else diff --git a/src/client.h b/src/client.h index 10542a29c..4a5d5016d 100644 --- a/src/client.h +++ b/src/client.h @@ -25,8 +25,8 @@ #include "state.h" +#include "listeners/actionlistener.h" #include "listeners/configlistener.h" -#include "listeners/errorlistener.h" #include "net/serverinfo.h" @@ -69,7 +69,7 @@ class Client final : public ConfigListener, public ActionListener { public: - explicit Client(); + Client(); A_DELETE_COPY(Client) @@ -101,6 +101,8 @@ public: void windowRemoved(const Window *const window); + static void setEnv(const char *const name, const char *const value); + private: void initSoundManager(); @@ -118,8 +120,6 @@ private: static void logVars(); - static void setEnv(const char *const name, const char *const value); - #ifdef ANDROID #ifdef USE_SDL2 static void extractAssets(); @@ -131,7 +131,6 @@ private: Game *mGame; Window *mCurrentDialog; QuitDialog *mQuitDialog; - Desktop *mDesktop; Button *mSetupButton; Button *mVideoButton; Button *mHelpButton; @@ -146,10 +145,8 @@ private: State mOldState; Skin *mSkin; - float mGuiAlpha; int mButtonPadding; int mButtonSpacing; - int mKeyboardHeight; bool mConfigAutoSaved; }; diff --git a/src/configmanager.cpp b/src/configmanager.cpp index 745ef195a..de72045ac 100644 --- a/src/configmanager.cpp +++ b/src/configmanager.cpp @@ -28,7 +28,6 @@ #include "settings.h" #include "being/beingspeech.h" -#include "being/playerrelations.h" #include "utils/files.h" #include "utils/gettext.h" diff --git a/src/dirs.cpp b/src/dirs.cpp index da3aacd8e..82b36e99d 100644 --- a/src/dirs.cpp +++ b/src/dirs.cpp @@ -39,8 +39,6 @@ #include <CoreFoundation/CFBundle.h> #endif -#include <SDL_image.h> - #ifdef WIN32 #include <SDL_syswm.h> #include "utils/specialfolder.h" @@ -65,8 +63,8 @@ void Dirs::updateDataPath() } else { - settings.options.dataPath = branding.getDirectory().append(dirSeparator) - + branding.getStringValue("dataPath"); + settings.options.dataPath = branding.getDirectory().append( + dirSeparator) + branding.getStringValue("dataPath"); } settings.options.skipUpdate = true; } diff --git a/src/dirs.h b/src/dirs.h index ed01a822a..920738593 100644 --- a/src/dirs.h +++ b/src/dirs.h @@ -23,8 +23,6 @@ #ifndef DIRS_H #define DIRS_H -#include <string> - #include "localconsts.h" class Dirs final diff --git a/src/dropshortcut.cpp b/src/dropshortcut.cpp index 9283294e1..ed60e623d 100644 --- a/src/dropshortcut.cpp +++ b/src/dropshortcut.cpp @@ -22,7 +22,6 @@ #include "dropshortcut.h" -#include "client.h" #include "configuration.h" #include "inventory.h" #include "item.h" diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp index fb5ab6d36..73f7ef203 100644 --- a/src/eventsmanager.cpp +++ b/src/eventsmanager.cpp @@ -89,7 +89,7 @@ bool EventsManager::handleCommonEvents(const SDL_Event &event) const return true; #ifdef ANDROID case SDL_KEYBOARDSHOW: - client->updateScreenKeyboard(event.user.code); + WindowManager::updateScreenKeyboard(event.user.code); return true; case SDL_ACCELEROMETER: break; diff --git a/src/game.cpp b/src/game.cpp index 20939a82c..63bafe187 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -64,13 +64,11 @@ #include "gui/windows/didyouknowwindow.h" #include "gui/windows/emotewindow.h" #include "gui/windows/equipmentwindow.h" -#include "gui/windows/helpwindow.h" #include "gui/windows/inventorywindow.h" #include "gui/windows/killstats.h" #include "gui/windows/minimap.h" #include "gui/windows/ministatuswindow.h" #include "gui/windows/npcdialog.h" -#include "gui/windows/okdialog.h" #include "gui/windows/outfitwindow.h" #include "gui/windows/setupwindow.h" #include "gui/windows/shopwindow.h" @@ -80,7 +78,6 @@ #include "gui/windows/statuswindow.h" #include "gui/windows/tradewindow.h" #include "gui/windows/questswindow.h" -#include "gui/windows/updaterwindow.h" #include "gui/windows/whoisonline.h" #include "gui/widgets/tabs/battletab.h" @@ -113,7 +110,6 @@ #include "utils/langs.h" #include "utils/mkdir.h" #include "utils/physfstools.h" -#include "utils/process.h" #include "utils/sdlcheckutils.h" #include "utils/timer.h" @@ -122,7 +118,9 @@ #include <sstream> #include <string> +#ifdef USE_MUMBLE #include "mumblemanager.h" +#endif #include "debug.h" diff --git a/src/gui/dialogsmanager.h b/src/gui/dialogsmanager.h index 2190819c3..9c7dc0d46 100644 --- a/src/gui/dialogsmanager.h +++ b/src/gui/dialogsmanager.h @@ -20,11 +20,13 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef DIALOGMANAGER_H -#define DIALOGMANAGER_H +#ifndef GUI_DIALOGSMANAGER_H +#define GUI_DIALOGSMANAGER_H #include <string> +#include "localconsts.h" + class Window; class DialogsManager final @@ -39,4 +41,4 @@ class DialogsManager final const bool modal); }; -#endif // DIALOGMANAGER_H +#endif // GUI_DIALOGSMANAGER_H diff --git a/src/gui/fonts/font.cpp b/src/gui/fonts/font.cpp index 68127232d..68f23d242 100644 --- a/src/gui/fonts/font.cpp +++ b/src/gui/fonts/font.cpp @@ -74,7 +74,6 @@ #include "resources/image.h" #include "resources/imagehelper.h" -#include "resources/resourcemanager.h" #include "utils/files.h" #include "utils/paths.h" diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 52abd30b6..1fb4cb79f 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -70,13 +70,11 @@ #include "gui/sdlinput.h" #include "gui/theme.h" #include "gui/viewport.h" -#include "gui/windowmanager.h" #include "gui/fonts/font.h" #include "gui/widgets/window.h" -#include "client.h" #include "configuration.h" #include "dragdrop.h" #include "settings.h" diff --git a/src/gui/skin.cpp b/src/gui/skin.cpp index 46f790882..a1bc91dc2 100644 --- a/src/gui/skin.cpp +++ b/src/gui/skin.cpp @@ -24,7 +24,6 @@ #include "gui/skin.h" -#include "client.h" #include "settings.h" #include "resources/image.h" diff --git a/src/gui/widgets/browserbox_unittest.cc b/src/gui/widgets/browserbox_unittest.cc index 0a3e06f27..cf5c80029 100644 --- a/src/gui/widgets/browserbox_unittest.cc +++ b/src/gui/widgets/browserbox_unittest.cc @@ -46,9 +46,7 @@ TEST(browserbox, test1) { PHYSFS_init("manaplus"); dirSeparator = "/"; - Client::Options options; - client = new Client(options); - + client = new Client; logger = new Logger(); imageHelper = new SDLImageHelper(); theme = new Theme; diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index e67f77056..54d15391b 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -65,7 +65,6 @@ #include "gui/widgets/button.h" -#include "client.h" #include "graphicsvertexes.h" #include "settings.h" diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index 508bfead4..15ad7e3ec 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -65,7 +65,6 @@ #include "gui/widgets/checkbox.h" -#include "client.h" #include "settings.h" #include "input/inputaction.h" diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index ab6b0dab0..6647a768f 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -22,7 +22,6 @@ #include "gui/widgets/dropdown.h" -#include "client.h" #include "settings.h" #include "events/keyevent.h" diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 150c94f77..087f4b372 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -22,7 +22,6 @@ #include "gui/widgets/dropshortcutcontainer.h" -#include "client.h" #include "dragdrop.h" #include "dropshortcut.h" #include "settings.h" @@ -40,6 +39,7 @@ #include "resources/image.h" #include "utils/delete2.h" +#include "utils/stringutils.h" #include "debug.h" diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index 6c6c82b43..85e07e2b7 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -22,7 +22,6 @@ #include "gui/widgets/emoteshortcutcontainer.h" #include "animatedsprite.h" -#include "client.h" #include "emoteshortcut.h" #include "settings.h" @@ -39,6 +38,8 @@ #include "resources/db/emotedb.h" +#include "utils/stringutils.h" + #include "debug.h" static const int MAX_ITEMS = 48; diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index c3725b46f..7f4a18858 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -22,7 +22,6 @@ #include "gui/widgets/guitable.h" -#include "client.h" #include "settings.h" #include "gui/gui.h" diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index e7e2455bb..670807ed5 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -22,7 +22,6 @@ #include "gui/widgets/itemshortcutcontainer.h" -#include "client.h" #include "dragdrop.h" #include "inventory.h" #include "item.h" @@ -50,6 +49,7 @@ #include "resources/skillconsts.h" #include "utils/delete2.h" +#include "utils/stringutils.h" #include "debug.h" diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 8953fc5e2..68b50c458 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -65,7 +65,6 @@ #include "gui/widgets/listbox.h" -#include "client.h" #include "settings.h" #include "input/inputaction.h" diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp index b77b1bc42..c7a3a84b5 100644 --- a/src/gui/widgets/playerbox.cpp +++ b/src/gui/widgets/playerbox.cpp @@ -22,7 +22,6 @@ #include "gui/widgets/playerbox.h" -#include "client.h" #include "settings.h" #include "being/being.h" diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index 68db6ee1d..9a10eedb7 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -22,7 +22,6 @@ #include "gui/widgets/progressbar.h" -#include "client.h" #include "graphicsvertexes.h" #include "settings.h" diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index e0d031908..d4bae8273 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -65,7 +65,6 @@ #include "gui/widgets/radiobutton.h" -#include "client.h" #include "settings.h" #include "input/inputaction.h" diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index d439765af..fc7ae91d5 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -65,7 +65,6 @@ #include "gui/widgets/scrollarea.h" -#include "client.h" #include "graphicsvertexes.h" #include "settings.h" @@ -76,6 +75,7 @@ #include "resources/imagerect.h" #include "utils/delete2.h" +#include "utils/stringutils.h" #include "debug.h" diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index cd250d274..4c7242866 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -22,7 +22,6 @@ #include "gui/widgets/shoplistbox.h" -#include "client.h" #include "settings.h" #include "shopitem.h" diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index 444480ae1..6c2224150 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -65,7 +65,6 @@ #include "gui/widgets/slider.h" -#include "client.h" #include "graphicsvertexes.h" #include "settings.h" diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 1b3355265..014fa4354 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -22,7 +22,6 @@ #include "gui/widgets/spellshortcutcontainer.h" -#include "client.h" #include "dragdrop.h" #include "itemshortcut.h" #include "settings.h" diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp index 36e4b5437..684b9d4d5 100644 --- a/src/gui/widgets/tabs/chattab.cpp +++ b/src/gui/widgets/tabs/chattab.cpp @@ -23,7 +23,6 @@ #include "gui/widgets/tabs/chattab.h" #include "chatlogger.h" -#include "client.h" #include "commands.h" #include "commandhandler.h" #include "configuration.h" diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index 54b17396a..6bc8d07e9 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -22,7 +22,6 @@ #include "gui/widgets/tabs/setup_video.h" -#include "client.h" #include "configuration.h" #include "graphicsmanager.h" diff --git a/src/gui/widgets/tabs/setup_visual.cpp b/src/gui/widgets/tabs/setup_visual.cpp index e90008ac1..fff876d14 100644 --- a/src/gui/widgets/tabs/setup_visual.cpp +++ b/src/gui/widgets/tabs/setup_visual.cpp @@ -29,10 +29,9 @@ #include "gui/widgets/layouthelper.h" #include "gui/widgets/scrollarea.h" -#include "client.h" - #include "utils/delete2.h" #include "utils/gettext.h" +#include "utils/stringutils.h" #include "debug.h" diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp index 73c38343b..16018e5c3 100644 --- a/src/gui/widgets/tabs/tab.cpp +++ b/src/gui/widgets/tabs/tab.cpp @@ -65,7 +65,6 @@ #include "gui/widgets/tabs/tab.h" -#include "client.h" #include "graphicsvertexes.h" #include "settings.h" diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index 0eb16867a..fb1bcc1db 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -65,7 +65,6 @@ #include "gui/widgets/textfield.h" -#include "client.h" #include "settings.h" #include "input/inputmanager.h" @@ -73,6 +72,9 @@ #include "gui/gui.h" #include "gui/skin.h" #include "gui/viewport.h" +#ifdef ANDROID +#include "gui/windowmanager.h" +#endif #include "gui/fonts/font.h" @@ -83,6 +85,7 @@ #include "utils/copynpaste.h" #include "utils/delete2.h" +#include "utils/stringutils.h" #include "utils/timer.h" #undef DELETE // Win32 compatibility hack @@ -700,7 +703,7 @@ void TextField::fontChanged() void TextField::mousePressed(MouseEvent &event) { #ifdef ANDROID - if (!client->isKeyboardVisible()) + if (!WindowManager::isKeyboardVisible()) inputManager.executeAction(InputAction::SHOW_KEYBOARD); #endif event.consume(); @@ -737,7 +740,7 @@ void TextField::mousePressed(MouseEvent &event) void TextField::focusGained(const Event &event A_UNUSED) { #ifdef ANDROID - if (!client->isKeyboardVisible()) + if (!WindowManager::isKeyboardVisible()) inputManager.executeAction(InputAction::SHOW_KEYBOARD); #endif } diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp index febd1b6ba..a4bf738c9 100644 --- a/src/gui/widgets/textpreview.cpp +++ b/src/gui/widgets/textpreview.cpp @@ -22,7 +22,6 @@ #include "gui/widgets/textpreview.h" -#include "client.h" #include "settings.h" #include "gui/gui.h" diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 453bb125c..74c6d1cfc 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -76,7 +76,6 @@ #include "gui/gui.h" #include "gui/skin.h" #include "gui/viewport.h" -#include "gui/windowmanager.h" #include "gui/fonts/font.h" diff --git a/src/gui/windowmanager.cpp b/src/gui/windowmanager.cpp index eb3d244ea..9c08f385e 100644 --- a/src/gui/windowmanager.cpp +++ b/src/gui/windowmanager.cpp @@ -22,129 +22,24 @@ #include "gui/windowmanager.h" -#include "auctionmanager.h" -#include "chatlogger.h" #include "client.h" -#include "configmanager.h" #include "configuration.h" -#include "dirs.h" -#include "dropshortcut.h" -#include "emoteshortcut.h" -#include "eventsmanager.h" #include "game.h" -#include "guild.h" -#include "guildmanager.h" -#include "graphicsmanager.h" -#include "itemshortcut.h" -#include "party.h" #include "settings.h" -#include "soundconsts.h" -#include "soundmanager.h" -#include "statuseffect.h" -#include "units.h" #include "touchmanager.h" -#include "being/beingspeech.h" -#include "being/playerinfo.h" -#include "being/playerrelations.h" - -#include "input/inputmanager.h" -#include "input/joystick.h" -#include "input/keyboardconfig.h" - -#include "gui/dialogsmanager.h" #include "gui/gui.h" -#include "gui/skin.h" -#include "gui/theme.h" - -#include "gui/windows/buyselldialog.h" -#include "gui/windows/buydialog.h" -#include "gui/windows/changeemaildialog.h" -#include "gui/windows/changepassworddialog.h" -#include "gui/windows/charselectdialog.h" -#include "gui/windows/confirmdialog.h" -#include "gui/windows/connectiondialog.h" +#include "gui/userpalette.h" + #include "gui/windows/didyouknowwindow.h" #include "gui/windows/helpwindow.h" -#include "gui/windows/logindialog.h" -#include "gui/windows/npcdialog.h" -#include "gui/windows/okdialog.h" -#include "gui/windows/registerdialog.h" -#include "gui/windows/selldialog.h" -#include "gui/windows/serverdialog.h" #include "gui/windows/setupwindow.h" -#include "gui/windows/unregisterdialog.h" -#include "gui/windows/updaterwindow.h" -#include "gui/windows/quitdialog.h" -#include "gui/windows/worldselectdialog.h" -#include "gui/widgets/button.h" #include "gui/widgets/desktop.h" -#include "net/chathandler.h" -#include "net/download.h" -#include "net/gamehandler.h" -#include "net/generalhandler.h" -#include "net/guildhandler.h" -#include "net/inventoryhandler.h" -#include "net/loginhandler.h" -#include "net/net.h" -#include "net/netconsts.h" -#include "net/packetlimiter.h" -#include "net/partyhandler.h" - -#include "particle/particle.h" - -#include "resources/imagehelper.h" -#include "resources/openglimagehelper.h" -#include "resources/resourcemanager.h" -#include "resources/surfaceimagehelper.h" -#include "resources/spritereference.h" - -#include "resources/db/avatardb.h" -#include "resources/db/chardb.h" -#include "resources/db/colordb.h" -#include "resources/db/deaddb.h" -#include "resources/db/emotedb.h" -#include "resources/db/sounddb.h" -#include "resources/db/itemdb.h" -#include "resources/db/mapdb.h" -#include "resources/db/moddb.h" -#include "resources/db/monsterdb.h" -#include "resources/db/npcdb.h" -#include "resources/db/palettedb.h" -#include "resources/db/petdb.h" -#include "resources/db/weaponsdb.h" - -#include "utils/base64.h" -#include "utils/cpu.h" -#include "utils/delete2.h" #include "utils/files.h" -#include "utils/fuzzer.h" -#include "utils/gettext.h" -#include "utils/gettexthelper.h" -#include "utils/mkdir.h" -#include "utils/paths.h" -#include "utils/physfstools.h" #include "utils/sdlcheckutils.h" #include "utils/sdlhelper.h" -#include "utils/timer.h" - -#include "utils/translation/translationmanager.h" - -#include "test/testlauncher.h" -#include "test/testmain.h" - -#ifdef __APPLE__ -#include <CoreFoundation/CFBundle.h> -#endif - -#include <SDL_image.h> - -#ifdef WIN32 -#include <SDL_syswm.h> -#include "utils/specialfolder.h" -#endif #ifdef ANDROID #ifndef USE_SDL2 @@ -152,12 +47,17 @@ #endif #endif -#include <sys/stat.h> +#ifdef USE_SDL2 +#include <SDL2_framerate.h> +#else +#include <SDL_framerate.h> +#endif -#include <climits> -#include <fstream> +#include <SDL_image.h> -#include "mumblemanager.h" +#ifdef WIN32 +#include <SDL_syswm.h> +#endif #include "debug.h" @@ -166,7 +66,9 @@ FPSmanager fpsManager; namespace { SDL_Surface *mIcon(nullptr); +#ifndef USE_SDL2 int mKeyboardHeight(0); +#endif bool mIsMinimized(false); bool mNewMessageFlag(false); } // namespace @@ -206,7 +108,8 @@ void WindowManager::initTitle() SMALL_VERSION); } - SDL::SetWindowTitle(mainGraphics->getWindow(), settings.windowCaption.c_str()); + SDL::SetWindowTitle(mainGraphics->getWindow(), + settings.windowCaption.c_str()); #ifndef WIN32 setIcon(); #endif @@ -394,10 +297,12 @@ bool WindowManager::getIsMinimized() return mIsMinimized; } +#ifndef USE_SDL2 void WindowManager::updateScreenKeyboard(const int height) { mKeyboardHeight = height; } +#endif void WindowManager::deleteIcon() { diff --git a/src/gui/windowmanager.h b/src/gui/windowmanager.h index 8c3519b5c..26b07e410 100644 --- a/src/gui/windowmanager.h +++ b/src/gui/windowmanager.h @@ -23,18 +23,8 @@ #ifndef GUI_WINDOWMANAGER_H #define GUI_WINDOWMANAGER_H -#ifdef USE_SDL2 -#include <SDL2_framerate.h> -#else -#include <SDL_framerate.h> -#endif - -#include <string> - #include "localconsts.h" -class Window; - namespace WindowManager { void init(); @@ -65,7 +55,9 @@ namespace WindowManager void applyScale(); +#ifndef USE_SDL2 void updateScreenKeyboard(const int height); +#endif void reloadWallpaper(); @@ -76,6 +68,6 @@ namespace WindowManager void setIcon(); void deleteIcon(); -} +} // namespace WindowManager #endif // GUI_WINDOWMANAGER_H diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index d92473977..c6b3d0987 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -23,7 +23,6 @@ #include "gui/windows/chatwindow.h" #include "actormanager.h" -#include "client.h" #include "commandhandler.h" #include "configuration.h" #include "game.h" @@ -77,8 +76,6 @@ #include "utils/files.h" #include "utils/gettext.h" -#include "resources/resourcemanager.h" - #include <sstream> #include <sys/stat.h> diff --git a/src/gui/windows/helpwindow.cpp b/src/gui/windows/helpwindow.cpp index 5e6b5ced2..d1083b0a9 100644 --- a/src/gui/windows/helpwindow.cpp +++ b/src/gui/windows/helpwindow.cpp @@ -35,8 +35,6 @@ #include "gui/widgets/layouttype.h" #include "gui/widgets/scrollarea.h" -#include "resources/resourcemanager.h" - #include "utils/gettext.h" #include "utils/files.h" #include "utils/paths.h" diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index f7b9a72a2..fbbb895f1 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -23,7 +23,6 @@ #include "gui/windows/minimap.h" #include "actormanager.h" -#include "client.h" #include "configuration.h" #include "party.h" #include "settings.h" diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 11ba96933..fac7714ed 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -24,7 +24,6 @@ #include "actormanager.h" #include "configuration.h" -#include "client.h" #include "inventory.h" #include "item.h" #include "soundconsts.h" diff --git a/src/gui/windows/quitdialog.cpp b/src/gui/windows/quitdialog.cpp index 6981936e3..9635cd98f 100644 --- a/src/gui/windows/quitdialog.cpp +++ b/src/gui/windows/quitdialog.cpp @@ -24,7 +24,6 @@ #include "client.h" #include "configuration.h" -#include "game.h" #include "soundconsts.h" #include "soundmanager.h" diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index 0e249c8cb..2b1996bdb 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -35,7 +35,6 @@ #include "net/download.h" #include "gui/gui.h" -#include "gui/windowmanager.h" #include "gui/fonts/font.h" diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 84af6355c..1a0174566 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -44,7 +44,6 @@ #include "actormanager.h" #include "auctionmanager.h" -#include "client.h" #include "configuration.h" #include "inventory.h" #include "item.h" diff --git a/src/input/joystick.cpp b/src/input/joystick.cpp index 626321c69..1357bc608 100644 --- a/src/input/joystick.cpp +++ b/src/input/joystick.cpp @@ -22,19 +22,18 @@ #include "input/joystick.h" -#include "client.h" #include "configuration.h" #include "logger.h" #include "settings.h" #include "sdlshared.h" -#include "gui/windowmanager.h" - #include "input/inputmanager.h" #include "input/inputtype.h" #include "utils/timer.h" +#include <SDL.h> + #include "debug.h" Joystick *joystick = nullptr; diff --git a/src/localconsts.h b/src/localconsts.h index 9783e06f0..29b7d2b53 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -133,3 +133,7 @@ #undef USE_FUZZER #endif #include "utils/perfomance.h" + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif diff --git a/src/net/download.cpp b/src/net/download.cpp index 2dc5cfe33..03e258b38 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -22,7 +22,6 @@ #include "net/download.h" #include "configuration.h" -#include "client.h" #include "logger.h" #include "main.h" #include "settings.h" diff --git a/src/options.h b/src/options.h index a36c4bda4..d5accaa60 100644 --- a/src/options.h +++ b/src/options.h @@ -25,6 +25,12 @@ #include <string> +#if defined(__GXX_EXPERIMENTAL_CXX0X__) +#include <cstdint> +#else +#include <stdint.h> +#endif + /** * A structure holding the values of various options that can be passed * from the command line. diff --git a/src/resources/db/palettedb.cpp b/src/resources/db/palettedb.cpp index 1d940f0c1..8ec238336 100644 --- a/src/resources/db/palettedb.cpp +++ b/src/resources/db/palettedb.cpp @@ -25,7 +25,6 @@ #include "utils/files.h" #include "resources/dyecolor.h" -#include "resources/resourcemanager.h" #include <map> diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index d18281c1a..c36065087 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -22,7 +22,6 @@ #include "resources/map/map.h" -#include "client.h" #include "configuration.h" #include "render/graphics.h" #include "notifications.h" diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 707834d1d..ff907bb53 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -22,7 +22,6 @@ #include "resources/resourcemanager.h" -#include "animationdelayload.h" #include "configuration.h" #include "logger.h" #include "navigationmanager.h" @@ -40,12 +39,9 @@ #include "resources/spritedef.h" #include "utils/delete2.h" -#include "utils/mkdir.h" -#include "utils/paths.h" #include "utils/physfscheckutils.h" #include "utils/physfsrwops.h" #include "utils/sdlcheckutils.h" -#include "utils/timer.h" #include <SDL_image.h> diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index 824fbddd5..16640c7fd 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -28,13 +28,11 @@ #include "utils/stringvector.h" #include <ctime> -#include <list> #include <map> #include <set> #include "localconsts.h" -class AnimationDelayLoad; class Image; class ImageSet; class Map; diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp index 979cf9844..0f2527d54 100644 --- a/src/resources/wallpaper.cpp +++ b/src/resources/wallpaper.cpp @@ -24,7 +24,6 @@ #include "configuration.h" -#include "resources/resourcemanager.h" #include "resources/wallpaperdata.h" #include "utils/physfstools.h" diff --git a/src/settings.cpp b/src/settings.cpp index af0d5357d..489de65d0 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -20,8 +20,6 @@ #include "settings.h" -#include "configuration.h" - #include "debug.h" Settings settings; diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index cedc0c785..840d35b7b 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -22,14 +22,11 @@ #ifdef USE_OPENGL -#include "client.h" #include "graphicsmanager.h" #include "graphicsvertexes.h" #include "settings.h" #include "soundmanager.h" -#include "render/sdlgraphics.h" - #include "gui/theme.h" #include "gui/fonts/font.h" @@ -51,6 +48,8 @@ #define sleep(seconds) Sleep((seconds) * 1000) #endif +#include <sys/time.h> + #include "debug.h" extern Font *boldFont; diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp index 16d36dd35..cf50f2959 100644 --- a/src/test/testmain.cpp +++ b/src/test/testmain.cpp @@ -23,7 +23,6 @@ #ifdef USE_OPENGL -#include "client.h" #include "settings.h" #include "utils/delete2.h" diff --git a/src/utils/files.cpp b/src/utils/files.cpp index 28921a0e5..d3a04d69f 100644 --- a/src/utils/files.cpp +++ b/src/utils/files.cpp @@ -88,7 +88,7 @@ void Files::copyPhysFsFile(const std::string &restrict inFile, const std::string &restrict outFile) { int size = 0; - void *const buf = ResourceManager::loadFile(inFile, size); + void *const buf = PhysFs::loadFile(inFile, size); FILE *const file = fopen(outFile.c_str(), "w"); fwrite(buf, 1, size, file); fclose(file); diff --git a/src/utils/gettexthelper.cpp b/src/utils/gettexthelper.cpp index 59f4933ad..3d10c6848 100644 --- a/src/utils/gettexthelper.cpp +++ b/src/utils/gettexthelper.cpp @@ -20,13 +20,22 @@ #include "utils/gettexthelper.h" +#include "client.h" +#include "configuration.h" + #include "debug.h" +#ifdef ENABLE_NLS +#include "logger.h" + +#include <libintl.h> +#endif + #ifdef WIN32 +#include <string> extern "C" char const *_nl_locale_name_default(void); #endif - void GettextHelper::initLang() { #ifdef ENABLE_NLS @@ -44,8 +53,8 @@ void GettextHelper::initLang() if (!lang.empty()) { - setEnv("LANG", lang.c_str()); - setEnv("LANGUAGE", lang.c_str()); + Client::setEnv("LANG", lang.c_str()); + Client::setEnv("LANGUAGE", lang.c_str()); } #ifdef ANDROID #ifdef USE_SDL2 @@ -87,16 +96,19 @@ void GettextHelper::initLang() bind_textdomain_codeset("manaplus", "UTF-8"); textdomain("manaplus"); #endif // ENABLE_NLS - } +#ifdef ENABLE_NLS void GettextHelper::bindTextDomain(const char *const path) { -#ifdef ENABLE_NLS const char *const dir = bindtextdomain("manaplus", path); if (dir) logger->log("bindtextdomain: %s", dir); else logger->log("bindtextdomain failed"); -#endif } +#else +void GettextHelper::bindTextDomain(const char *const path A_UNUSED) +{ +} +#endif diff --git a/src/utils/gettexthelper.h b/src/utils/gettexthelper.h index 534086820..3916edc03 100644 --- a/src/utils/gettexthelper.h +++ b/src/utils/gettexthelper.h @@ -18,8 +18,8 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef GETTEXTHELPER_H -#define GETTEXTHELPER_H +#ifndef UTILS_GETTEXTHELPER_H +#define UTILS_GETTEXTHELPER_H #include "localconsts.h" @@ -29,7 +29,11 @@ class GettextHelper final static void initLang(); private: +#ifdef ENABLE_NLS static void bindTextDomain(const char *const path); +#else + static void bindTextDomain(const char *const path A_UNUSED); +#endif }; -#endif // GETTEXTHELPER_H +#endif // UTILS_GETTEXTHELPER_H diff --git a/src/utils/translation/translationmanager.cpp b/src/utils/translation/translationmanager.cpp index 5fddee639..70b84c5ad 100644 --- a/src/utils/translation/translationmanager.cpp +++ b/src/utils/translation/translationmanager.cpp @@ -27,8 +27,6 @@ #include "utils/translation/podict.h" #include "utils/translation/poparser.h" -#include "resources/resourcemanager.h" - #include "logger.h" #include "debug.h" diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index 3144a03b6..3ef99758e 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -24,8 +24,6 @@ #include "logger.h" -#include "resources/resourcemanager.h" - #include "utils/fuzzer.h" #include "utils/physfstools.h" #include "utils/stringutils.h" diff --git a/src/utils/xmlutils_unittest.cc b/src/utils/xmlutils_unittest.cc index 5b3469805..22d1b8ebc 100644 --- a/src/utils/xmlutils_unittest.cc +++ b/src/utils/xmlutils_unittest.cc @@ -48,8 +48,7 @@ static void init() TEST(xmlutils, readXmlIntVector1) { - Client::Options options; - client = new Client(options); + client = new Client; init(); std::vector<int> arr; |