From cb387417c17bd3984284821301504c43b3310e7f Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 19 Mar 2022 12:33:37 +0000 Subject: [PATCH] Reverted Culling logic - Just turned r_nocull back on again - Add version info when playing demo --- android/app/src/main/AndroidManifest.xml | 4 ++-- android/app/src/main/cpp/code/cgame/cg_view.c | 11 +++++----- android/app/src/main/cpp/code/q3_ui/ui_menu.c | 13 ++++++----- .../main/cpp/code/renderergl2/tr_animation.c | 5 ----- .../src/main/cpp/code/renderergl2/tr_init.c | 2 +- .../src/main/cpp/code/renderergl2/tr_main.c | 22 ++++++------------- .../src/main/cpp/code/renderergl2/tr_marks.c | 10 ++------- .../src/main/cpp/code/renderergl2/tr_mesh.c | 22 ++++++------------- .../main/cpp/code/renderergl2/tr_model_iqm.c | 17 ++++++-------- .../src/main/cpp/code/renderergl2/tr_world.c | 4 ++-- 10 files changed, 40 insertions(+), 70 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 42a49201..a812938a 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -2,8 +2,8 @@ + android:versionCode="38" + android:versionName="0.26.1"> diff --git a/android/app/src/main/cpp/code/cgame/cg_view.c b/android/app/src/main/cpp/code/cgame/cg_view.c index 358d8014..c9d39c7a 100644 --- a/android/app/src/main/cpp/code/cgame/cg_view.c +++ b/android/app/src/main/cpp/code/cgame/cg_view.c @@ -515,9 +515,9 @@ Fixed fov at intermissions, otherwise account for fov variable and zooms. static int CG_CalcFov( void ) { int contents; int inwater; - float phase; +/* float phase; float v; -/* float x; + float x; float fov_x, fov_y; float zoomFov; float f; @@ -572,8 +572,8 @@ static int CG_CalcFov( void ) { // warp if underwater contents = CG_PointContents( cg.refdef.vieworg, -1 ); if ( contents & ( CONTENTS_WATER | CONTENTS_SLIME | CONTENTS_LAVA ) ){ - phase = cg.time / 1000.0 * WAVE_FREQUENCY * M_PI * 2; - v = WAVE_AMPLITUDE * sin( phase ); +// phase = cg.time / 1000.0 * WAVE_FREQUENCY * M_PI * 2; +// v = WAVE_AMPLITUDE * sin( phase ); // fov_x += v; // fov_y -= v; inwater = qtrue; @@ -592,8 +592,7 @@ static int CG_CalcFov( void ) { cg.zoomSensitivity = cg.refdef.fov_y / 75.0; } - //We don't do the under-water fov warping in VR - return qfalse; //inwater; + return inwater; } diff --git a/android/app/src/main/cpp/code/q3_ui/ui_menu.c b/android/app/src/main/cpp/code/q3_ui/ui_menu.c index df51f11d..5ebbc150 100644 --- a/android/app/src/main/cpp/code/q3_ui/ui_menu.c +++ b/android/app/src/main/cpp/code/q3_ui/ui_menu.c @@ -232,13 +232,14 @@ static void Main_MenuDraw( void ) { UI_DrawString( 320, yPos, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color ); } else { UI_DrawString( 320, yPos, "Quake III Arena(c) 1999-2000, Id Software, Inc. All Rights Reserved", UI_CENTER|UI_SMALLFONT, color ); - yPos += SMALLCHAR_HEIGHT; - UI_DrawString( 320, yPos, "Quake3Quest " Q3QVERSION " - Visit quake3.quakevr.com for discord invite.", UI_CENTER|UI_SMALLFONT, color ); - yPos += SMALLCHAR_HEIGHT; - UI_DrawString( 320, yPos, "Join our discord for news, leaderboards and community!", UI_CENTER|UI_SMALLFONT, color ); - yPos += SMALLCHAR_HEIGHT; - UI_DrawString( 320, yPos, "Get mods & mappacks via the companion app!", UI_CENTER|UI_SMALLFONT, color ); } + + yPos += SMALLCHAR_HEIGHT; + UI_DrawString( 320, yPos, "Quake3Quest " Q3QVERSION " - Visit quake3.quakevr.com for discord invite.", UI_CENTER|UI_SMALLFONT, color ); + yPos += SMALLCHAR_HEIGHT; + UI_DrawString( 320, yPos, "Join our discord for news, leaderboards and community!", UI_CENTER|UI_SMALLFONT, color ); + yPos += SMALLCHAR_HEIGHT; + UI_DrawString( 320, yPos, "Get mods & mappacks via the companion app!", UI_CENTER|UI_SMALLFONT, color ); } diff --git a/android/app/src/main/cpp/code/renderergl2/tr_animation.c b/android/app/src/main/cpp/code/renderergl2/tr_animation.c index 4ec34fe3..38fffc64 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_animation.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_animation.c @@ -47,11 +47,6 @@ static int R_MDRCullModel( mdrHeader_t *header, trRefEntity_t *ent ) { mdrFrame_t *oldFrame, *newFrame; int i, frameSize; - if (vr_thirdPersonSpectator->integer) - { - return CULL_IN; - } - frameSize = (size_t)( &((mdrFrame_t *)0)->bones[ header->numBones ] ); // compute frame pointers diff --git a/android/app/src/main/cpp/code/renderergl2/tr_init.c b/android/app/src/main/cpp/code/renderergl2/tr_init.c index 0642ceff..f87a8516 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_init.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_init.c @@ -1359,7 +1359,7 @@ void R_Register( void ) r_norefresh = ri.Cvar_Get ("r_norefresh", "0", CVAR_CHEAT); r_drawentities = ri.Cvar_Get ("r_drawentities", "1", CVAR_CHEAT ); r_ignore = ri.Cvar_Get( "r_ignore", "1", CVAR_CHEAT ); - r_nocull = ri.Cvar_Get ("r_nocull", "0", CVAR_CHEAT); + r_nocull = ri.Cvar_Get ("r_nocull", "1", CVAR_CHEAT); r_novis = ri.Cvar_Get ("r_novis", "0", CVAR_CHEAT); r_showcluster = ri.Cvar_Get ("r_showcluster", "0", CVAR_CHEAT); r_speeds = ri.Cvar_Get ("r_speeds", "0", CVAR_CHEAT); diff --git a/android/app/src/main/cpp/code/renderergl2/tr_main.c b/android/app/src/main/cpp/code/renderergl2/tr_main.c index 880e13b8..a7db63b6 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_main.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_main.c @@ -207,7 +207,7 @@ int R_CullLocalBox(vec3_t localBounds[2]) { int anyBack; int front, back; - if ( r_nocull->integer || vr_thirdPersonSpectator->integer ) { + if ( r_nocull->integer ) { return CULL_CLIP; } @@ -258,7 +258,7 @@ int R_CullLocalBox(vec3_t localBounds[2]) { vec3_t v; vec3_t worldBounds[2]; - if(r_nocull->integer || vr_thirdPersonSpectator->integer) + if(r_nocull->integer ) { return CULL_CLIP; } @@ -294,11 +294,6 @@ int R_CullBox(vec3_t worldBounds[2]) { qboolean anyClip; int r, numPlanes; - if (vr_thirdPersonSpectator->integer) - { - return CULL_IN; - } - numPlanes = (tr.viewParms.flags & VPF_FARPLANEFRUSTUM) ? 5 : 4; // check against frustum planes @@ -352,7 +347,7 @@ int R_CullPointAndRadiusEx( const vec3_t pt, float radius, const cplane_t* frust const cplane_t *frust; qboolean mightBeClipped = qfalse; - if ( r_nocull->integer || vr_thirdPersonSpectator->integer) { + if ( r_nocull->integer ) { return CULL_CLIP; } @@ -1910,13 +1905,10 @@ void R_RenderPshadowMaps(const refdef_t *fd) if (!radius) continue; - if (!vr_thirdPersonSpectator->integer) - { - // Cull entities that are behind the viewer by more than lightRadius - VectorSubtract(ent->e.origin, fd->vieworg, diff); - if (DotProduct(diff, fd->viewaxis[0]) < -r_pshadowDist->value) - continue; - } + // Cull entities that are behind the viewer by more than lightRadius + VectorSubtract(ent->e.origin, fd->vieworg, diff); + if (DotProduct(diff, fd->viewaxis[0]) < -r_pshadowDist->value) + continue; memset(&shadow, 0, sizeof(shadow)); diff --git a/android/app/src/main/cpp/code/renderergl2/tr_marks.c b/android/app/src/main/cpp/code/renderergl2/tr_marks.c index c5b7937d..3ec47da4 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_marks.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_marks.c @@ -139,10 +139,7 @@ void R_BoxSurfaces_r(mnode_t *node, vec3_t mins, vec3_t maxs, surfaceType_t **li // do the tail recursion in a loop while ( node->contents == -1 ) { - if (!vr_thirdPersonSpectator->integer) - s = BoxOnPlaneSide( mins, maxs, node->plane ); - else - s = 0; + s = BoxOnPlaneSide( mins, maxs, node->plane ); if (s == 1) { node = node->children[0]; @@ -172,10 +169,7 @@ void R_BoxSurfaces_r(mnode_t *node, vec3_t mins, vec3_t maxs, surfaceType_t **li // extra check for surfaces to avoid list overflows else if (*(surf->data) == SF_FACE) { // the face plane should go through the box - if (!vr_thirdPersonSpectator->integer) - s = BoxOnPlaneSide( mins, maxs, &surf->cullinfo.plane ); - else - s = 0; + s = BoxOnPlaneSide( mins, maxs, &surf->cullinfo.plane ); if (s == 1 || s == 2) { *surfViewCount = tr.viewCount; diff --git a/android/app/src/main/cpp/code/renderergl2/tr_mesh.c b/android/app/src/main/cpp/code/renderergl2/tr_mesh.c index 4ab6556b..160be73d 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_mesh.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_mesh.c @@ -80,11 +80,6 @@ static int R_CullModel( mdvModel_t *model, trRefEntity_t *ent ) { mdvFrame_t *oldFrame, *newFrame; int i; - if (vr_thirdPersonSpectator->integer) - { - return CULL_IN; - } - // compute frame pointers newFrame = model->frames + ent->e.frame; oldFrame = model->frames + ent->e.oldframe; @@ -329,17 +324,14 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) { model = tr.currentModel->mdv[lod]; - if (!vr_thirdPersonSpectator->integer) + // + // cull the entire model if merged bounding box of both frames + // is outside the view frustum. + // + cull = R_CullModel(model, ent); + if (cull == CULL_OUT) { - // - // cull the entire model if merged bounding box of both frames - // is outside the view frustum. - // - cull = R_CullModel(model, ent); - if (cull == CULL_OUT) - { - return; - } + return; } // diff --git a/android/app/src/main/cpp/code/renderergl2/tr_model_iqm.c b/android/app/src/main/cpp/code/renderergl2/tr_model_iqm.c index d0c5d1c3..165ac75c 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_model_iqm.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_model_iqm.c @@ -1263,17 +1263,14 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) { ent->e.oldframe = 0; } - if (!vr_thirdPersonSpectator->integer) + // + // cull the entire model if merged bounding box of both frames + // is outside the view frustum. + // + cull = R_CullIQM(data, ent); + if (cull == CULL_OUT) { - // - // cull the entire model if merged bounding box of both frames - // is outside the view frustum. - // - cull = R_CullIQM(data, ent); - if (cull == CULL_OUT) - { - return; - } + return; } // diff --git a/android/app/src/main/cpp/code/renderergl2/tr_world.c b/android/app/src/main/cpp/code/renderergl2/tr_world.c index 2de5583e..fcb08335 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_world.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_world.c @@ -32,7 +32,7 @@ added to the sorting list. ================ */ static qboolean R_CullSurface( msurface_t *surf ) { - if ( (r_nocull->integer || vr_thirdPersonSpectator->integer) || surf->cullinfo.type == CULLINFO_NONE) { + if ( r_nocull->integer || surf->cullinfo.type == CULLINFO_NONE) { return qfalse; } @@ -414,7 +414,7 @@ static void R_RecursiveWorldNode( mnode_t *node, uint32_t planeBits, uint32_t dl // if the bounding volume is outside the frustum, nothing // inside can be visible OPTIMIZE: don't do this all the way to leafs? - if ( !r_nocull->integer && !vr_thirdPersonSpectator->integer ) { + if ( !r_nocull->integer ) { int r; if ( planeBits & 1 ) {