summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-08 01:33:53 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-08 01:33:53 +0000
commitee416a5f3de03a689247a290077e7fdf451e1a23 (patch)
treef456df99f954919ac7a425606df51f010aa4ef2d /src/main.cpp
parent4070dda1560bc729c3e272f0a5c03d77391e2661 (diff)
downloadmana-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.gz
mana-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.bz2
mana-ee416a5f3de03a689247a290077e7fdf451e1a23.tar.xz
mana-ee416a5f3de03a689247a290077e7fdf451e1a23.zip
Well improved window container and window widgets a bit, and made a start
on support for modal dialogs. Still some issues to work out. Tell me if you experience something unsettling.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a955ea01..625b385d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -294,22 +294,8 @@ void init_engine() {
// TODO: Remove Allegro config file usage from GUI look
init_gui(buffer, "data/Skin/aqua.skin");
state = LOGIN;
-}
-/** Clear the engine */
-void exit_engine() {
- config.write(dir);
- delete dir;
- gui_exit();
- destroy_bitmap(buffer);
- allegro_exit();
-}
-
-/** Main */
-int main() {
- init_engine();
#ifndef WIN32
-
// initialize sound-engine and start playing intro-theme /-kth5
try {
if (config.getValue("sound", 0) == 1) {
@@ -328,33 +314,47 @@ int main() {
warning(err);
}
#endif /* not WIN32 */
+}
+
+/** Clear the engine */
+void exit_engine() {
+ config.write(dir);
+ delete dir;
+ gui_exit();
+ destroy_bitmap(buffer);
+ allegro_exit();
+}
+
+/** Main */
+int main() {
+ init_engine();
while (state != EXIT) {
- switch(state) {
- case LOGIN:
- status("LOGIN");
- login();
- break;
- case CHAR_SERVER:
- status("CHAR_SERVER");
- char_server();
- break;
- case CHAR_SELECT:
- status("CHAR_SELECT");
- charSelect();
- break;
- case GAME:
+ switch (state) {
+ case LOGIN:
+ status("LOGIN");
+ login();
+ break;
+ case CHAR_SERVER:
+ status("CHAR_SERVER");
+ char_server();
+ break;
+ case CHAR_SELECT:
+ status("CHAR_SELECT");
+ charSelect();
+ break;
+ case GAME:
#ifndef WIN32
- sound.stopBgm();
+ sound.stopBgm();
#endif /* not WIN32 */
- status("GAME");
- map_start();
- if( state==GAME )
- game();
- break;
- default:
- state = EXIT;
- break;
+ status("GAME");
+ map_start();
+ if (state == GAME)
+ game();
+ break;
+ default:
+ state = EXIT;
+ break;
}
}
status("EXIT");