Add option to disable sound
This commit is contained in:
parent
fe507df7f0
commit
ccffdfef2e
9
menu.c
9
menu.c
@ -173,8 +173,9 @@ static void addexit(char *item,...) {
|
|||||||
|
|
||||||
/* game menues */
|
/* game menues */
|
||||||
|
|
||||||
char *densities[]={"PACKED","HIGH","MEDIUM","LOW"};
|
static const char *densities[]={"PACKED","HIGH","MEDIUM","LOW"};
|
||||||
char *generosities[]={"LOW","MEDIUM","HIGH","RIDICULOUS"};
|
static const char *generosities[]={"LOW","MEDIUM","HIGH","RIDICULOUS"};
|
||||||
|
static const char *dis_en_abled[]={"DISABLED","ENABLED"};
|
||||||
|
|
||||||
static void config_menu(void) {
|
static void config_menu(void) {
|
||||||
int sel;
|
int sel;
|
||||||
@ -187,6 +188,7 @@ static void config_menu(void) {
|
|||||||
additem("GENEROSITY: %s",generosities[configopts.generosity]);
|
additem("GENEROSITY: %s",generosities[configopts.generosity]);
|
||||||
additem("INITIAL FLAME LENGTH: %d",configopts.flames+1);
|
additem("INITIAL FLAME LENGTH: %d",configopts.flames+1);
|
||||||
additem("INITIAL NUMBER OF BOMBS: %d",configopts.bombs+1);
|
additem("INITIAL NUMBER OF BOMBS: %d",configopts.bombs+1);
|
||||||
|
additem("SOUND: %s", dis_en_abled[sound_enabled]);
|
||||||
sel=domenu(MENU_CONFIG, NULL);
|
sel=domenu(MENU_CONFIG, NULL);
|
||||||
switch (sel) {
|
switch (sel) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -207,6 +209,9 @@ static void config_menu(void) {
|
|||||||
configopts.bombs+=menudelta;
|
configopts.bombs+=menudelta;
|
||||||
configopts.bombs&=7;
|
configopts.bombs&=7;
|
||||||
break;
|
break;
|
||||||
|
case 5:
|
||||||
|
sound_enabled = 1 - sound_enabled;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
sound.c
4
sound.c
@ -11,6 +11,8 @@
|
|||||||
#define DATADIR "data"
|
#define DATADIR "data"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int sound_enabled = 1;
|
||||||
|
|
||||||
static char dirlist[]=DATADIR;
|
static char dirlist[]=DATADIR;
|
||||||
|
|
||||||
static int readsound(int num);
|
static int readsound(int num);
|
||||||
@ -181,6 +183,8 @@ int i,file,size,len;
|
|||||||
}
|
}
|
||||||
|
|
||||||
void playsound(int n) {
|
void playsound(int n) {
|
||||||
|
if (sound_enabled) {
|
||||||
soundcommands[soundput]=n;
|
soundcommands[soundput]=n;
|
||||||
soundput=(soundput+1)&(MAXSOUNDCOMMANDS-1);
|
soundput=(soundput+1)&(MAXSOUNDCOMMANDS-1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user