summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 21:13:02 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 21:13:02 +0100
commit60f10c242fc4f99b0ab0f8d8c6d4b4acde0022cd (patch)
tree2a3f33bb7af2bf88998a5337e1a739ea12712519 /src/game.cpp
parent712ca58c011123505c807266dcc8d9d84ca1aa44 (diff)
downloadmana-client-60f10c242fc4f99b0ab0f8d8c6d4b4acde0022cd.tar.gz
mana-client-60f10c242fc4f99b0ab0f8d8c6d4b4acde0022cd.tar.bz2
mana-client-60f10c242fc4f99b0ab0f8d8c6d4b4acde0022cd.tar.xz
mana-client-60f10c242fc4f99b0ab0f8d8c6d4b4acde0022cd.zip
Clean up of most of the Network pointers
Now that messages can be sent without requiring a pointer to the Network instance, a lot of cleanup was possible.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp34
1 files changed, 6 insertions, 28 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 5b389c3f..856a5c11 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -239,14 +239,9 @@ int get_elapsed_time(int start_time)
/**
* Create all the various globally accessible gui windows
*/
-#ifdef TMWSERV_SUPPORT
-void createGuiWindows()
-#else
-void createGuiWindows(Network *network)
-#endif
+static void createGuiWindows()
{
// Create dialogs
-#ifdef TMWSERV_SUPPORT
chatWindow = new ChatWindow;
buyDialog = new BuyDialog;
sellDialog = new SellDialog;
@@ -255,6 +250,7 @@ void createGuiWindows(Network *network)
npcIntegerDialog = new NpcIntegerDialog;
npcListDialog = new NpcListDialog;
npcStringDialog = new NpcStringDialog;
+#ifdef TMWSERV_SUPPORT
npcPostDialog = new NpcPostDialog;
magicDialog = new MagicDialog;
equipmentWindow = new EquipmentWindow(player_node->mEquipment.get());
@@ -262,17 +258,9 @@ void createGuiWindows(Network *network)
guildWindow = new GuildWindow;
partyWindow = new PartyWindow;
#else
- chatWindow = new ChatWindow(network);
- buyDialog = new BuyDialog(network);
- sellDialog = new SellDialog(network);
- buySellDialog = new BuySellDialog(network);
- tradeWindow = new TradeWindow(network);
+ buySellDialog = new BuySellDialog;
equipmentWindow = new EquipmentWindow;
- npcTextDialog = new NpcTextDialog(network);
- npcIntegerDialog = new NpcIntegerDialog(network);
- npcListDialog = new NpcListDialog(network);
- npcStringDialog = new NpcStringDialog(network);
- storageWindow = new StorageWindow(network);
+ storageWindow = new StorageWindow;
#endif
menuWindow = new MenuWindow;
statusWindow = new StatusWindow(player_node);
@@ -328,7 +316,7 @@ void createGuiWindows(Network *network)
/**
* Destroy all the globally accessible gui windows
*/
-void destroyGuiWindows()
+static void destroyGuiWindows()
{
logger->setChatWindow(NULL);
delete localChatTab; // Need to do this first, so it can remove itself
@@ -392,20 +380,11 @@ Game::Game(Network *network):
{
done = false;
-#ifdef TMWSERV_SUPPORT
createGuiWindows();
engine = new Engine;
beingManager = new BeingManager;
commandHandler = new CommandHandler;
-#else
- createGuiWindows(network);
- engine = new Engine(network);
-
- beingManager = new BeingManager(network);
- commandHandler = new CommandHandler(network);
-#endif
-
floorItemManager = new FloorItemManager;
channelManager = new ChannelManager;
effectManager = new EffectManager;
@@ -425,8 +404,7 @@ Game::Game(Network *network):
// Initialize beings
beingManager->setPlayer(player_node);
#ifdef EATHENA_SUPPORT
- player_node->setNetwork(network);
- playerParty = new Party(network);
+ playerParty = new Party;
#endif
Joystick::init();