soundlib selection in config file wasn't working
When there was more than one option #define'd selection was not working correctly.
This commit is contained in:
@@ -3741,8 +3741,11 @@ optfn_soundlib(
|
||||
*/
|
||||
if ((op = string_for_env_opt(allopt[optidx].name, opts, FALSE))
|
||||
!= empty_optstr) {
|
||||
enum soundlib_ids option_id;
|
||||
|
||||
get_soundlib_name(soundlibbuf, WINTYPELEN);
|
||||
option_id = soundlib_id_from_opt(op);
|
||||
gc.chosen_soundlib = option_id;
|
||||
assign_soundlib(gc.chosen_soundlib);
|
||||
} else
|
||||
return optn_err;
|
||||
|
||||
15
src/sounds.c
15
src/sounds.c
@@ -1879,6 +1879,21 @@ get_soundlib_name(char *dest, int maxlen)
|
||||
*dest = '\0';
|
||||
}
|
||||
|
||||
enum soundlib_ids
|
||||
soundlib_id_from_opt(char *op)
|
||||
{
|
||||
int idx;
|
||||
struct sound_procs *defproc = &nosound_procs,
|
||||
*sp = 0;
|
||||
|
||||
for (idx = 0; idx < SIZE(soundlib_choices); ++idx) {
|
||||
sp = soundlib_choices[idx].sndprocs;
|
||||
if (!strcmp(sp->soundname, op))
|
||||
return sp->soundlib_id;
|
||||
}
|
||||
return defproc->soundlib_id;
|
||||
}
|
||||
|
||||
/*
|
||||
* The default sound interface
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user