- fixed menu loop

This commit is contained in:
Christoph Oelckers 2020-07-04 22:30:18 +02:00
parent 2c494245ad
commit 2fba557a3d
2 changed files with 60 additions and 46 deletions

View file

@ -141,7 +141,7 @@ class DukeMainMenu : public DukeListMenu
double x = origin.X + 160; double x = origin.X + 160;
if (RRRA) if (RRRA)
{ {
DrawTexture(twod, tileGetTexture(TILE_THREEDEE), x-5, origin.Y+57, DTA_FullscreenScale, 3, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, DTA_ScaleX, 0.253, DTA_ScaleY, 0.253, DTA_CenterOffset, true, TAG_DONE); DrawTexture(twod, tileGetTexture(TILE_THREEDEE), x-5, origin.Y+57, DTA_FullscreenScale, 3, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, DTA_ScaleX, 0.253, DTA_ScaleY, 0.253, DTA_CenterBottomOffset, true, TAG_DONE);
} }
else if (isRR()) else if (isRR())
{ {

View file

@ -29,7 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_DUKE_NS BEGIN_DUKE_NS
//////////////////// ////////////////////
int32_t G_PlaybackDemo(void) int32_t G_PlaybackDemo(void)
@ -44,8 +43,9 @@ int32_t G_PlaybackDemo(void)
if (ready2send) if (ready2send)
return 0; return 0;
while (int in_menu = g_player[myconnectindex].ps->gm & MODE_MENU) RECHECK:
{ in_menu = g_player[myconnectindex].ps->gm&MODE_MENU;
if (foundemo == 0) if (foundemo == 0)
{ {
ud.recstat = 0; ud.recstat = 0;
@ -74,6 +74,8 @@ int32_t G_PlaybackDemo(void)
// so maybe a better name for this function would be // so maybe a better name for this function would be
// G_MainLoopWhenNotInGame()? // G_MainLoopWhenNotInGame()?
if (G_FPSLimit())
{
if (foundemo == 0) if (foundemo == 0)
{ {
drawbackground(); drawbackground();
@ -82,7 +84,7 @@ int32_t G_PlaybackDemo(void)
if ((g_player[myconnectindex].ps->gm&MODE_MENU) && (g_player[myconnectindex].ps->gm&MODE_EOL)) if ((g_player[myconnectindex].ps->gm&MODE_MENU) && (g_player[myconnectindex].ps->gm&MODE_EOL))
{ {
videoNextPage(); videoNextPage();
break; goto RECHECK;
} }
else if (g_player[myconnectindex].ps->gm&MODE_TYPE) else if (g_player[myconnectindex].ps->gm&MODE_TYPE)
@ -95,6 +97,9 @@ int32_t G_PlaybackDemo(void)
} }
else else
{ {
//if (ud.recstat != 2)
//M_DisplayMenus();
if ((g_netServer || ud.multimode > 1))// && !Menu_IsTextInput(m_currentMenu)) if ((g_netServer || ud.multimode > 1))// && !Menu_IsTextInput(m_currentMenu))
{ {
ControlInfo noshareinfo; ControlInfo noshareinfo;
@ -112,6 +117,8 @@ int32_t G_PlaybackDemo(void)
} }
videoNextPage(); videoNextPage();
}
G_HandleAsync(); G_HandleAsync();
if (g_player[myconnectindex].ps->gm == MODE_GAME) if (g_player[myconnectindex].ps->gm == MODE_GAME)
@ -122,7 +129,14 @@ int32_t G_PlaybackDemo(void)
} }
ud.multimode = numplayers; // fixes 2 infinite loops after watching demo ud.multimode = numplayers; // fixes 2 infinite loops after watching demo
}
// if we're in the menu, try next demo immediately
if (g_player[myconnectindex].ps->gm&MODE_MENU)
goto RECHECK;
// finished playing a demo and not in menu:
// return so that e.g. the title can be shown
return 1; return 1;
} }