mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-26 00:40:56 +00:00
- fixed recursion issue with menu and CON scripting.
Curse all those busy loops in the engine.
This commit is contained in:
parent
52cfb7fb92
commit
a96f1b25f7
3 changed files with 26 additions and 14 deletions
|
@ -10040,8 +10040,22 @@ void DrawFullscreenBlends();
|
||||||
//
|
//
|
||||||
void videoNextPage(void)
|
void videoNextPage(void)
|
||||||
{
|
{
|
||||||
|
static bool recursion;
|
||||||
permfifotype *per;
|
permfifotype *per;
|
||||||
|
|
||||||
|
if (!recursion)
|
||||||
|
{
|
||||||
|
// This protection is needed because the menu can call scripts and the scripts can call the busy-looping Screen_Play script event
|
||||||
|
// which calls videoNextPage for page flipping again. In this loop the UI drawers may not get called again.
|
||||||
|
// Ideally this stuff should be moved out of videoNextPage so that all those busy loops won't call UI overlays at all.
|
||||||
|
recursion = true;
|
||||||
|
M_Drawer();
|
||||||
|
FStat::PrintStat();
|
||||||
|
C_DrawConsole();
|
||||||
|
recursion = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (in3dmode())
|
if (in3dmode())
|
||||||
{
|
{
|
||||||
// software rendering only
|
// software rendering only
|
||||||
|
@ -10058,25 +10072,13 @@ void videoNextPage(void)
|
||||||
|
|
||||||
g_beforeSwapTime = timerGetHiTicks();
|
g_beforeSwapTime = timerGetHiTicks();
|
||||||
|
|
||||||
// Draw the ImGui menu on top of the game content, but below the console (if open.)
|
|
||||||
if (GUICapture & 6)
|
|
||||||
{
|
|
||||||
ImGui::Render();
|
|
||||||
GLInterface.DrawImGui(ImGui::GetDrawData());
|
|
||||||
GUICapture &= ~4;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Draw the console plus debug output on top of everything else.
|
// Draw the console plus debug output on top of everything else.
|
||||||
DrawFullscreenBlends();
|
DrawFullscreenBlends();
|
||||||
M_Drawer();
|
|
||||||
FStat::PrintStat();
|
|
||||||
C_DrawConsole();
|
|
||||||
GLInterface.Draw2D(&twod);
|
GLInterface.Draw2D(&twod);
|
||||||
|
|
||||||
|
|
||||||
videoShowFrame(0);
|
videoShowFrame(0);
|
||||||
|
|
||||||
// software rendering only
|
|
||||||
videoBeginDrawing(); //{{{
|
videoBeginDrawing(); //{{{
|
||||||
for (bssize_t i=permtail; i!=permhead; i=((i+1)&(MAXPERMS-1)))
|
for (bssize_t i=permtail; i!=permhead; i=((i+1)&(MAXPERMS-1)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,6 +40,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "menu/menu.h"
|
#include "menu/menu.h"
|
||||||
|
|
||||||
#include "debugbreak.h"
|
#include "debugbreak.h"
|
||||||
|
extern bool rotatesprite_2doverride;
|
||||||
|
|
||||||
BEGIN_DUKE_NS
|
BEGIN_DUKE_NS
|
||||||
|
|
||||||
|
@ -1219,12 +1220,16 @@ LUNATIC_EXTERN void G_ShowView(vec3_t vec, fix16_t a, fix16_t horiz, int sect, i
|
||||||
renderSetAspect(viewingRange, yxAspect);
|
renderSetAspect(viewingRange, yxAspect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Screen_Play(void)
|
void Screen_Play(void)
|
||||||
{
|
{
|
||||||
bool running = true;
|
bool running = true;
|
||||||
|
|
||||||
I_ClearAllInput();
|
I_ClearAllInput();
|
||||||
|
|
||||||
|
// This needs to be disabled during the loop.
|
||||||
|
auto r2dover = rotatesprite_2doverride;
|
||||||
|
rotatesprite_2doverride = false;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
gameHandleEvents();
|
gameHandleEvents();
|
||||||
|
@ -1242,6 +1247,7 @@ void Screen_Play(void)
|
||||||
videoNextPage();
|
videoNextPage();
|
||||||
I_ClearAllInput();
|
I_ClearAllInput();
|
||||||
} while (running);
|
} while (running);
|
||||||
|
rotatesprite_2doverride = r2dover;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined LUNATIC
|
#if !defined LUNATIC
|
||||||
|
|
|
@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "gamecvars.h"
|
#include "gamecvars.h"
|
||||||
|
|
||||||
#include "debugbreak.h"
|
#include "debugbreak.h"
|
||||||
|
extern bool rotatesprite_2doverride;
|
||||||
|
|
||||||
BEGIN_RR_NS
|
BEGIN_RR_NS
|
||||||
|
|
||||||
|
@ -1120,6 +1121,8 @@ void Screen_Play(void)
|
||||||
|
|
||||||
I_ClearAllInput();
|
I_ClearAllInput();
|
||||||
|
|
||||||
|
auto r2dover = rotatesprite_2doverride;
|
||||||
|
rotatesprite_2doverride = false;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
G_HandleAsync();
|
G_HandleAsync();
|
||||||
|
@ -1136,6 +1139,7 @@ void Screen_Play(void)
|
||||||
videoNextPage();
|
videoNextPage();
|
||||||
I_ClearAllInput();
|
I_ClearAllInput();
|
||||||
} while (running);
|
} while (running);
|
||||||
|
rotatesprite_2doverride = r2dover;
|
||||||
}
|
}
|
||||||
|
|
||||||
GAMEEXEC_STATIC void VM_Execute(native_t loop)
|
GAMEEXEC_STATIC void VM_Execute(native_t loop)
|
||||||
|
|
Loading…
Reference in a new issue