You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.5 KiB
70 lines
1.5 KiB
/* $Id: main.c,v 1.20 2004/01/06 19:52:02 stpohle Exp $ */
|
|
|
|
#include "basic.h"
|
|
#include "bomberclone.h"
|
|
#include "network.h"
|
|
#include "gfx.h"
|
|
#include "menu.h"
|
|
|
|
|
|
_bomberclone bman; // Holds GameData
|
|
_player *players; // holds all Playerdata
|
|
|
|
Uint32 timestamp; // timestamp
|
|
float timefactor = 0.0f; /* factor for the time time of the last loop
|
|
1.0f would be 20ms */
|
|
float timediff = 0.0f; /* last loop timedifference in seconds */
|
|
|
|
|
|
int
|
|
main (int argc, char **argv)
|
|
{
|
|
char text[255];
|
|
int menuselect = 0;
|
|
|
|
players = malloc (sizeof (_player) * MAX_PLAYERS);
|
|
gfxengine_init ();
|
|
|
|
if (SDL_Init (SDL_INIT_VIDEO) != 0) {
|
|
d_printf ("Unable to init SDL: %s\n", SDL_GetError ());
|
|
return (1);
|
|
}
|
|
|
|
sprintf (text,"Bomberclone %s", VERSION);
|
|
SDL_WM_SetCaption(text , NULL);
|
|
SDL_EnableUNICODE(1);
|
|
|
|
config_init (argc, argv);
|
|
while (menuselect != -1 && bman.state != GS_quit) {
|
|
|
|
menu_new (text, 400, 200);
|
|
menu_create_button ("Single Game", -1, 70, 200, 0);
|
|
menu_create_button ("Multiplayer Game", -1, 100, 200, 1);
|
|
menu_create_button ("Options", -1, 130, 200, 2);
|
|
menu_create_button ("Quit Game", -1, 160, 200, 3);
|
|
menuselect = menu_loop ();
|
|
menu_delete ();
|
|
switch (menuselect) {
|
|
case (0) : // Singleplayer
|
|
single_menu ();
|
|
break;
|
|
case (1) : // Multiplayer
|
|
netmenu();
|
|
break;
|
|
case (2) : // Options
|
|
config_menu ();
|
|
break;
|
|
case (3) : // Quit
|
|
bman.state = GS_quit;
|
|
break;
|
|
}
|
|
}
|
|
|
|
network_init ();
|
|
network_shutdown ();
|
|
|
|
gfx_shutdown ();
|
|
|
|
return 0;
|
|
};
|