rnd-19981013-3
[rocksndiamonds.git] / src / main.c
index 93cff5b00530a5a083775101b668ff9e1889c067..49478464d427b114e7ebb2fb75218f0814988167 100644 (file)
@@ -1,13 +1,12 @@
 /***********************************************************
 *  Rocks'n'Diamonds -- McDuffin Strikes Back!              *
 *----------------------------------------------------------*
-*  ©1995 Artsoft Development                               *
-*        Holger Schemel                                    *
-*        33659 Bielefeld-Senne                             *
-*        Telefon: (0521) 493245                            *
-*        eMail: aeglos@valinor.owl.de                      *
-*               aeglos@uni-paderborn.de                    *
-*               q99492@pbhrzx.uni-paderborn.de             *
+*  (c) 1995-98 Artsoft Entertainment                       *
+*              Holger Schemel                              *
+*              Oststrasse 11a                              *
+*              33604 Bielefeld                             *
+*              phone: ++49 +521 290471                     *
+*              email: aeglos@valinor.owl.de                *
 *----------------------------------------------------------*
 *  main.c                                                  *
 ***********************************************************/
@@ -18,6 +17,7 @@
 #include "events.h"
 #include "sound.h"
 #include "joystick.h"
+#include "misc.h"
 
 #ifdef MSDOS
 #include <fcntl.h>
@@ -46,8 +46,17 @@ char        *joystick_device_name[2] = { DEV_JOYSTICK_0, DEV_JOYSTICK_1 };
 char          *level_directory = LEVEL_PATH;
 int            width, height;
 
+char          *program_name = NULL;
+char          *display_name = NULL;
+char          *server_host = NULL;
+int            server_port = 0;
+int            serveronly = FALSE;
+int            network = FALSE;
+int            verbose = FALSE;
+
 int            game_status = MAINMENU;
 int            game_emulation = EMU_NONE;
+int            network_playing = FALSE;
 int            button_status = MB_NOT_PRESSED, motion_status = FALSE;
 int            key_joystick_mapping = 0;
 int            global_joystick_status = JOYSTICK_STATUS;
@@ -64,7 +73,6 @@ int           fading_on = FALSE;
 int            autorecord_on = FALSE;
 int            joystick_nr = 0;
 int            quick_doors = FALSE;
-int            networking = FALSE;
 
 BOOL           redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
 int            redraw_x1 = 0, redraw_y1 = 0;
@@ -99,6 +107,8 @@ int          AllPlayersGone;
 int            FrameCounter, TimeFrames, TimeLeft;
 int            MampferNr, SiebAktiv;
 
+byte           network_player_action[MAX_PLAYERS];
+BOOL           network_player_action_received = FALSE;
 int            TestPlayer = 0;
 
 struct LevelDirInfo    leveldir[MAX_LEVDIR_ENTRIES];
@@ -187,22 +197,17 @@ int background_loop[] =
 };
 int num_bg_loops = sizeof(background_loop)/sizeof(int);
 
-char           *progname;
-
 int main(int argc, char *argv[])
 {
-  progname = argv[0];
-
-  if (argc>1)
-    level_directory = argv[1];
+  program_name = (strrchr(argv[0],'/') ? strrchr(argv[0],'/') + 1 : argv[0]);
 
 #ifdef MSDOS
   _fmode = O_BINARY;
 #endif
 
+  GetOptions(argv);
   OpenAll(argc,argv);
   EventLoop();
-  CloseAll();
-
-  exit(0);
+  CloseAllAndExit(0);
+  exit(0);     /* to keep compilers happy */
 }