/* $Id: main.c,v 1.23 2004/02/07 13:35:28 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, 230); 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 ("Manual", -1, 160, 200, 3); menu_create_button ("Quit Game", -1, 190, 200, 4); 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) : // Manual help (); break; case (4) : // Quit bman.state = GS_quit; break; } } gfx_shutdown (); return 0; };