projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-19981006-1
[rocksndiamonds.git]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index 4b1a8c64ac0da60cc1283569cef6e4662568e15c..3962a9bd7c8959c65cab4df294b13eb73d213e93 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-17,6
+17,7
@@
#include "events.h"
#include "sound.h"
#include "joystick.h"
#include "events.h"
#include "sound.h"
#include "joystick.h"
+#include "misc.h"
#ifdef MSDOS
#include <fcntl.h>
#ifdef MSDOS
#include <fcntl.h>
@@
-45,8
+46,12
@@
char *joystick_device_name[2] = { DEV_JOYSTICK_0, DEV_JOYSTICK_1 };
char *level_directory = LEVEL_PATH;
int width, height;
char *level_directory = LEVEL_PATH;
int width, height;
+char *program_name = NULL;
+char *display_name = NULL;
char *server_host = NULL;
int server_port = 0;
char *server_host = NULL;
int server_port = 0;
+int standalone = TRUE;
+int verbose = FALSE;
int game_status = MAINMENU;
int game_emulation = EMU_NONE;
int game_status = MAINMENU;
int game_emulation = EMU_NONE;
@@
-66,7
+71,6
@@
int fading_on = FALSE;
int autorecord_on = FALSE;
int joystick_nr = 0;
int quick_doors = 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;
BOOL redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
int redraw_x1 = 0, redraw_y1 = 0;
@@
-101,6
+105,8
@@
int AllPlayersGone;
int FrameCounter, TimeFrames, TimeLeft;
int MampferNr, SiebAktiv;
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];
int TestPlayer = 0;
struct LevelDirInfo leveldir[MAX_LEVDIR_ENTRIES];
@@
-189,36
+195,17
@@
int background_loop[] =
};
int num_bg_loops = sizeof(background_loop)/sizeof(int);
};
int num_bg_loops = sizeof(background_loop)/sizeof(int);
-char *progname;
-
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
- progname = argv[0];
-
-
-
- /*
- if (argc>1)
- level_directory = argv[1];
- */
-
-
-
- if (argc > 1)
- server_host = argv[1];
-
- if (argc > 2)
- server_port = atoi(argv[2]);
-
-
+ program_name = (strrchr(argv[0],'/') ? strrchr(argv[0],'/') + 1 : argv[0]);
#ifdef MSDOS
_fmode = O_BINARY;
#endif
#ifdef MSDOS
_fmode = O_BINARY;
#endif
+ GetOptions(argv);
OpenAll(argc,argv);
EventLoop();
OpenAll(argc,argv);
EventLoop();
- CloseAll();
-
- exit(0);
+ CloseAllAndExit(0);
+ exit(0); /* to keep compilers happy */
}
}