Instead of ignoring blank menutypes in M_IterateMenuTree, ignore them in the MIT_ functions instead.
(I'm doing this because MIT_GetMenuAtLevel appears to actually care about whether menutype is zero or not unlike the others; I don't want to break the code designed around that)
This commit is contained in:
parent
d44a8ab78e
commit
5ef4dda9b9
14
src/m_menu.c
14
src/m_menu.c
|
@ -2247,8 +2247,6 @@ static INT32 M_IterateMenuTree(menutree_iterator itfunc, void *input)
|
||||||
{
|
{
|
||||||
bitmask = ((1 << MENUBITS) - 1) << (MENUBITS*i);
|
bitmask = ((1 << MENUBITS) - 1) << (MENUBITS*i);
|
||||||
menutype = (activeMenuId & bitmask) >> (MENUBITS*i);
|
menutype = (activeMenuId & bitmask) >> (MENUBITS*i);
|
||||||
if (!menutype)
|
|
||||||
continue;
|
|
||||||
if (itfunc(menutype, i, &retval, &input, false))
|
if (itfunc(menutype, i, &retval, &input, false))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2290,6 +2288,9 @@ static boolean MIT_SetCurBackground(UINT32 menutype, INT32 level, INT32 *retval,
|
||||||
(void)retval;
|
(void)retval;
|
||||||
(void)fromoldest;
|
(void)fromoldest;
|
||||||
|
|
||||||
|
if (!menutype) // if there's nothing in this level, do nothing
|
||||||
|
return false;
|
||||||
|
|
||||||
if (menupres[menutype].bgcolor >= 0)
|
if (menupres[menutype].bgcolor >= 0)
|
||||||
{
|
{
|
||||||
curbgcolor = menupres[menutype].bgcolor;
|
curbgcolor = menupres[menutype].bgcolor;
|
||||||
|
@ -2330,6 +2331,9 @@ static boolean MIT_ChangeMusic(UINT32 menutype, INT32 level, INT32 *retval, void
|
||||||
(void)retval;
|
(void)retval;
|
||||||
(void)fromoldest;
|
(void)fromoldest;
|
||||||
|
|
||||||
|
if (!menutype) // if there's nothing in this level, do nothing
|
||||||
|
return false;
|
||||||
|
|
||||||
if (menupres[menutype].musname[0])
|
if (menupres[menutype].musname[0])
|
||||||
{
|
{
|
||||||
S_ChangeMusic(menupres[menutype].musname, menupres[menutype].mustrack, menupres[menutype].muslooping);
|
S_ChangeMusic(menupres[menutype].musname, menupres[menutype].mustrack, menupres[menutype].muslooping);
|
||||||
|
@ -2354,6 +2358,9 @@ static boolean MIT_SetCurFadeValue(UINT32 menutype, INT32 level, INT32 *retval,
|
||||||
(void)retval;
|
(void)retval;
|
||||||
(void)fromoldest;
|
(void)fromoldest;
|
||||||
|
|
||||||
|
if (!menutype) // if there's nothing in this level, do nothing
|
||||||
|
return false;
|
||||||
|
|
||||||
if (menupres[menutype].fadestrength >= 0)
|
if (menupres[menutype].fadestrength >= 0)
|
||||||
{
|
{
|
||||||
curfadevalue = (menupres[menutype].fadestrength % 32);
|
curfadevalue = (menupres[menutype].fadestrength % 32);
|
||||||
|
@ -2370,6 +2377,9 @@ static boolean MIT_SetCurHideTitlePics(UINT32 menutype, INT32 level, INT32 *retv
|
||||||
(void)retval;
|
(void)retval;
|
||||||
(void)fromoldest;
|
(void)fromoldest;
|
||||||
|
|
||||||
|
if (!menutype) // if there's nothing in this level, do nothing
|
||||||
|
return false;
|
||||||
|
|
||||||
if (menupres[menutype].hidetitlepics >= 0)
|
if (menupres[menutype].hidetitlepics >= 0)
|
||||||
{
|
{
|
||||||
curhidepics = menupres[menutype].hidetitlepics;
|
curhidepics = menupres[menutype].hidetitlepics;
|
||||||
|
|
Loading…
Reference in a new issue