#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 (argv); d_printf ("\n\n ***** Bomberclone Version %s \n\n",VERSION); if (ReadConfig()) { gfx_init (); menu_get_text ("Please You Playername", bman.playername, LEN_PLAYERNAME-1); bman.playername[LEN_PLAYERNAME-1] = 0; } else { gfx_init (); if (bman.askplayername) menu_get_text ("Please You Playername", bman.playername, LEN_PLAYERNAME); else menu_clearkeybuff(); } ReadPrgArgs (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_playergame (); break; case (1) : // Multiplayer netmenu(); break; case (2) : // Options configuration (); break; case (3) : // Quit bman.state = GS_quit; break; } } gfx_shutdown (); return 0; };