diff -r 1a23bac52645 -r 237997d34419 src/settings_gui.cpp --- a/src/settings_gui.cpp Sun Sep 28 14:07:05 2008 +0200 +++ b/src/settings_gui.cpp Sun Sep 28 14:09:54 2008 +0200 @@ -725,6 +725,7 @@ * Data structure describing one page of patches in the patch settings window. * * The names of the patches to display are statically defined and terminated with a \c NULL. + * Empty names mean start of a new group causing some additional space to be inserted before the next name. * From this information, a dynamic array (with length \a num_entries) of PatchEntry entries is * constructed. */ @@ -780,22 +781,31 @@ /* Count number of entries at each page, and fill page->num_entries */ byte count = 0; for (const char **patchname = page->names; *patchname != NULL; ++patchname) - count++; + if (**patchname != '\0') + count++; // Count only non-empty entries page->num_entries = count; page->entries = MallocT(page->num_entries); uint16 y = config_patch_y_start; - for (uint i = 0; i != page->num_entries; i++) { - uint index; - const SettingDesc *sd = GetPatchFromName(page->names[i], &index); - assert(sd != NULL); + uint i = 0; + for (const char **patchname = page->names; *patchname != NULL; ++patchname) { + if (**patchname == '\0') { // Empty entry, add some room + y += setting_height / 2; + } else { + uint index; + const SettingDesc *sd = GetPatchFromName(*patchname, &index); + assert(sd != NULL); - page->entries[i].ypos = y; - page->entries[i].setting = sd; - page->entries[i].index = index; + page->entries[i].ypos = y; + page->entries[i].setting = sd; + page->entries[i].index = index; - y += setting_height; + y += setting_height; + i++; + } } + assert(i == page->num_entries); + /* Update needed height of the option panel */ option_panel_max_height = max(y - config_patch_y_start, option_panel_max_height); }