diff options
author | Simon Howard | 2006-09-29 11:49:30 +0000 |
---|---|---|
committer | Simon Howard | 2006-09-29 11:49:30 +0000 |
commit | 481b3391baff23f1682df009df7d3387d62f3d75 (patch) | |
tree | 8601712b0ea4659709f5b3a373c274d68151780e /setup/sound.c | |
parent | 196e21dc30f6f2092992cdba5164a8985da41ecf (diff) | |
download | chocolate-doom-481b3391baff23f1682df009df7d3387d62f3d75.tar.gz chocolate-doom-481b3391baff23f1682df009df7d3387d62f3d75.tar.bz2 chocolate-doom-481b3391baff23f1682df009df7d3387d62f3d75.zip |
Use TXT_AddWidgets in setup for greatly enhanced readability.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 679
Diffstat (limited to 'setup/sound.c')
-rw-r--r-- | setup/sound.c | 63 |
1 files changed, 26 insertions, 37 deletions
diff --git a/setup/sound.c b/setup/sound.c index 0e8869d4..a96868ab 100644 --- a/setup/sound.c +++ b/setup/sound.c @@ -35,45 +35,34 @@ int music_volume = 15; void ConfigSound(void) { txt_window_t *window; - txt_table_t *table; - txt_checkbox_t *checkbox; - txt_spincontrol_t *spincontrol; + txt_table_t *sfx_table; + txt_table_t *music_table; window = TXT_NewWindow("Sound configuration"); - TXT_AddWidget(window, TXT_NewSeparator("Sound effects")); - - checkbox = TXT_NewCheckBox("Sound effects enabled", &snd_sfxenabled); - TXT_AddWidget(window, checkbox); - - table = TXT_NewTable(2); - TXT_SetColumnWidths(table, 20, 5); - - TXT_AddWidget(table, TXT_NewLabel("Sound channels")); - - spincontrol = TXT_NewSpinControl(&snd_channels, 1, 8); - TXT_AddWidget(table, spincontrol); - - TXT_AddWidget(table, TXT_NewLabel("SFX volume")); - - spincontrol = TXT_NewSpinControl(&sfx_volume, 0, 15); - TXT_AddWidget(table, spincontrol); - - TXT_AddWidget(window, table); - - TXT_AddWidget(window, TXT_NewSeparator("Music")); - - checkbox = TXT_NewCheckBox("Music enabled", &snd_musicenabled); - TXT_AddWidget(window, checkbox); - - table = TXT_NewTable(2); - TXT_SetColumnWidths(table, 20, 5); - - TXT_AddWidget(table, TXT_NewLabel("Music volume")); - - spincontrol = TXT_NewSpinControl(&music_volume, 0, 15); - TXT_AddWidget(table, spincontrol); - - TXT_AddWidget(window, table); + TXT_AddWidgets(window, + TXT_NewSeparator("Sound effects"), + TXT_NewCheckBox("Sound effects enabled", &snd_sfxenabled), + sfx_table = TXT_NewTable(2), + TXT_NewSeparator("Music"), + TXT_NewCheckBox("Music enabled", &snd_musicenabled), + music_table = TXT_NewTable(2), + NULL); + + TXT_SetColumnWidths(sfx_table, 20, 5); + + TXT_AddWidgets(sfx_table, + TXT_NewLabel("Sound channels"), + TXT_NewSpinControl(&snd_channels, 1, 8), + TXT_NewLabel("SFX volume"), + TXT_NewSpinControl(&sfx_volume, 0, 15), + NULL); + + TXT_SetColumnWidths(music_table, 20, 5); + + TXT_AddWidgets(music_table, + TXT_NewLabel("Music volume"), + TXT_NewSpinControl(&music_volume, 0, 15), + NULL); } |