video menu and option menu got mixed up after the video menu was selected

origin r0-11-0
stpohle 22 years ago
parent 3196ca7110
commit 67f576a28b

@ -1,9 +1,9 @@
$Id: ChangeLog,v 1.50 2004/01/06 20:49:57 stpohle Exp $ $Id: ChangeLog,v 1.51 2004/01/06 23:07:21 stpohle Exp $
Version 0.11.0 Version 0.11.0
============== ==============
2004-01-06 2004-01-06
- Added Programm flags to the game. For more information - Added Programm options to the game. For more information
run BomberClone with -help. run BomberClone with -help.
- Compiler Flag added for disabling debuging. Compiler - Compiler Flag added for disabling debuging. Compiler

@ -73,16 +73,16 @@ config_init (int argc, char **argv)
map.sp_trigger = GAME_SPECIAL_ITEMSTRIGGER; map.sp_trigger = GAME_SPECIAL_ITEMSTRIGGER;
map.sp_row = GAME_SPECIAL_ITEMSROW; map.sp_row = GAME_SPECIAL_ITEMSROW;
map.sp_push = GAME_SPECIAL_ITEMSPUSH; map.sp_push = GAME_SPECIAL_ITEMSPUSH;
d_printf ("\n\n ***** Bomberclone Version %s \n\n", VERSION);
d_printf ("\n\n ***** Bomberclone Version %s \n\n",VERSION); if (config_read ()) { /* error on reading the config file */
if (config_read()) { /* error on reading the config file */
ReadPrgArgs (argc, argv); ReadPrgArgs (argc, argv);
gfx_init (); gfx_init ();
draw_logo (); draw_logo ();
bman.playername[LEN_PLAYERNAME-1] = 0; bman.playername[LEN_PLAYERNAME - 1] = 0;
bman.playername[0] = 0; bman.playername[0] = 0;
config_menu (); config_menu ();
} else { }
else {
ReadPrgArgs (argc, argv); ReadPrgArgs (argc, argv);
gfx_init (); gfx_init ();
draw_logo (); draw_logo ();
@ -98,7 +98,9 @@ config_init (int argc, char **argv)
/* read the configuration file /* read the configuration file
* return -1 if something went wrong and 0 if no problem */ * return -1 if something went wrong and 0 if no problem */
int config_read () { int
config_read ()
{
FILE *config; FILE *config;
char buf[1024]; char buf[1024];
char *findit, char *findit,
@ -185,7 +187,7 @@ int config_read () {
LEN_PATHFILENAME); LEN_PATHFILENAME);
} }
value[511] = 0; value[511] = 0;
strcpy(map.map,value); strcpy (map.map, value);
} }
if (!strcmp (keyword, "firewall")) { if (!strcmp (keyword, "firewall")) {
bman.firewall = atoi (value); bman.firewall = atoi (value);
@ -241,7 +243,7 @@ int config_read () {
if (!strcmp (keyword, "gametimeout")) { if (!strcmp (keyword, "gametimeout")) {
bman.init_timeout = atoi (value); bman.init_timeout = atoi (value);
} }
if(!strcmp (keyword, "sndrate")) { if (!strcmp (keyword, "sndrate")) {
snd.audio_rate = atoi (value); snd.audio_rate = atoi (value);
} }
if (!strcmp (keyword, "sndchannels")) { if (!strcmp (keyword, "sndchannels")) {
@ -311,7 +313,10 @@ config_write ()
void void
config_video () config_video ()
{ {
int done = 0, menuselect, x, y; int done = 0,
menuselect,
x,
y;
_charlist screenres[] = { _charlist screenres[] = {
{"640x480", NULL}, {"640x480", NULL},
{"800x600", NULL}, {"800x600", NULL},
@ -357,7 +362,8 @@ config_video ()
case (1): // new resolution case (1): // new resolution
gfx_shutdown (); gfx_shutdown ();
sscanf (selres->text, "%dx%d", &x, &y); sscanf (selres->text, "%dx%d", &x, &y);
gfx.res.x = x; gfx.res.y = y; gfx.res.x = x;
gfx.res.y = y;
gfx_init (); gfx_init ();
break; break;
case (2): // new color depth case (2): // new color depth
@ -385,19 +391,19 @@ config_menu ()
{ {
int menuselect = 0; int menuselect = 0;
while (menuselect != -1 && bman.state != GS_quit) {
menu_new ("Configuration", 400, 300); menu_new ("Configuration", 400, 300);
menu_create_label ("General Option", -1, 50, 1); menu_create_label ("General Option", -1, 50, 1);
menu_create_entry ("Name", -1, 85, 200, bman.playername, LEN_PLAYERNAME, MENU_entrytext, 1); menu_create_entry ("Name", -1, 85, 200, bman.playername, LEN_PLAYERNAME, MENU_entrytext, 1);
menu_create_button ("Video Setup", -1, 120, 200, 2); menu_create_button ("Video Setup", -1, 120, 200, 2);
menu_create_label ("Sound", 25 , 154, 0); menu_create_label ("Sound", 25, 154, 0);
menu_create_bool ("ON", 100, 150, 50, &snd.playsound, 3); menu_create_bool ("ON", 100, 150, 50, &snd.playsound, 3);
menu_create_label ("Music", 250 , 154, 0); menu_create_label ("Music", 250, 154, 0);
menu_create_bool ("ON", 325, 150, 50, &snd.playmusic, 4); menu_create_bool ("ON", 325, 150, 50, &snd.playmusic, 4);
menu_create_label ("Extended Option", -1, 200, 1); menu_create_label ("Extended Option", -1, 200, 1);
menu_create_bool ("Debug", 25, 230, 150, &debug, 5); menu_create_bool ("Debug", 25, 230, 150, &debug, 5);
menu_create_bool ("Ask Playername", 250, 230, 150, &bman.askplayername, 6); menu_create_bool ("Ask Playername", 250, 230, 150, &bman.askplayername, 6);
menu_create_button ("Ok", -1, 270, 150, 0); menu_create_button ("Ok", -1, 270, 150, 0);
while (menuselect != -1 && bman.state != GS_quit) {
if (bman.playername[0] == '\0') if (bman.playername[0] == '\0')
menu_focus_id (1); menu_focus_id (1);
else else
@ -406,6 +412,7 @@ config_menu ()
menu_reload (); menu_reload ();
menuselect = menu_loop (); menuselect = menu_loop ();
menu_delete ();
switch (menuselect) { switch (menuselect) {
case (0): // Back to the Main Menu case (0): // Back to the Main Menu
if (bman.playername[0] == '\0') if (bman.playername[0] == '\0')
@ -418,7 +425,6 @@ config_menu ()
break; break;
} }
} }
menu_delete ();
config_write (); config_write ();
}; };

Loading…
Cancel
Save