diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-29 01:08:33 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-29 12:56:42 +0300 |
commit | 5f048b85f826a85278545ac363d7058793fb3ece (patch) | |
tree | 08065744c9dbe0bcc428955c5187df17b88a70e2 /src | |
parent | 7c74dc533ce120a27ac4b68acb1c5b2f6c5cc680 (diff) | |
download | mv-5f048b85f826a85278545ac363d7058793fb3ece.tar.gz mv-5f048b85f826a85278545ac363d7058793fb3ece.tar.bz2 mv-5f048b85f826a85278545ac363d7058793fb3ece.tar.xz mv-5f048b85f826a85278545ac363d7058793fb3ece.zip |
Move variables definition into each file with class definition.
Diffstat (limited to 'src')
44 files changed, 85 insertions, 56 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp index dcb439e0f..699eb7fbd 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -58,6 +58,8 @@ #define for_actorsm for (ActorSpritesIterator it = mActors.begin(), \ it_end = mActors.end() ; it != it_end; ++it) +ActorManager *actorManager = nullptr; + class FindBeingFunctor final { public: diff --git a/src/auctionmanager.cpp b/src/auctionmanager.cpp index 1ce20a733..2d02870f3 100644 --- a/src/auctionmanager.cpp +++ b/src/auctionmanager.cpp @@ -28,6 +28,8 @@ #include "debug.h" +AuctionManager *auctionManager = nullptr; + bool AuctionManager::mEnableAuctionBot = false; AuctionManager::AuctionManager() diff --git a/src/chatlogger.cpp b/src/chatlogger.cpp index 52c57dcf0..679de9ece 100644 --- a/src/chatlogger.cpp +++ b/src/chatlogger.cpp @@ -38,6 +38,8 @@ #include "debug.h" +ChatLogger *chatLogger = nullptr; + ChatLogger::ChatLogger() : mLogFile(), mLogDir(), diff --git a/src/client.cpp b/src/client.cpp index e1df248b5..4688e7306 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -172,11 +172,6 @@ std::string errorMessage; LoginData loginData; Client *client = nullptr; -ChatLogger *chatLogger = nullptr; // Chat log object -KeyboardConfig keyboard; -UserPalette *userPalette = nullptr; - -SoundManager soundManager; volatile bool runCounters; bool isSafeMode = false; diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index ef8acc26c..d3c0b248a 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -33,6 +33,8 @@ #include "debug.h" +CommandHandler *commandHandler = nullptr; + CommandHandler::CommandHandler() : mCommands() { diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp index c9114529f..8cc987e6e 100644 --- a/src/effectmanager.cpp +++ b/src/effectmanager.cpp @@ -34,6 +34,8 @@ #include "debug.h" +EffectManager *effectManager = nullptr; + EffectManager::EffectManager() : mEffects() { diff --git a/src/game.cpp b/src/game.cpp index 6d82f7138..addc55ad3 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -125,58 +125,10 @@ #include "debug.h" -Joystick *joystick = nullptr; - -OkDialog *weightNotice = nullptr; -int weightNoticeTime = 0; -OkDialog *deathNotice = nullptr; QuitDialog *quitDialog = nullptr; Window *disconnectedDialog = nullptr; -ChatWindow *chatWindow = nullptr; -EmoteWindow *emoteWindow = nullptr; -StatusWindow *statusWindow = nullptr; -MiniStatusWindow *miniStatusWindow = nullptr; -InventoryWindow *inventoryWindow = nullptr; -ShopWindow *shopWindow = nullptr; -SkillDialog *skillDialog = nullptr; -Minimap *minimap = nullptr; -EquipmentWindow *equipmentWindow = nullptr; -EquipmentWindow *beingEquipmentWindow = nullptr; -TradeWindow *tradeWindow = nullptr; -HelpWindow *helpWindow = nullptr; -DebugWindow *debugWindow = nullptr; -ShortcutWindow *itemShortcutWindow = nullptr; -ShortcutWindow *emoteShortcutWindow = nullptr; -OutfitWindow *outfitWindow = nullptr; -ShortcutWindow *dropShortcutWindow = nullptr; -ShortcutWindow *spellShortcutWindow = nullptr; -WhoIsOnline *whoIsOnline = nullptr; -DidYouKnowWindow *didYouKnowWindow = nullptr; -KillStats *killStats = nullptr; -BotCheckerWindow *botCheckerWindow = nullptr; -SocialWindow *socialWindow = nullptr; -QuestsWindow *questsWindow = nullptr; -WindowMenu *windowMenu = nullptr; - -ActorManager *actorManager = nullptr; -CommandHandler *commandHandler = nullptr; -#ifdef USE_MUMBLE -MumbleManager *mumbleManager = nullptr; -#endif -Particle *particleEngine = nullptr; -EffectManager *effectManager = nullptr; -SpellManager *spellManager = nullptr; -Viewport *viewport = nullptr; /**< Viewport on the map. */ -GuildManager *guildManager = nullptr; -AuctionManager *auctionManager = nullptr; - -ChatTab *localChatTab = nullptr; -ChatTab *debugChatTab = nullptr; -TradeTab *tradeChatTab = nullptr; -BattleTab *battleChatTab = nullptr; -GmTab *gmChatTab = nullptr; -LangTab *langChatTab = nullptr; +int weightNoticeTime = 0; bool mStatsReUpdated = false; const unsigned adjustDelay = 10; diff --git a/src/gui/userpalette.cpp b/src/gui/userpalette.cpp index a1211477a..04b1c15d4 100644 --- a/src/gui/userpalette.cpp +++ b/src/gui/userpalette.cpp @@ -29,6 +29,8 @@ #include "debug.h" +UserPalette *userPalette = nullptr; + const std::string ColorTypeNames[] = { "ColorBeing", diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index fbe056d2a..af199c42e 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -54,6 +54,8 @@ #include "debug.h" +Viewport *viewport = nullptr; + extern volatile int tick_time; extern MiniStatusWindow *miniStatusWindow; diff --git a/src/gui/widgets/tabs/battletab.cpp b/src/gui/widgets/tabs/battletab.cpp index 9d29c198e..176a24151 100644 --- a/src/gui/widgets/tabs/battletab.cpp +++ b/src/gui/widgets/tabs/battletab.cpp @@ -29,6 +29,8 @@ #include "debug.h" +BattleTab *battleChatTab = nullptr; + BattleTab::BattleTab(const Widget2 *const widget) : // TRANSLATORS: battle chat tab name ChatTab(widget, _("Battle"), "") diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp index 4f81d2aa7..893149a98 100644 --- a/src/gui/widgets/tabs/chattab.cpp +++ b/src/gui/widgets/tabs/chattab.cpp @@ -55,6 +55,9 @@ #include "debug.h" +ChatTab *localChatTab = nullptr; +ChatTab *debugChatTab = nullptr; + static const unsigned int MAX_WORD_SIZE = 50; ChatTab::ChatTab(const Widget2 *const widget, diff --git a/src/gui/widgets/tabs/gmtab.cpp b/src/gui/widgets/tabs/gmtab.cpp index 7b6e1e07c..a4a4a9022 100644 --- a/src/gui/widgets/tabs/gmtab.cpp +++ b/src/gui/widgets/tabs/gmtab.cpp @@ -26,6 +26,8 @@ #include "debug.h" +GmTab *gmChatTab = nullptr; + GmTab::GmTab(const Widget2 *const widget) : // TRANSLATORS: gb tab name ChatTab(widget, _("GM"), "") diff --git a/src/gui/widgets/tabs/langtab.cpp b/src/gui/widgets/tabs/langtab.cpp index f5064be8c..1dc5cea09 100644 --- a/src/gui/widgets/tabs/langtab.cpp +++ b/src/gui/widgets/tabs/langtab.cpp @@ -26,6 +26,8 @@ #include "debug.h" +LangTab *langChatTab = nullptr; + LangTab::LangTab(const Widget2 *const widget, const std::string &lang) : // TRANSLATORS: lang chat tab name diff --git a/src/gui/widgets/tabs/tradetab.cpp b/src/gui/widgets/tabs/tradetab.cpp index 12fa0d3a5..1642f8804 100644 --- a/src/gui/widgets/tabs/tradetab.cpp +++ b/src/gui/widgets/tabs/tradetab.cpp @@ -30,6 +30,8 @@ #include "debug.h" +TradeTab *tradeChatTab = nullptr; + TradeTab::TradeTab(const Widget2 *const widget) : // TRANSLATORS: trade chat tab name ChatTab(widget, _("Trade"), TRADE_CHANNEL) diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index a4908d2a6..35bd23ec7 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -45,6 +45,8 @@ #include "debug.h" +WindowMenu *windowMenu = nullptr; + WindowMenu::WindowMenu(const Widget2 *const widget) : Container(widget), ActionListener(), diff --git a/src/gui/windows/botcheckerwindow.cpp b/src/gui/windows/botcheckerwindow.cpp index 292d18891..7f8ffe14c 100644 --- a/src/gui/windows/botcheckerwindow.cpp +++ b/src/gui/windows/botcheckerwindow.cpp @@ -36,6 +36,8 @@ #include "debug.h" +BotCheckerWindow *botCheckerWindow = nullptr; + BotCheckerWindow::BotCheckerWindow() : // TRANSLATORS: bot checker window header Window(_("Bot Checker"), false, nullptr, "botchecker.xml"), diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 921d32fff..d92473977 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -85,6 +85,8 @@ #include "debug.h" +ChatWindow *chatWindow = nullptr; + static const char *const ACTION_COLOR_PICKER = "color picker"; ChatWindow::ChatWindow() : diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp index bcf51d023..c12fb962b 100644 --- a/src/gui/windows/debugwindow.cpp +++ b/src/gui/windows/debugwindow.cpp @@ -35,6 +35,8 @@ #include "debug.h" +DebugWindow *debugWindow = nullptr; + DebugWindow::DebugWindow() : // TRANSLATORS: debug window name Window(_("Debug"), false, nullptr, "debug.xml"), diff --git a/src/gui/windows/didyouknowwindow.cpp b/src/gui/windows/didyouknowwindow.cpp index 09051e9c0..fc7294999 100644 --- a/src/gui/windows/didyouknowwindow.cpp +++ b/src/gui/windows/didyouknowwindow.cpp @@ -43,6 +43,8 @@ #include "debug.h" +DidYouKnowWindow *didYouKnowWindow = nullptr; + static const int minTip = 1; static const int maxTip = 18; diff --git a/src/gui/windows/emotewindow.cpp b/src/gui/windows/emotewindow.cpp index 713a6e567..d9e303012 100644 --- a/src/gui/windows/emotewindow.cpp +++ b/src/gui/windows/emotewindow.cpp @@ -36,6 +36,7 @@ #include "debug.h" +EmoteWindow *emoteWindow = nullptr; static const int fontSizeListSize = 2; static const char *const fontSizeList[] = diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 3cd1cd92e..22d7a8567 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -53,6 +53,8 @@ #include "debug.h" +EquipmentWindow *equipmentWindow = nullptr; +EquipmentWindow *beingEquipmentWindow = nullptr; static const int BOX_COUNT = 13; EquipmentWindow::EquipmentWindow(Equipment *const equipment, diff --git a/src/gui/windows/helpwindow.cpp b/src/gui/windows/helpwindow.cpp index e10900908..5e6b5ced2 100644 --- a/src/gui/windows/helpwindow.cpp +++ b/src/gui/windows/helpwindow.cpp @@ -47,6 +47,8 @@ #include "debug.h" +HelpWindow *helpWindow = nullptr; + HelpWindow::HelpWindow() : // TRANSLATORS: help window name Window(_("Help"), false, nullptr, "help.xml"), diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 43e5112a0..a16543099 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -68,6 +68,7 @@ #include "debug.h" +InventoryWindow *inventoryWindow = nullptr; InventoryWindow::WindowList InventoryWindow::invInstances; InventoryWindow::InventoryWindow(Inventory *const inventory) : diff --git a/src/gui/windows/killstats.cpp b/src/gui/windows/killstats.cpp index 7bb0b7397..c266683f3 100644 --- a/src/gui/windows/killstats.cpp +++ b/src/gui/windows/killstats.cpp @@ -40,6 +40,8 @@ #include "debug.h" +KillStats *killStats = nullptr; + KillStats::KillStats() : // TRANSLATORS: kill stats window name Window(_("Kill stats"), false, nullptr, "killstats.xml"), diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index 5df1b60ce..928098fea 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -49,6 +49,7 @@ #include "debug.h" +Minimap *minimap = nullptr; bool Minimap::mShow = true; Minimap::Minimap() : diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index 4417ff2fc..7196a8df7 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -51,6 +51,7 @@ #include "debug.h" +MiniStatusWindow *miniStatusWindow = nullptr; extern volatile int tick_time; typedef std::vector <ProgressBar*>::const_iterator ProgressBarVectorCIter; diff --git a/src/gui/windows/okdialog.cpp b/src/gui/windows/okdialog.cpp index bf8a64026..bdb41e6a1 100644 --- a/src/gui/windows/okdialog.cpp +++ b/src/gui/windows/okdialog.cpp @@ -34,6 +34,9 @@ #include "debug.h" +OkDialog *weightNotice = nullptr; +OkDialog *deathNotice = nullptr; + OkDialog::OkDialog(const std::string &restrict title, const std::string &restrict msg, const int soundEvent, const bool modal, diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index 60030fbd3..b2b62192a 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -49,6 +49,8 @@ #include "debug.h" +OutfitWindow *outfitWindow = nullptr; + OutfitWindow::OutfitWindow() : // TRANSLATORS: outfits window name Window(_("Outfits"), false, nullptr, "outfits.xml"), diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index 2e4ce2693..3985c3129 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -56,6 +56,8 @@ #include "debug.h" +QuestsWindow *questsWindow = nullptr; + QuestsWindow::QuestsWindow() : // TRANSLATORS: quests window name Window(_("Quests"), false, nullptr, "quests.xml"), diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index 51d102972..84af6355c 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -72,6 +72,7 @@ #include "debug.h" +ShopWindow *shopWindow = nullptr; extern std::string tradePartnerName; ShopWindow::DialogList ShopWindow::instances; diff --git a/src/gui/windows/shortcutwindow.cpp b/src/gui/windows/shortcutwindow.cpp index 20fcdd0a0..26bd4b89e 100644 --- a/src/gui/windows/shortcutwindow.cpp +++ b/src/gui/windows/shortcutwindow.cpp @@ -36,6 +36,10 @@ #include "debug.h" +ShortcutWindow *dropShortcutWindow = nullptr; +ShortcutWindow *emoteShortcutWindow = nullptr; +ShortcutWindow *itemShortcutWindow = nullptr; +ShortcutWindow *spellShortcutWindow = nullptr; static const int SCROLL_PADDING = 0; int ShortcutWindow::mBoxesWidth = 0; diff --git a/src/gui/windows/shortcutwindow.h b/src/gui/windows/shortcutwindow.h index 9a447d05c..6a585745a 100644 --- a/src/gui/windows/shortcutwindow.h +++ b/src/gui/windows/shortcutwindow.h @@ -87,8 +87,9 @@ class ShortcutWindow final : public Window static int mBoxesWidth; }; -extern ShortcutWindow *itemShortcutWindow; -extern ShortcutWindow *emoteShortcutWindow; extern ShortcutWindow *dropShortcutWindow; +extern ShortcutWindow *emoteShortcutWindow; +extern ShortcutWindow *itemShortcutWindow; +extern ShortcutWindow *spellShortcutWindow; #endif // GUI_WINDOWS_SHORTCUTWINDOW_H diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 64bcdf137..fa71386a6 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -54,6 +54,8 @@ #include "debug.h" +SkillDialog *skillDialog = nullptr; + SkillDialog::SkillDialog() : // TRANSLATORS: skills dialog name Window(_("Skills"), false, nullptr, "skills.xml"), diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 7b0aa849a..d5ef89d0c 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -52,6 +52,7 @@ #include "debug.h" +SocialWindow *socialWindow = nullptr; extern unsigned int tmwServerVersion; SocialWindow::SocialWindow() : diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp index 00c5c5c2f..4a4c82cf6 100644 --- a/src/gui/windows/statuswindow.cpp +++ b/src/gui/windows/statuswindow.cpp @@ -60,6 +60,8 @@ #include "debug.h" +StatusWindow *statusWindow = nullptr; + StatusWindow::StatusWindow() : Window(player_node ? player_node->getName() : "?", false, nullptr, "status.xml"), diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index eaef2026b..1fccb0c0b 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -58,6 +58,8 @@ #include "debug.h" +TradeWindow *tradeWindow = nullptr; + // TRANSLATORS: trade window button #define CAPTION_PROPOSE _("Propose trade") // TRANSLATORS: trade window button diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 9d0f64b5a..0cb2fd5d5 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -67,6 +67,8 @@ #undef malloc #endif +WhoIsOnline *whoIsOnline = nullptr; + namespace { class NameFunctuator final diff --git a/src/guildmanager.cpp b/src/guildmanager.cpp index a55f2a96d..df2c8686f 100644 --- a/src/guildmanager.cpp +++ b/src/guildmanager.cpp @@ -42,6 +42,8 @@ #include "debug.h" +GuildManager *guildManager = nullptr; + static const int requestTimeout = 5; bool GuildManager::mEnableGuildBot = false; diff --git a/src/input/joystick.cpp b/src/input/joystick.cpp index f3dd2e90c..c9f2a85e7 100644 --- a/src/input/joystick.cpp +++ b/src/input/joystick.cpp @@ -34,6 +34,7 @@ #include "debug.h" +Joystick *joystick = nullptr; int Joystick::joystickCount = 0; bool Joystick::mEnabled = false; diff --git a/src/input/keyboardconfig.cpp b/src/input/keyboardconfig.cpp index 8fa71d6a6..49bcb831f 100644 --- a/src/input/keyboardconfig.cpp +++ b/src/input/keyboardconfig.cpp @@ -35,6 +35,8 @@ extern volatile int tick_time; +KeyboardConfig keyboard; + KeyboardConfig::KeyboardConfig() : mEnabled(true), mActiveKeys(nullptr), diff --git a/src/mumblemanager.cpp b/src/mumblemanager.cpp index 7a2337b7e..4da9febed 100644 --- a/src/mumblemanager.cpp +++ b/src/mumblemanager.cpp @@ -34,6 +34,10 @@ #include "debug.h" +#ifdef USE_MUMBLE +MumbleManager *mumbleManager = nullptr; +#endif + MumbleManager::MumbleManager() : mLinkedMem(nullptr), mLinkedMemCache() diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp index d86edf584..ed8db2d27 100644 --- a/src/particle/particle.cpp +++ b/src/particle/particle.cpp @@ -40,6 +40,8 @@ #include "debug.h" +Particle *particleEngine = nullptr; + static const float SIN45 = 0.707106781F; class Graphics; diff --git a/src/soundmanager.cpp b/src/soundmanager.cpp index f708202c6..5098dd013 100644 --- a/src/soundmanager.cpp +++ b/src/soundmanager.cpp @@ -34,6 +34,8 @@ #include "debug.h" +SoundManager soundManager; + /** * This will be set to true, when a music can be freed after a fade out * Currently used by fadeOutCallBack() diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp index 8af99db14..f04d5f9b7 100644 --- a/src/spellmanager.cpp +++ b/src/spellmanager.cpp @@ -37,6 +37,8 @@ #include "debug.h" +SpellManager *spellManager = nullptr; + SpellManager::SpellManager() : mSpells(), mSpellsVector() |