From 21fc40dc4471942b3e90f84b0434925d929217bf Mon Sep 17 00:00:00 2001 From: Petr Bartos Date: Thu, 29 Sep 2022 17:41:20 +0200 Subject: [PATCH] Do not draw weapon model, crosshair and hud in menu screen --- android/app/src/main/cpp/code/cgame/cg_draw.c | 6 +++--- android/app/src/main/cpp/code/cgame/cg_weapons.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/app/src/main/cpp/code/cgame/cg_draw.c b/android/app/src/main/cpp/code/cgame/cg_draw.c index cab81c14..c63dba7f 100644 --- a/android/app/src/main/cpp/code/cgame/cg_draw.c +++ b/android/app/src/main/cpp/code/cgame/cg_draw.c @@ -2824,7 +2824,7 @@ void CG_DrawActive( void ) { // clear around the rendered view if sized down CG_TileClear(); - if(!vr->weapon_zoomed) + if(!vr->weapon_zoomed && !vr->virtual_screen) CG_DrawCrosshair3D(); // offset vieworg appropriately if we're doing stereo separation @@ -2892,7 +2892,7 @@ void CG_DrawActive( void ) { } //Now draw the HUD shader in the world - if (trap_Cvar_VariableValue("vr_hudDrawStatus") != 2.0f) + if (trap_Cvar_VariableValue("vr_hudDrawStatus") != 2.0f && !vr->weapon_zoomed && !vr->virtual_screen) { refEntity_t ent; trace_t trace; @@ -2955,7 +2955,7 @@ void CG_DrawActive( void ) { //Now draw the screen 2D stuff CG_DrawScreen2D(); - if (!vr->weapon_zoomed) + if (!vr->weapon_zoomed && !vr->virtual_screen) { cg.drawingHUD = qtrue; diff --git a/android/app/src/main/cpp/code/cgame/cg_weapons.c b/android/app/src/main/cpp/code/cgame/cg_weapons.c index 11070704..f91f2e6a 100644 --- a/android/app/src/main/cpp/code/cgame/cg_weapons.c +++ b/android/app/src/main/cpp/code/cgame/cg_weapons.c @@ -1728,8 +1728,8 @@ void CG_AddViewWeapon( playerState_t *ps ) { return; } - if (vr->weapon_zoomed) { - return; // do not draw weapon model with enabled weapon scope + if (vr->weapon_zoomed || vr->virtual_screen) { + return; // do not draw weapon model with enabled weapon scope or when in menu } cent = &cg.predictedPlayerEntity; // &cg_entities[cg.snap->ps.clientNum];