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 09f101f4..f3267cd8 100644 --- a/android/app/src/main/cpp/code/cgame/cg_view.c +++ b/android/app/src/main/cpp/code/cgame/cg_view.c @@ -261,7 +261,7 @@ static void CG_OffsetVRThirdPersonView( void ) { vec3_t angles, forward, right, up; VectorCopy(vr->offhandangles, angles); float deltaYaw = SHORT2ANGLE(cg.predictedPlayerState.delta_angles[YAW]); - angles[YAW] += deltaYaw + (vr->clientviewangles[YAW] - vr->hmdorientation[YAW]); + angles[YAW] += (vr->clientviewangles[YAW] - vr->hmdorientation[YAW]); AngleVectors(angles, forward, right, up); VectorMA(cg.vr_vieworigin, vr->thumbstick_location[THUMB_LEFT][1] * 5.0f, forward, cg.vr_vieworigin); VectorMA(cg.vr_vieworigin, vr->thumbstick_location[THUMB_LEFT][0] * 5.0f, right, cg.vr_vieworigin); @@ -673,7 +673,7 @@ static int CG_CalcViewValues( ) { //HACK!! - should change this to a renderer function call //Indicate to renderer whether we are in deathcam mode, We don't want sky in death cam mode - trap_Cvar_Set( "vr_noSkybox", (((ps->stats[STAT_HEALTH] <= 0) && + trap_Cvar_Set( "vr_thirdPersonSpectator", (((ps->stats[STAT_HEALTH] <= 0) && ( ps->pm_type != PM_INTERMISSION )) || cg.demoPlayback || CG_IsThirdPersonFollowMode() ? "1" : "0" )); diff --git a/android/app/src/main/cpp/code/q3_ui/ui_credits.c b/android/app/src/main/cpp/code/q3_ui/ui_credits.c index 6ed47971..bd0ee14a 100644 --- a/android/app/src/main/cpp/code/q3_ui/ui_credits.c +++ b/android/app/src/main/cpp/code/q3_ui/ui_credits.c @@ -135,7 +135,7 @@ Special Thanks to the whole discord! y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE; UI_DrawProportionalString( 320, y, "Additional Quake3Quest coding", UI_CENTER|UI_SMALLFONT, color_red ); y += PROP_HEIGHT * PROP_SMALL_SIZE_SCALE; - UI_DrawString( 320, y, "Baggyg, MuadDiB, Lubos, Sparkie", UI_CENTER|UI_SMALLFONT, color_white ); + UI_DrawString( 320, y, "Sparkie, MuadDiB, Lubos, Baggyg", UI_CENTER|UI_SMALLFONT, color_white ); y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE; UI_DrawProportionalString( 320, y, "Additional Contributions", UI_CENTER|UI_SMALLFONT, color_red ); 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 38fffc64..4ec34fe3 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_animation.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_animation.c @@ -47,6 +47,11 @@ 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 3f9144c5..f87a8516 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_init.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_init.c @@ -74,7 +74,7 @@ cvar_t *r_measureOverdraw; cvar_t *r_inGameVideo; cvar_t *r_fastsky; -cvar_t *vr_noSkybox; +cvar_t *vr_thirdPersonSpectator; cvar_t *r_drawSun; cvar_t *r_dynamiclight; cvar_t *r_dlightBacks; @@ -1312,7 +1312,7 @@ void R_Register( void ) r_useFlush = ri.Cvar_Get( "r_useFlush", "1", CVAR_ARCHIVE ); r_ignoreGLErrors = ri.Cvar_Get( "r_ignoreGLErrors", "1", CVAR_ARCHIVE ); r_fastsky = ri.Cvar_Get( "r_fastsky", "0", CVAR_ARCHIVE ); - vr_noSkybox = ri.Cvar_Get( "vr_noSkybox", "0", CVAR_TEMP ); + vr_thirdPersonSpectator = ri.Cvar_Get( "vr_thirdPersonSpectator", "0", CVAR_TEMP ); r_inGameVideo = ri.Cvar_Get( "r_inGameVideo", "1", CVAR_ARCHIVE ); r_drawSun = ri.Cvar_Get( "r_drawSun", "0", CVAR_ARCHIVE ); r_dynamiclight = ri.Cvar_Get( "r_dynamiclight", "0", CVAR_ARCHIVE ); diff --git a/android/app/src/main/cpp/code/renderergl2/tr_local.h b/android/app/src/main/cpp/code/renderergl2/tr_local.h index 29c988d9..16086877 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_local.h +++ b/android/app/src/main/cpp/code/renderergl2/tr_local.h @@ -1701,7 +1701,7 @@ extern cvar_t *r_lodscale; extern cvar_t *r_inGameVideo; // controls whether in game video should be draw extern cvar_t *r_fastsky; // controls whether sky should be cleared or drawn -extern cvar_t *vr_noSkybox; // +extern cvar_t *vr_thirdPersonSpectator; // extern cvar_t *r_drawSun; // controls drawing of sun quad extern cvar_t *r_dynamiclight; // dynamic lights enabled/disabled extern cvar_t *r_dlightBacks; // dlight non-facing surfaces for continuity 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 99238fcd..ecf4cec0 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_main.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_main.c @@ -294,6 +294,11 @@ 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 @@ -1942,10 +1947,13 @@ void R_RenderPshadowMaps(const refdef_t *fd) if (!radius) 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; + 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; + } 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 682c13d8..c5b7937d 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_marks.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_marks.c @@ -133,13 +133,17 @@ R_BoxSurfaces_r */ void R_BoxSurfaces_r(mnode_t *node, vec3_t mins, vec3_t maxs, surfaceType_t **list, int listsize, int *listlength, vec3_t dir) { - int s, c; + int s=0, c; msurface_t *surf; int *mark; // do the tail recursion in a loop while ( node->contents == -1 ) { - s = BoxOnPlaneSide( mins, maxs, node->plane ); + if (!vr_thirdPersonSpectator->integer) + s = BoxOnPlaneSide( mins, maxs, node->plane ); + else + s = 0; + if (s == 1) { node = node->children[0]; } else if (s == 2) { @@ -168,7 +172,11 @@ 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 - s = BoxOnPlaneSide( mins, maxs, &surf->cullinfo.plane ); + if (!vr_thirdPersonSpectator->integer) + s = BoxOnPlaneSide( mins, maxs, &surf->cullinfo.plane ); + else + s = 0; + if (s == 1 || s == 2) { *surfViewCount = tr.viewCount; } else if (DotProduct(surf->cullinfo.plane.normal, dir) > -0.5) { 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 4f2c6724..4ab6556b 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_mesh.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_mesh.c @@ -80,7 +80,12 @@ static int R_CullModel( mdvModel_t *model, trRefEntity_t *ent ) { mdvFrame_t *oldFrame, *newFrame; int i; - // compute frame pointers + if (vr_thirdPersonSpectator->integer) + { + return CULL_IN; + } + + // compute frame pointers newFrame = model->frames + ent->e.frame; oldFrame = model->frames + ent->e.oldframe; @@ -324,13 +329,17 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) { model = tr.currentModel->mdv[lod]; - // - // 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; + 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) + { + 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 fc345a32..d0c5d1c3 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,13 +1263,17 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) { ent->e.oldframe = 0; } - // - // 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; + 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) + { + return; + } } // diff --git a/android/app/src/main/cpp/code/renderergl2/tr_sky.c b/android/app/src/main/cpp/code/renderergl2/tr_sky.c index b1deb58d..8a9eadf4 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_sky.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_sky.c @@ -843,7 +843,7 @@ Other things could be stuck in here, like birds in the sky, etc ================ */ void RB_StageIteratorSky( void ) { - if ( r_fastsky->integer || vr_noSkybox->integer ) { + if ( r_fastsky->integer || vr_thirdPersonSpectator->integer ) { 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 f9a24424..f037d114 100644 --- a/android/app/src/main/cpp/code/renderergl2/tr_world.c +++ b/android/app/src/main/cpp/code/renderergl2/tr_world.c @@ -407,7 +407,7 @@ static void R_RecursiveWorldNode( mnode_t *node, uint32_t planeBits, uint32_t dl // if the node wasn't marked as potentially visible, exit // pvs is skipped for depth shadows - if (!(tr.viewParms.flags & VPF_DEPTHSHADOW) && node->visCounts[tr.visIndex] != tr.visCounts[tr.visIndex]) { + if (!r_nocull->integer && !(tr.viewParms.flags & VPF_DEPTHSHADOW) && node->visCounts[tr.visIndex] != tr.visCounts[tr.visIndex]) { return; } diff --git a/android/app/src/main/cpp/code/vr/vr_renderer.c b/android/app/src/main/cpp/code/vr/vr_renderer.c index d3985cc3..d89e38ae 100644 --- a/android/app/src/main/cpp/code/vr/vr_renderer.c +++ b/android/app/src/main/cpp/code/vr/vr_renderer.c @@ -214,7 +214,7 @@ void VR_ClearFrameBuffer( GLuint frameBuffer, int width, int height) glEnable( GL_SCISSOR_TEST ); glViewport( 0, 0, width, height ); - if (Cvar_VariableIntegerValue("vr_noSkybox")) + if (Cvar_VariableIntegerValue("vr_thirdPersonSpectator")) { //Blood red.. ish glClearColor( 0.12f, 0.0f, 0.05f, 1.0f );