summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2005-10-16 13:42:33 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2005-10-16 13:42:33 +0000
commit59167f0f02dfd2c8463b2f3d93a8ac219dcc012e (patch)
tree3dd32d4594c1a194c4cc19e1614ea01290417431 /src/main.cpp
parentd205342bb908207f7921c444e539072e006be241 (diff)
downloadmana-client-59167f0f02dfd2c8463b2f3d93a8ac219dcc012e.tar.gz
mana-client-59167f0f02dfd2c8463b2f3d93a8ac219dcc012e.tar.bz2
mana-client-59167f0f02dfd2c8463b2f3d93a8ac219dcc012e.tar.xz
mana-client-59167f0f02dfd2c8463b2f3d93a8ac219dcc012e.zip
The connection should be non-blocking now and fixed the problem with sound not being played at startup.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 31a1b232..6ce9dd3a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -52,6 +52,8 @@
#include "gui/char_server.h"
#include "gui/char_select.h"
+#include "gui/connection.h"
+#include "gui/error.h"
#include "gui/gui.h"
#include "gui/login.h"
#include "gui/ok_dialog.h"
@@ -421,6 +423,8 @@ int main(int argc, char *argv[])
void (*inputHandler)(SDL_KeyboardEvent*) = NULL;
Image *login_wallpaper = NULL;
+
+ sound.playMusic(TMW_DATADIR "data/music/Magick - Real.ogg");
while (state != EXIT_STATE)
{
@@ -494,18 +498,10 @@ int main(int argc, char *argv[])
login_wallpaper = NULL;
logger->log("State: GAME");
- try {
- map_start();
- game();
- }
- catch (const char* err) {
- state = ERROR_STATE;
- new OkDialog("Error", err, &mapStartErrorListener);
- }
+ game();
break;
case UPDATE_STATE:
logger->log("State: UPDATE");
- sound.playMusic(TMW_DATADIR "data/music/Magick - Real.ogg");
currentDialog = new UpdaterWindow();
inputHandler = updateInputHandler;
break;
@@ -514,6 +510,11 @@ int main(int argc, char *argv[])
currentDialog = new ErrorDialog(errorMessage);
inputHandler = errorInputHandler;
break;
+ case CONNECTING_STATE:
+ logger->log("State: CONNECTING");
+ currentDialog = new ConnectionDialog();
+ inputHandler = connectionInputHandler;
+ break;
default:
state = EXIT_STATE;
break;