Ensure that virutal screen is used when loading between levels

This commit is contained in:
Simon 2020-11-29 19:02:53 +00:00
parent 6355e3ba48
commit c325f3cdb3
3 changed files with 18 additions and 9 deletions

View file

@ -132,6 +132,7 @@ bool inMenu = false;
bool inGameGuiActive = false; bool inGameGuiActive = false;
bool objectiveSystemActive = false; bool objectiveSystemActive = false;
bool inCinematic = false; bool inCinematic = false;
bool loading = false;
void Doom3Quest_setUseScreenLayer(int screen) void Doom3Quest_setUseScreenLayer(int screen)
{ {
@ -139,12 +140,12 @@ void Doom3Quest_setUseScreenLayer(int screen)
inGameGuiActive = !!(screen & 0x2); inGameGuiActive = !!(screen & 0x2);
objectiveSystemActive = !!(screen & 0x4); objectiveSystemActive = !!(screen & 0x4);
inCinematic = !!(screen & 0x8); inCinematic = !!(screen & 0x8);
loading = !!(screen & 0x10);
} }
bool Doom3Quest_useScreenLayer() bool Doom3Quest_useScreenLayer()
{ {
//Cinematics are now first person return inMenu || forceVirtualScreen || inCinematic || loading;
return inMenu || forceVirtualScreen || inCinematic;
} }
static void UnEscapeQuotes( char *arg ) static void UnEscapeQuotes( char *arg )

View file

@ -2397,7 +2397,6 @@ void idCommonLocal::InitSIMD( void ) {
} }
extern "C" void Doom3Quest_setUseScreenLayer(int use);
extern "C" void Doom3Quest_FrameSetup(int controlscheme); extern "C" void Doom3Quest_FrameSetup(int controlscheme);
extern "C" void Doom3Quest_Vibrate(int channel, float low, float high ); extern "C" void Doom3Quest_Vibrate(int channel, float low, float high );
@ -2419,12 +2418,6 @@ void idCommonLocal::Frame( void ) {
// pump all the events // pump all the events
Sys_GenerateEvents(); Sys_GenerateEvents();
int inMenu = (((idSessionLocal*)session)->guiActive != 0);
int inGameGui = ( game && game->InGameGuiActive());
int objectiveActive = ( game && game->ObjectiveSystemActive());
int cinematic = ( game && game->InCinematic());
Doom3Quest_setUseScreenLayer(inMenu?1:0 + inGameGui?2:0 + objectiveActive?4:0 + cinematic?8:0);
Doom3Quest_FrameSetup(cvarSystem->GetCVarInteger("vr_controlscheme")); Doom3Quest_FrameSetup(cvarSystem->GetCVarInteger("vr_controlscheme"));
if (game) { if (game) {

View file

@ -2383,6 +2383,19 @@ void idSessionLocal::PacifierUpdate() {
idAsyncNetwork::server.PacifierUpdate(); idAsyncNetwork::server.PacifierUpdate();
} }
extern "C" void Doom3Quest_setUseScreenLayer(int use);
void setupScreenLayer()
{
int inMenu = (((idSessionLocal*)session)->guiActive != 0);
int inGameGui = ( game && game->InGameGuiActive());
int objectiveActive = ( game && game->ObjectiveSystemActive());
int cinematic = ( game && game->InCinematic());
bool loading = (((idSessionLocal*)session)->insideExecuteMapChange);
Doom3Quest_setUseScreenLayer(inMenu?1:0 + inGameGui?2:0 + objectiveActive?4:0 + cinematic?8:0 + loading?16:0);
}
/* /*
=============== ===============
idSessionLocal::Draw idSessionLocal::Draw
@ -2391,6 +2404,8 @@ idSessionLocal::Draw
void idSessionLocal::Draw() { void idSessionLocal::Draw() {
bool fullConsole = false; bool fullConsole = false;
setupScreenLayer();
if ( insideExecuteMapChange ) { if ( insideExecuteMapChange ) {
if ( guiLoading ) { if ( guiLoading ) {
guiLoading->Redraw( com_frameTime ); guiLoading->Redraw( com_frameTime );