From 59167f0f02dfd2c8463b2f3d93a8ac219dcc012e Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Sun, 16 Oct 2005 13:42:33 +0000 Subject: The connection should be non-blocking now and fixed the problem with sound not being played at startup. --- src/main.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/main.cpp') 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; -- cgit v1.2.3-60-g2f50