summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorTametomo <irarice@gmail.com>2009-05-07 01:39:44 -0600
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-14 20:54:02 +0100
commit48ad9754e83a26d598b71e495d255915e873424f (patch)
tree7154552fb93d0eb6f24c0577e1d9c8a6ce2469ce /src/game.cpp
parent8bc425ff48b7a874ca0fb9d2285044c75f3010ab (diff)
downloadmana-client-48ad9754e83a26d598b71e495d255915e873424f.tar.gz
mana-client-48ad9754e83a26d598b71e495d255915e873424f.tar.bz2
mana-client-48ad9754e83a26d598b71e495d255915e873424f.tar.xz
mana-client-48ad9754e83a26d598b71e495d255915e873424f.zip
Don't create the viewport until it's really needed.
Signed-off-by: Tametomo <irarice@gmail.com>
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 62e7c515..08dacaa1 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -129,6 +129,7 @@ ChannelManager *channelManager = NULL;
CommandHandler *commandHandler = NULL;
Particle *particleEngine = NULL;
EffectManager *effectManager = NULL;
+Viewport *viewport = NULL; /**< Viewport on the map. */
ChatTab *localChatTab = NULL;
@@ -274,6 +275,14 @@ Game::Game():
disconnectedDialog = NULL;
+ // Create the viewport
+ viewport = new Viewport();
+ viewport->setDimension(gcn::Rectangle(0, 0, graphics->getWidth(),
+ graphics->getHeight()));
+
+ gcn::Container *top = static_cast<gcn::Container*>(gui->getTop());
+ top->add(viewport);
+
createGuiWindows();
mWindowMenu = new WindowMenu;
@@ -334,6 +343,7 @@ Game::~Game()
delete commandHandler;
delete joystick;
delete particleEngine;
+ delete viewport;
viewport->setMap(NULL);