Performance improvements
* Don't loop every frame for menu drawing parameters * Fixed in-game escape menu not dimming correctly * Fixed glitches on default title screen parameters
This commit is contained in:
parent
4fa6895f60
commit
094ec7ce3c
|
@ -1126,7 +1126,8 @@ static inline void CL_DrawConnectionStatus(void)
|
||||||
INT32 ccstime = I_GetTime();
|
INT32 ccstime = I_GetTime();
|
||||||
|
|
||||||
// Draw background fade
|
// Draw background fade
|
||||||
V_DrawFadeScreen(0xFF00, 16);
|
if (!menuactive) // menu already draws its own fade
|
||||||
|
V_DrawFadeScreen(0xFF00, curfadevalue);
|
||||||
|
|
||||||
// Draw the bottom box.
|
// Draw the bottom box.
|
||||||
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
|
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
|
||||||
|
@ -1983,6 +1984,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic
|
||||||
#ifdef CLIENT_LOADINGSCREEN
|
#ifdef CLIENT_LOADINGSCREEN
|
||||||
if (client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED)
|
if (client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED)
|
||||||
{
|
{
|
||||||
|
MN_Ticker(true); // title sky
|
||||||
F_TitleScreenTicker(true);
|
F_TitleScreenTicker(true);
|
||||||
F_TitleScreenDrawer();
|
F_TitleScreenDrawer();
|
||||||
CL_DrawConnectionStatus();
|
CL_DrawConnectionStatus();
|
||||||
|
|
|
@ -309,7 +309,7 @@ static void D_Display(void)
|
||||||
switch (gamestate)
|
switch (gamestate)
|
||||||
{
|
{
|
||||||
case GS_TITLESCREEN:
|
case GS_TITLESCREEN:
|
||||||
if (!titlemapinaction) {
|
if (!titlemapinaction || !curbghide) {
|
||||||
F_TitleScreenDrawer();
|
F_TitleScreenDrawer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -376,7 +376,7 @@ static void D_Display(void)
|
||||||
|
|
||||||
// clean up border stuff
|
// clean up border stuff
|
||||||
// see if the border needs to be initially drawn
|
// see if the border needs to be initially drawn
|
||||||
if (gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction))
|
if (gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction && curbghide))
|
||||||
{
|
{
|
||||||
// draw the view directly
|
// draw the view directly
|
||||||
|
|
||||||
|
@ -1122,6 +1122,10 @@ void D_SRB2Main(void)
|
||||||
// initiate menu metadata before SOCcing them
|
// initiate menu metadata before SOCcing them
|
||||||
MN_InitInfoTables();
|
MN_InitInfoTables();
|
||||||
|
|
||||||
|
// init title screen display params
|
||||||
|
if (M_CheckParm("-connect"))
|
||||||
|
MN_Start();
|
||||||
|
|
||||||
//---------------------------------------------------- READY TIME
|
//---------------------------------------------------- READY TIME
|
||||||
// we need to check for dedicated before initialization of some subsystems
|
// we need to check for dedicated before initialization of some subsystems
|
||||||
|
|
||||||
|
|
|
@ -1961,10 +1961,12 @@ static void readmenu(MYFILE *f, INT32 num)
|
||||||
}
|
}
|
||||||
else if (fastcmp(word, "HIDEBACKGROUND"))
|
else if (fastcmp(word, "HIDEBACKGROUND"))
|
||||||
{
|
{
|
||||||
// HACK: Use CHAR_MAX to signal that we want to hide the background
|
menumeta[num].bghide = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y');
|
||||||
// Only effective during titlemap
|
titlechanged = true;
|
||||||
menumeta[num].bgname[0] = CHAR_MAX;
|
}
|
||||||
menumeta[num].bgname[1] = 0;
|
else if (fastcmp(word, "BACKGROUNDCOLOR"))
|
||||||
|
{
|
||||||
|
menumeta[num].bgcolor = value;
|
||||||
titlechanged = true;
|
titlechanged = true;
|
||||||
}
|
}
|
||||||
else if (fastcmp(word, "HIDETITLEPICS") || fastcmp(word, "HIDEPICS"))
|
else if (fastcmp(word, "HIDETITLEPICS") || fastcmp(word, "HIDEPICS"))
|
||||||
|
|
|
@ -1463,14 +1463,17 @@ void F_TitleScreenDrawer(void)
|
||||||
return; // We likely came here from retrying. Don't do a damn thing.
|
return; // We likely came here from retrying. Don't do a damn thing.
|
||||||
|
|
||||||
// Draw that sky!
|
// Draw that sky!
|
||||||
M_DrawScrollingBackground("TITLESKY");
|
if (curbgcolor >= 0)
|
||||||
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
|
||||||
|
else if (!curbghide || !titlemapinaction)
|
||||||
|
M_SkyScroll(curbgxspeed, curbgyspeed, curbgname);
|
||||||
|
|
||||||
// Don't draw outside of the title screewn, or if the patch isn't there.
|
// Don't draw outside of the title screewn, or if the patch isn't there.
|
||||||
if (!ttwing || (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS))
|
if (!ttwing || (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// rei|miru: use title pics?
|
// rei|miru: use title pics?
|
||||||
hidepics = M_GetHideTitlePics();
|
hidepics = curhidepics;
|
||||||
if (hidepics)
|
if (hidepics)
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
goto luahook;
|
goto luahook;
|
||||||
|
|
187
src/m_menu.c
187
src/m_menu.c
|
@ -2200,6 +2200,15 @@ static INT32 menuanimtimer;
|
||||||
static UINT32 prevMenuId = 0;
|
static UINT32 prevMenuId = 0;
|
||||||
static UINT32 activeMenuId = 0;
|
static UINT32 activeMenuId = 0;
|
||||||
|
|
||||||
|
// menu presentation state
|
||||||
|
char curbgname[8];
|
||||||
|
SINT8 curfadevalue;
|
||||||
|
boolean curhidepics;
|
||||||
|
INT32 curbgcolor;
|
||||||
|
INT32 curbgxspeed;
|
||||||
|
INT32 curbgyspeed;
|
||||||
|
boolean curbghide;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char musname[7];
|
char musname[7];
|
||||||
|
@ -2215,23 +2224,24 @@ void MN_InitInfoTables(void)
|
||||||
// Set menumeta defaults
|
// Set menumeta defaults
|
||||||
for (i = 0; i < NUMMENUTYPES; i++)
|
for (i = 0; i < NUMMENUTYPES; i++)
|
||||||
{
|
{
|
||||||
|
// so-called "undefined"
|
||||||
|
menumeta[i].fadestrength = -1;
|
||||||
|
menumeta[i].hidetitlepics = -1; // inherits global hidetitlepics
|
||||||
|
menumeta[i].enterwipe = -1;
|
||||||
|
menumeta[i].exitwipe = -1;
|
||||||
|
menumeta[i].bgcolor = -1;
|
||||||
|
// default true
|
||||||
|
menumeta[i].enterbubble = true;
|
||||||
|
menumeta[i].exitbubble = true;
|
||||||
|
|
||||||
if (i != MN_MAIN)
|
if (i != MN_MAIN)
|
||||||
{
|
{
|
||||||
menumeta[i].muslooping = true;
|
menumeta[i].muslooping = true;
|
||||||
}
|
}
|
||||||
if (i == MN_SP_TIMEATTACK || i == MN_SP_NIGHTSATTACK)
|
if (i == MN_SP_TIMEATTACK || i == MN_SP_NIGHTSATTACK)
|
||||||
strncpy(menumeta[i].musname, "_inter", 7);
|
strncpy(menumeta[i].musname, "_inter", 7);
|
||||||
if (i == MN_SP_PLAYER)
|
else if (i == MN_SP_PLAYER)
|
||||||
strncpy(menumeta[i].musname, "_chsel", 7);
|
strncpy(menumeta[i].musname, "_chsel", 7);
|
||||||
|
|
||||||
// so-called "undefined"
|
|
||||||
menumeta[i].fadestrength = -1;
|
|
||||||
menumeta[i].hidetitlepics = -1; // inherits global hidetitlepics
|
|
||||||
menumeta[i].enterwipe = -1;
|
|
||||||
menumeta[i].exitwipe = -1;
|
|
||||||
// default true
|
|
||||||
menumeta[i].enterbubble = true;
|
|
||||||
menumeta[i].exitbubble = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2334,26 +2344,42 @@ static boolean MIT_HasMenuType(UINT32 menutype, INT32 level, INT32 *retval, void
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static boolean MIT_DrawScrollingBackground(UINT32 menutype, INT32 level, INT32 *retval, void **input, boolean fromoldest)
|
static boolean MIT_SetCurBackground(UINT32 menutype, INT32 level, INT32 *retval, void **input, boolean fromoldest)
|
||||||
{
|
{
|
||||||
char *defaultname = (char*)*input;
|
char *defaultname = (char*)*input;
|
||||||
|
|
||||||
(void)retval;
|
(void)retval;
|
||||||
(void)fromoldest;
|
(void)fromoldest;
|
||||||
|
|
||||||
if (menumeta[menutype].bgname[0] && menumeta[menutype].bgname[0] != CHAR_MAX)
|
if (menumeta[menutype].bgcolor >= 0)
|
||||||
{
|
{
|
||||||
M_SkyScroll(menumeta[menutype].titlescrollxspeed, menumeta[menutype].titlescrollyspeed, menumeta[menutype].bgname);
|
curbgcolor = menumeta[menutype].bgcolor;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (menumeta[menutype].bgname[0] == CHAR_MAX && titlemapinaction) // hide the background
|
else if (menumeta[menutype].bgname[0] && (!menumeta[menutype].bghide || !titlemapinaction))
|
||||||
|
{
|
||||||
|
strncpy(curbgname, menumeta[menutype].bgname, 8);
|
||||||
|
curbgxspeed = menumeta[menutype].titlescrollxspeed;
|
||||||
|
curbgyspeed = menumeta[menutype].titlescrollyspeed;
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
else if (menumeta[menutype].bghide && titlemapinaction) // hide the background
|
||||||
|
{
|
||||||
|
curbghide = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else if (!level)
|
else if (!level)
|
||||||
{
|
{
|
||||||
if (defaultname && defaultname[0] && !titlemapinaction) // hide the background by default in titlemap
|
if (M_GetYoungestChildMenu() == MN_SP_PLAYER || !defaultname || !defaultname[0])
|
||||||
M_SkyScroll(titlescrollxspeed, titlescrollyspeed, defaultname);
|
curbgcolor = 31;
|
||||||
else if (currentMenu == &SP_PlayerDef) // black bg
|
else if (titlemapinaction) // hide the background by default in titlemap
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
curbghide = true;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strncpy(curbgname, defaultname, 8);
|
||||||
|
curbgxspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollxspeed;
|
||||||
|
curbgyspeed = (gamestate == GS_TIMEATTACK) ? 0 : titlescrollyspeed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2382,7 +2408,7 @@ static boolean MIT_ChangeMusic(UINT32 menutype, INT32 level, INT32 *retval, void
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean MIT_FadeScreen(UINT32 menutype, INT32 level, INT32 *retval, void **input, boolean fromoldest)
|
static boolean MIT_SetCurFadeValue(UINT32 menutype, INT32 level, INT32 *retval, void **input, boolean fromoldest)
|
||||||
{
|
{
|
||||||
UINT8 defaultvalue = *(UINT8*)*input;
|
UINT8 defaultvalue = *(UINT8*)*input;
|
||||||
|
|
||||||
|
@ -2391,27 +2417,27 @@ static boolean MIT_FadeScreen(UINT32 menutype, INT32 level, INT32 *retval, void
|
||||||
|
|
||||||
if (menumeta[menutype].fadestrength >= 0)
|
if (menumeta[menutype].fadestrength >= 0)
|
||||||
{
|
{
|
||||||
if (menumeta[menutype].fadestrength % 32)
|
curfadevalue = (menumeta[menutype].fadestrength % 32);
|
||||||
V_DrawFadeScreen(0xFF00, menumeta[menutype].fadestrength % 32);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (!level && (defaultvalue % 32))
|
else if (!level)
|
||||||
V_DrawFadeScreen(0xFF00, defaultvalue % 32);
|
curfadevalue = (gamestate == GS_TIMEATTACK) ? 0 : (defaultvalue % 32);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean MIT_GetHideTitlePics(UINT32 menutype, INT32 level, INT32 *retval, void **input, boolean fromoldest)
|
static boolean MIT_SetCurHideTitlePics(UINT32 menutype, INT32 level, INT32 *retval, void **input, boolean fromoldest)
|
||||||
{
|
{
|
||||||
(void)input;
|
(void)input;
|
||||||
|
(void)retval;
|
||||||
(void)fromoldest;
|
(void)fromoldest;
|
||||||
|
|
||||||
if (menumeta[menutype].hidetitlepics >= 0)
|
if (menumeta[menutype].hidetitlepics >= 0)
|
||||||
{
|
{
|
||||||
*retval = menumeta[menutype].hidetitlepics;
|
curhidepics = menumeta[menutype].hidetitlepics;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (!level)
|
else if (!level)
|
||||||
*retval = -1;
|
curhidepics = hidetitlepics;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2434,7 +2460,7 @@ static menutype_t M_GetMenuAtLevel(INT32 level, boolean fromoldest)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static UINT8 M_GetYoungestChildMenu() // aka the active menu
|
UINT8 M_GetYoungestChildMenu(void) // aka the active menu
|
||||||
{
|
{
|
||||||
INT32 targetlevel = -1;
|
INT32 targetlevel = -1;
|
||||||
return M_IterateMenuTree(MIT_GetMenuAtLevel, &targetlevel);
|
return M_IterateMenuTree(MIT_GetMenuAtLevel, &targetlevel);
|
||||||
|
@ -2462,13 +2488,6 @@ static boolean M_HasMenuType(menutype_t needletype)
|
||||||
// EFFECTS
|
// EFFECTS
|
||||||
// ====================================
|
// ====================================
|
||||||
|
|
||||||
void M_DrawScrollingBackground(const char *defaultname)
|
|
||||||
{
|
|
||||||
char name[8];
|
|
||||||
strncpy(name, defaultname, 8);
|
|
||||||
M_IterateMenuTree(MIT_DrawScrollingBackground, &name);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void M_ChangeMusic(const char *defaultmusname, boolean defaultmuslooping)
|
static void M_ChangeMusic(const char *defaultmusname, boolean defaultmuslooping)
|
||||||
{
|
{
|
||||||
menumetamusic_t defaultmusic;
|
menumetamusic_t defaultmusic;
|
||||||
|
@ -2484,15 +2503,21 @@ static void M_ChangeMusic(const char *defaultmusname, boolean defaultmuslooping)
|
||||||
M_IterateMenuTree(MIT_ChangeMusic, &defaultmusic);
|
M_IterateMenuTree(MIT_ChangeMusic, &defaultmusic);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void M_DrawFadeScreen(UINT8 defaultvalue)
|
static void M_SetCurBackground(const char *defaultname)
|
||||||
{
|
{
|
||||||
M_IterateMenuTree(MIT_FadeScreen, &defaultvalue);
|
char name[8];
|
||||||
|
strncpy(name, defaultname, 8);
|
||||||
|
M_IterateMenuTree(MIT_SetCurBackground, &name);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean M_GetHideTitlePics(void)
|
static void M_SetCurFadeValue(UINT8 defaultvalue)
|
||||||
{
|
{
|
||||||
INT32 retval = M_IterateMenuTree(MIT_GetHideTitlePics, NULL);
|
M_IterateMenuTree(MIT_SetCurFadeValue, &defaultvalue);
|
||||||
return (retval >= 0 ? retval : hidetitlepics);
|
}
|
||||||
|
|
||||||
|
static void M_SetCurHideTitlePics(void)
|
||||||
|
{
|
||||||
|
M_IterateMenuTree(MIT_SetCurHideTitlePics, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ====================================
|
// ====================================
|
||||||
|
@ -2533,10 +2558,24 @@ static void M_HandleMenuMetaState(menu_t *newMenu)
|
||||||
prevMenuId = currentMenu ? currentMenu->menuid : 0;
|
prevMenuId = currentMenu ? currentMenu->menuid : 0;
|
||||||
activeMenuId = newMenu ? newMenu->menuid : 0;
|
activeMenuId = newMenu ? newMenu->menuid : 0;
|
||||||
|
|
||||||
|
// Set defaults for presentation values
|
||||||
|
strncpy(curbgname, "TITLESKY", 8);
|
||||||
|
curfadevalue = 16;
|
||||||
|
curhidepics = hidetitlepics;
|
||||||
|
curbgcolor = -1;
|
||||||
|
curbgxspeed = titlescrollxspeed;
|
||||||
|
curbgyspeed = titlescrollyspeed;
|
||||||
|
curbghide = false;
|
||||||
|
|
||||||
// don't do the below during the in-game menus
|
// don't do the below during the in-game menus
|
||||||
if (gamestate != GS_TITLESCREEN && gamestate != GS_TIMEATTACK)
|
if (gamestate != GS_TITLESCREEN && gamestate != GS_TIMEATTACK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Find current presentation values
|
||||||
|
M_SetCurBackground((gamestate == GS_TIMEATTACK) ? "SRB2BACK" : "TITLESKY");
|
||||||
|
M_SetCurFadeValue(16);
|
||||||
|
M_SetCurHideTitlePics();
|
||||||
|
|
||||||
// Loop through both menu IDs in parallel and look for type changes
|
// Loop through both menu IDs in parallel and look for type changes
|
||||||
// The youngest child in activeMenuId is the entered menu
|
// The youngest child in activeMenuId is the entered menu
|
||||||
// The youngest child in prevMenuId is the exited menu
|
// The youngest child in prevMenuId is the exited menu
|
||||||
|
@ -2581,7 +2620,8 @@ static void M_HandleMenuMetaState(menu_t *newMenu)
|
||||||
}
|
}
|
||||||
|
|
||||||
// if no common ancestor (top menu), force a wipe. Look for a specified wipe first.
|
// if no common ancestor (top menu), force a wipe. Look for a specified wipe first.
|
||||||
if (anceslevel < 0 && exitwipe < 0)
|
// Don't force a wipe if you're actually going to/from the main menu
|
||||||
|
if (anceslevel < 0 && exitwipe < 0 && newMenu != &MainDef && currentMenu != &MainDef)
|
||||||
{
|
{
|
||||||
for (i = NUMMENULEVELS; i >= 0; i--)
|
for (i = NUMMENULEVELS; i >= 0; i--)
|
||||||
{
|
{
|
||||||
|
@ -2600,7 +2640,7 @@ static void M_HandleMenuMetaState(menu_t *newMenu)
|
||||||
}
|
}
|
||||||
|
|
||||||
// do the same for enter wipe
|
// do the same for enter wipe
|
||||||
if (anceslevel < 0 && enterwipe < 0)
|
if (anceslevel < 0 && enterwipe < 0 && newMenu != &MainDef && currentMenu != &MainDef)
|
||||||
{
|
{
|
||||||
for (i = NUMMENULEVELS; i >= 0; i--)
|
for (i = NUMMENULEVELS; i >= 0; i--)
|
||||||
{
|
{
|
||||||
|
@ -2664,7 +2704,7 @@ static void M_HandleMenuMetaState(menu_t *newMenu)
|
||||||
if (
|
if (
|
||||||
(exitwipe >= 0 && enterlevel <= exitlevel) ||
|
(exitwipe >= 0 && enterlevel <= exitlevel) ||
|
||||||
(enterwipe >= 0 && enterlevel >= exitlevel) ||
|
(enterwipe >= 0 && enterlevel >= exitlevel) ||
|
||||||
anceslevel < 0
|
(anceslevel < 0 && newMenu != &MainDef && currentMenu != &MainDef)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (gamestate == GS_TIMEATTACK)
|
if (gamestate == GS_TIMEATTACK)
|
||||||
|
@ -2733,7 +2773,7 @@ static void M_GoBack(INT32 choice)
|
||||||
Z_Free(levelselect.rows);
|
Z_Free(levelselect.rows);
|
||||||
levelselect.rows = NULL;
|
levelselect.rows = NULL;
|
||||||
menuactive = false;
|
menuactive = false;
|
||||||
wipetypepre = menumeta[M_GetYoungestChildMenu(currentMenu->menuid)].exitwipe;
|
wipetypepre = menumeta[M_GetYoungestChildMenu()].exitwipe;
|
||||||
D_StartTitle();
|
D_StartTitle();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3196,8 +3236,8 @@ void M_Drawer(void)
|
||||||
if (menuactive)
|
if (menuactive)
|
||||||
{
|
{
|
||||||
// now that's more readable with a faded background (yeah like Quake...)
|
// now that's more readable with a faded background (yeah like Quake...)
|
||||||
if (!WipeInAction)
|
if (!WipeInAction && (curfadevalue || (gamestate != GS_TITLESCREEN && gamestate != GS_TIMEATTACK)))
|
||||||
M_DrawFadeScreen(16);
|
V_DrawFadeScreen(0xFF00, (gamestate != GS_TITLESCREEN && gamestate != GS_TIMEATTACK) ? 16 : curfadevalue);
|
||||||
|
|
||||||
if (currentMenu->drawroutine)
|
if (currentMenu->drawroutine)
|
||||||
currentMenu->drawroutine(); // call current menu Draw routine
|
currentMenu->drawroutine(); // call current menu Draw routine
|
||||||
|
@ -3510,6 +3550,20 @@ void MN_Start(void)
|
||||||
menuanimtimer = 0;
|
menuanimtimer = 0;
|
||||||
prevMenuId = 0;
|
prevMenuId = 0;
|
||||||
activeMenuId = MainDef.menuid;
|
activeMenuId = MainDef.menuid;
|
||||||
|
|
||||||
|
// Set defaults for presentation values
|
||||||
|
strncpy(curbgname, "TITLESKY", 8);
|
||||||
|
curfadevalue = 16;
|
||||||
|
curhidepics = hidetitlepics;
|
||||||
|
curbgcolor = -1;
|
||||||
|
curbgxspeed = titlescrollxspeed;
|
||||||
|
curbgyspeed = titlescrollyspeed;
|
||||||
|
curbghide = false;
|
||||||
|
|
||||||
|
// Find current presentation values
|
||||||
|
M_SetCurBackground((gamestate == GS_TIMEATTACK) ? "SRB2BACK" : "TITLESKY");
|
||||||
|
M_SetCurFadeValue(16);
|
||||||
|
M_SetCurHideTitlePics();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MN_Ticker(boolean run)
|
void MN_Ticker(boolean run)
|
||||||
|
@ -5121,8 +5175,12 @@ static void M_DrawLevelPlatterMenu(void)
|
||||||
|
|
||||||
if (gamestate == GS_TIMEATTACK)
|
if (gamestate == GS_TIMEATTACK)
|
||||||
{
|
{
|
||||||
M_DrawScrollingBackground("SRB2BACK");
|
if (curbgcolor >= 0)
|
||||||
M_DrawFadeScreen(0);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
|
||||||
|
else if (!curbghide || !titlemapinaction)
|
||||||
|
M_SkyScroll(curbgxspeed, curbgyspeed, curbgname);
|
||||||
|
if (curfadevalue)
|
||||||
|
V_DrawFadeScreen(0xFF00, curfadevalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// finds row at top of the screen
|
// finds row at top of the screen
|
||||||
|
@ -5326,8 +5384,12 @@ static void M_DrawMessageMenu(void)
|
||||||
// hack: draw RA background in RA menus
|
// hack: draw RA background in RA menus
|
||||||
if (gamestate == GS_TIMEATTACK)
|
if (gamestate == GS_TIMEATTACK)
|
||||||
{
|
{
|
||||||
M_DrawScrollingBackground("SRB2BACK");
|
if (curbgcolor >= 0)
|
||||||
M_DrawFadeScreen(0);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
|
||||||
|
else if (!curbghide || !titlemapinaction)
|
||||||
|
M_SkyScroll(curbgxspeed, curbgyspeed, curbgname);
|
||||||
|
if (curfadevalue)
|
||||||
|
V_DrawFadeScreen(0xFF00, curfadevalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
M_DrawTextBox(currentMenu->x, y - 8, (max+7)>>3, mlines);
|
M_DrawTextBox(currentMenu->x, y - 8, (max+7)>>3, mlines);
|
||||||
|
@ -7717,9 +7779,12 @@ static void M_DrawSetupChoosePlayerMenu(void)
|
||||||
UINT8 prev, next;
|
UINT8 prev, next;
|
||||||
|
|
||||||
// Black BG
|
// Black BG
|
||||||
//V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
if (curbgcolor >= 0)
|
||||||
M_DrawScrollingBackground("SRB2BACK");
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
|
||||||
M_DrawFadeScreen(0);
|
else if (!curbghide || !titlemapinaction)
|
||||||
|
M_SkyScroll(curbgxspeed, curbgyspeed, curbgname);
|
||||||
|
if (curfadevalue)
|
||||||
|
V_DrawFadeScreen(0xFF00, curfadevalue);
|
||||||
|
|
||||||
// Character select profile images!1
|
// Character select profile images!1
|
||||||
M_DrawTextBox(0, my, 16, 20);
|
M_DrawTextBox(0, my, 16, 20);
|
||||||
|
@ -8109,9 +8174,12 @@ void M_DrawTimeAttackMenu(void)
|
||||||
|
|
||||||
M_ChangeMusic("_inter", true); // Eww, but needed for when user hits escape during demo playback
|
M_ChangeMusic("_inter", true); // Eww, but needed for when user hits escape during demo playback
|
||||||
|
|
||||||
M_DrawScrollingBackground("SRB2BACK");
|
if (curbgcolor >= 0)
|
||||||
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
|
||||||
M_DrawFadeScreen(0);
|
else if (!curbghide || !titlemapinaction)
|
||||||
|
M_SkyScroll(curbgxspeed, curbgyspeed, curbgname);
|
||||||
|
if (curfadevalue)
|
||||||
|
V_DrawFadeScreen(0xFF00, curfadevalue);
|
||||||
|
|
||||||
M_DrawMenuTitle();
|
M_DrawMenuTitle();
|
||||||
|
|
||||||
|
@ -8298,9 +8366,12 @@ void M_DrawNightsAttackMenu(void)
|
||||||
|
|
||||||
M_ChangeMusic("_inter", true); // Eww, but needed for when user hits escape during demo playback
|
M_ChangeMusic("_inter", true); // Eww, but needed for when user hits escape during demo playback
|
||||||
|
|
||||||
M_DrawScrollingBackground("SRB2BACK");
|
if (curbgcolor >= 0)
|
||||||
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, curbgcolor);
|
||||||
M_DrawFadeScreen(0);
|
else if (!curbghide || !titlemapinaction)
|
||||||
|
M_SkyScroll(curbgxspeed, curbgyspeed, curbgname);
|
||||||
|
if (curfadevalue)
|
||||||
|
V_DrawFadeScreen(0xFF00, curfadevalue);
|
||||||
|
|
||||||
M_DrawMenuTitle();
|
M_DrawMenuTitle();
|
||||||
|
|
||||||
|
|
15
src/m_menu.h
15
src/m_menu.h
|
@ -128,6 +128,8 @@ typedef struct
|
||||||
SINT8 hidetitlepics; // hide title gfx per menu; -1 means undefined, inherits global setting
|
SINT8 hidetitlepics; // hide title gfx per menu; -1 means undefined, inherits global setting
|
||||||
INT32 titlescrollxspeed; // background gfx scroll per menu; inherits global setting
|
INT32 titlescrollxspeed; // background gfx scroll per menu; inherits global setting
|
||||||
INT32 titlescrollyspeed; // y scroll
|
INT32 titlescrollyspeed; // y scroll
|
||||||
|
INT32 bgcolor; // fill color, overrides bg name. -1 means follow bg name rules.
|
||||||
|
boolean bghide; // for titlemaps, hide the background.
|
||||||
|
|
||||||
char musname[7]; ///< Music track to play. "" for no music.
|
char musname[7]; ///< Music track to play. "" for no music.
|
||||||
UINT16 mustrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore.
|
UINT16 mustrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore.
|
||||||
|
@ -145,15 +147,22 @@ typedef struct
|
||||||
} menumeta_t;
|
} menumeta_t;
|
||||||
|
|
||||||
extern menumeta_t menumeta[NUMMENUTYPES];
|
extern menumeta_t menumeta[NUMMENUTYPES];
|
||||||
|
extern char curbgname[8];
|
||||||
|
extern SINT8 curfadevalue;
|
||||||
|
extern boolean curhidepics;
|
||||||
|
extern INT32 curbgcolor;
|
||||||
|
extern INT32 curbgxspeed;
|
||||||
|
extern INT32 curbgyspeed;
|
||||||
|
extern boolean curbghide;
|
||||||
|
|
||||||
|
#define TITLEBACKGROUNDACTIVE (curfadevalue >= 0 || curbgname[0])
|
||||||
|
|
||||||
void M_DrawScrollingBackground(const char *defaultname);
|
|
||||||
void M_SkyScroll(INT32 scrollxspeed, INT32 scrollyspeed, const char *patchname);
|
void M_SkyScroll(INT32 scrollxspeed, INT32 scrollyspeed, const char *patchname);
|
||||||
boolean M_GetHideTitlePics(void);
|
|
||||||
void MN_Ticker(boolean run);
|
void MN_Ticker(boolean run);
|
||||||
void MN_Start(void);
|
void MN_Start(void);
|
||||||
void MN_InitInfoTables(void);
|
void MN_InitInfoTables(void);
|
||||||
void M_ApplyMenuMetaState(void);
|
void M_ApplyMenuMetaState(void);
|
||||||
|
UINT8 M_GetYoungestChildMenu(void);
|
||||||
|
|
||||||
// Called by main loop,
|
// Called by main loop,
|
||||||
// saves config file and calls I_Quit when user exits.
|
// saves config file and calls I_Quit when user exits.
|
||||||
|
|
Loading…
Reference in a new issue