Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 8772 → Rev 8771

/source/duke3d/src/menus.cpp
4392,22 → 4392,6
// lexicographical sorting?
}
 
static void Menu_CheckHiddenSelection(Menu_t* m)
{
auto const menu = (MenuMenu_t *)m->object;
auto const orig = menu->currentEntry;
 
while (!menu->entrylist[menu->currentEntry] ||
(((MenuEntry_t*) menu->entrylist[menu->currentEntry])->flags & MEF_Hidden) ||
((MenuEntry_t*) menu->entrylist[menu->currentEntry])->type == Spacer)
{
if (--menu->currentEntry < 0)
menu->currentEntry = menu->numEntries;
if (menu->currentEntry == orig)
G_GameExit("Menu_CheckHiddenSelection: menu has no entries!");
}
}
 
static void Menu_AboutToStartDisplaying(Menu_t * m)
{
switch (m->menuID)
4519,7 → 4503,17
if (menu->currentEntry >= menu->numEntries)
menu->currentEntry = 0;
 
Menu_CheckHiddenSelection(m);
int32_t i = menu->currentEntry;
while (!menu->entrylist[menu->currentEntry] ||
(((MenuEntry_t*)menu->entrylist[menu->currentEntry])->flags & MEF_Hidden) ||
((MenuEntry_t*)menu->entrylist[menu->currentEntry])->type == Spacer)
{
menu->currentEntry++;
if (menu->currentEntry >= menu->numEntries)
menu->currentEntry = 0;
if (menu->currentEntry == i)
G_GameExit("Menu_Change: Attempted to show a menu with no entries.");
}
 
Menu_EntryFocus(/*currentry*/);
break;
6095,8 → 6089,6
 
case Menu:
{
Menu_CheckHiddenSelection(cm);
 
int32_t state;
 
auto menu = (MenuMenu_t*)cm->object;