From c325f3cdb3d0a993a9106ac56621763fa1cb52d0 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 29 Nov 2020 19:02:53 +0000 Subject: [PATCH] Ensure that virutal screen is used when loading between levels --- .../jni/Doom3Quest/Doom3Quest_SurfaceView.c | 5 +++-- .../neo/framework/Common.cpp | 7 ------- .../neo/framework/Session.cpp | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Projects/Android/jni/Doom3Quest/Doom3Quest_SurfaceView.c b/Projects/Android/jni/Doom3Quest/Doom3Quest_SurfaceView.c index 050f3f6..3537a5f 100644 --- a/Projects/Android/jni/Doom3Quest/Doom3Quest_SurfaceView.c +++ b/Projects/Android/jni/Doom3Quest/Doom3Quest_SurfaceView.c @@ -132,6 +132,7 @@ bool inMenu = false; bool inGameGuiActive = false; bool objectiveSystemActive = false; bool inCinematic = false; +bool loading = false; void Doom3Quest_setUseScreenLayer(int screen) { @@ -139,12 +140,12 @@ void Doom3Quest_setUseScreenLayer(int screen) inGameGuiActive = !!(screen & 0x2); objectiveSystemActive = !!(screen & 0x4); inCinematic = !!(screen & 0x8); + loading = !!(screen & 0x10); } bool Doom3Quest_useScreenLayer() { - //Cinematics are now first person - return inMenu || forceVirtualScreen || inCinematic; + return inMenu || forceVirtualScreen || inCinematic || loading; } static void UnEscapeQuotes( char *arg ) diff --git a/Projects/Android/jni/d3es-multithread-master/neo/framework/Common.cpp b/Projects/Android/jni/d3es-multithread-master/neo/framework/Common.cpp index 2b700ec..a4654de 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/framework/Common.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/framework/Common.cpp @@ -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_Vibrate(int channel, float low, float high ); @@ -2419,12 +2418,6 @@ void idCommonLocal::Frame( void ) { // pump all the events 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")); if (game) { diff --git a/Projects/Android/jni/d3es-multithread-master/neo/framework/Session.cpp b/Projects/Android/jni/d3es-multithread-master/neo/framework/Session.cpp index 2e80477..7bf8c55 100644 --- a/Projects/Android/jni/d3es-multithread-master/neo/framework/Session.cpp +++ b/Projects/Android/jni/d3es-multithread-master/neo/framework/Session.cpp @@ -2383,6 +2383,19 @@ void idSessionLocal::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 @@ -2391,6 +2404,8 @@ idSessionLocal::Draw void idSessionLocal::Draw() { bool fullConsole = false; + setupScreenLayer(); + if ( insideExecuteMapChange ) { if ( guiLoading ) { guiLoading->Redraw( com_frameTime );