diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_draw.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_draw.cpp index 8ec5d56..788e1b8 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_draw.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_draw.cpp @@ -4368,7 +4368,6 @@ void CG_DrawActive( stereoFrame_t stereoView ) { VectorNormalize( vright_n ); VectorNormalize( vup_n ); - cg.refdef.stereoView = stereoView; switch ( stereoView ) { case STEREO_CENTER: separation = 0; diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_drawtools.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_drawtools.cpp index 042034c..4e86519 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_drawtools.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_drawtools.cpp @@ -34,7 +34,7 @@ void CG_AdjustFrom640( float *x, float *y, float *w, float *h ) { float screenYScale = 1.0f / (cg.drawingHUD == CG_HUD_SCALED ? 2.5f : 1.0f); float xoffset = cg.drawingHUD == CG_HUD_SCALED ? -20 : 0; - if (cg.refdef.stereoView == STEREO_LEFT) { + if (cg.stereoView == STEREO_LEFT) { xoffset *= -1; } diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_local.h b/Projects/Android/jni/OpenJK/code/cgame/cg_local.h index 00f9a53..a6a8bed 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_local.h +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_local.h @@ -341,6 +341,8 @@ typedef struct { int timelimitWarnings; // 5 min, 1 min, overtime + stereoFrame_t stereoView; + qboolean renderingThirdPerson; // during deaths, chasecams, etc // prediction state diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp index de36f03..367a634 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_view.cpp @@ -2007,7 +2007,11 @@ static qboolean cg_rangedFogging = qfalse; //so we know if we should go back to void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) { qboolean inwater = qfalse; - cg.time = serverTime; + if ( stereoView == STEREO_LEFT ) { + cg.time = serverTime; + } + + cg.stereoView = stereoView; // update cvars CG_UpdateCvars(); diff --git a/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp b/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp index 5e19c7b..7a82c7b 100644 --- a/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp +++ b/Projects/Android/jni/OpenJK/code/cgame/cg_weapons.cpp @@ -1000,7 +1000,9 @@ static void CG_DoMuzzleFlash( centity_t *cent, vec3_t org, vec3_t dir, weaponDat // Handle muzzle flashes, really this could just be a qboolean instead of a time....... if ( cent->muzzleFlashTime > 0 ) { - cent->muzzleFlashTime = 0; + if (cg.stereoView == STEREO_RIGHT) { + cent->muzzleFlashTime = 0; + } const char *effect = NULL; // CG_PositionEntityOnTag( &flash, &gun, gun.hModel, "tag_flash"); diff --git a/Projects/Android/jni/OpenJK/code/rd-common/tr_types.h b/Projects/Android/jni/OpenJK/code/rd-common/tr_types.h index c0cb32e..ced4ea7 100644 --- a/Projects/Android/jni/OpenJK/code/rd-common/tr_types.h +++ b/Projects/Android/jni/OpenJK/code/rd-common/tr_types.h @@ -211,7 +211,6 @@ typedef struct { // text messages for deform text shaders // char text[MAX_RENDER_STRINGS][MAX_RENDER_STRING_LENGTH]; - stereoFrame_t stereoView; float worldscale; } refdef_t; diff --git a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_draw.cpp b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_draw.cpp index da6d90d..8b7eba6 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_draw.cpp +++ b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_draw.cpp @@ -2916,7 +2916,6 @@ void CG_DrawActive( stereoFrame_t stereoView ) { vr->cgzoommode = cg.zoomMode; - cg.refdef.stereoView = stereoView; switch ( stereoView ) { case STEREO_CENTER: separation = 0; diff --git a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_drawtools.cpp b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_drawtools.cpp index 56d3d05..8f4614b 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_drawtools.cpp +++ b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_drawtools.cpp @@ -33,7 +33,7 @@ void CG_AdjustFrom640( float *x, float *y, float *w, float *h ) { float screenYScale = 1.0f / (cg.drawingHUD == CG_HUD_SCALED ? 2.5f : 1.25f); float xoffset = cg.drawingHUD == CG_HUD_SCALED ? -20 : 0; - if (cg.refdef.stereoView == STEREO_LEFT) { + if (cg.stereoView == STEREO_LEFT) { xoffset *= -1; } diff --git a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_local.h b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_local.h index bde9c3e..48e8498 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_local.h +++ b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_local.h @@ -334,6 +334,8 @@ typedef struct { int timelimitWarnings; // 5 min, 1 min, overtime + stereoFrame_t stereoView; + qboolean renderingThirdPerson; // during deaths, chasecams, etc // prediction state diff --git a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_view.cpp b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_view.cpp index 79d574c..9cccd4f 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_view.cpp +++ b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_view.cpp @@ -1839,6 +1839,8 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) { cg.time = serverTime; } + cg.stereoView = stereoView; + // update cvars CG_UpdateCvars(); diff --git a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp index cb9defa..ff96cb4 100644 --- a/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp +++ b/Projects/Android/jni/OpenJK/codeJK2/cgame/cg_weapons.cpp @@ -917,7 +917,10 @@ static void CG_DoMuzzleFlash( centity_t *cent, vec3_t org, vec3_t dir, weaponDat // Handle muzzle flashes, really this could just be a qboolean instead of a time....... if ( cent->muzzleFlashTime > 0 ) { - cent->muzzleFlashTime = 0; + if (cg.stereoView == STEREO_RIGHT) { + cent->muzzleFlashTime = 0; + } + const char *effect = NULL; // CG_PositionEntityOnTag( &flash, &gun, gun.hModel, "tag_flash");