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.
bomberclone/src/main.c

61 lines
1.1 KiB

#include "bomberclone.h"
#include "network.h"
#include "gfx.h"
#ifndef _WIN32
#include "../config.h"
#endif
_bomberclone bman; // Holds GameData
Uint32 timestamp; // timestamp
int
main (int argc, char **argv)
{
int menuselect = 0;
_menu menu[] = {
{1, "Singleplayer"},
{1, "Multiplayer"},
{1, "Configuration"},
{1, "Quit Game"},
{-1, ""}
};
char text[255];
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);
game_init (argc, argv);
sprintf(text,"Welcome to BomberClone");
while (menuselect != -1 && bman.state != GS_quit) {
menuselect = menu_loop (text , menu, menuselect);
switch (menuselect) {
case (0) : // Singleplayer
single_menu ();
break;
case (1) : // Multiplayer
netmenu();
break;
case (2) : // Options
configuration ();
break;
case (3) : // Quit
bman.state = GS_quit;
break;
}
}
gfx_shutdown ();
return 0;
};