Fix issue with muzzle flash only causing dlight in the left eye

This commit is contained in:
Simon 2022-11-26 10:14:13 +00:00
parent f5390bd8b4
commit a8a402288b
11 changed files with 20 additions and 8 deletions

View file

@ -4368,7 +4368,6 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
VectorNormalize( vright_n ); VectorNormalize( vright_n );
VectorNormalize( vup_n ); VectorNormalize( vup_n );
cg.refdef.stereoView = stereoView;
switch ( stereoView ) { switch ( stereoView ) {
case STEREO_CENTER: case STEREO_CENTER:
separation = 0; separation = 0;

View file

@ -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 screenYScale = 1.0f / (cg.drawingHUD == CG_HUD_SCALED ? 2.5f : 1.0f);
float xoffset = cg.drawingHUD == CG_HUD_SCALED ? -20 : 0; float xoffset = cg.drawingHUD == CG_HUD_SCALED ? -20 : 0;
if (cg.refdef.stereoView == STEREO_LEFT) { if (cg.stereoView == STEREO_LEFT) {
xoffset *= -1; xoffset *= -1;
} }

View file

@ -341,6 +341,8 @@ typedef struct {
int timelimitWarnings; // 5 min, 1 min, overtime int timelimitWarnings; // 5 min, 1 min, overtime
stereoFrame_t stereoView;
qboolean renderingThirdPerson; // during deaths, chasecams, etc qboolean renderingThirdPerson; // during deaths, chasecams, etc
// prediction state // prediction state

View file

@ -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 ) { void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) {
qboolean inwater = qfalse; qboolean inwater = qfalse;
if ( stereoView == STEREO_LEFT ) {
cg.time = serverTime; cg.time = serverTime;
}
cg.stereoView = stereoView;
// update cvars // update cvars
CG_UpdateCvars(); CG_UpdateCvars();

View file

@ -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....... // Handle muzzle flashes, really this could just be a qboolean instead of a time.......
if ( cent->muzzleFlashTime > 0 ) if ( cent->muzzleFlashTime > 0 )
{ {
if (cg.stereoView == STEREO_RIGHT) {
cent->muzzleFlashTime = 0; cent->muzzleFlashTime = 0;
}
const char *effect = NULL; const char *effect = NULL;
// CG_PositionEntityOnTag( &flash, &gun, gun.hModel, "tag_flash"); // CG_PositionEntityOnTag( &flash, &gun, gun.hModel, "tag_flash");

View file

@ -211,7 +211,6 @@ typedef struct {
// text messages for deform text shaders // text messages for deform text shaders
// char text[MAX_RENDER_STRINGS][MAX_RENDER_STRING_LENGTH]; // char text[MAX_RENDER_STRINGS][MAX_RENDER_STRING_LENGTH];
stereoFrame_t stereoView;
float worldscale; float worldscale;
} refdef_t; } refdef_t;

View file

@ -2916,7 +2916,6 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
vr->cgzoommode = cg.zoomMode; vr->cgzoommode = cg.zoomMode;
cg.refdef.stereoView = stereoView;
switch ( stereoView ) { switch ( stereoView ) {
case STEREO_CENTER: case STEREO_CENTER:
separation = 0; separation = 0;

View file

@ -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 screenYScale = 1.0f / (cg.drawingHUD == CG_HUD_SCALED ? 2.5f : 1.25f);
float xoffset = cg.drawingHUD == CG_HUD_SCALED ? -20 : 0; float xoffset = cg.drawingHUD == CG_HUD_SCALED ? -20 : 0;
if (cg.refdef.stereoView == STEREO_LEFT) { if (cg.stereoView == STEREO_LEFT) {
xoffset *= -1; xoffset *= -1;
} }

View file

@ -334,6 +334,8 @@ typedef struct {
int timelimitWarnings; // 5 min, 1 min, overtime int timelimitWarnings; // 5 min, 1 min, overtime
stereoFrame_t stereoView;
qboolean renderingThirdPerson; // during deaths, chasecams, etc qboolean renderingThirdPerson; // during deaths, chasecams, etc
// prediction state // prediction state

View file

@ -1839,6 +1839,8 @@ void CG_DrawActiveFrame( int serverTime, stereoFrame_t stereoView ) {
cg.time = serverTime; cg.time = serverTime;
} }
cg.stereoView = stereoView;
// update cvars // update cvars
CG_UpdateCvars(); CG_UpdateCvars();

View file

@ -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....... // Handle muzzle flashes, really this could just be a qboolean instead of a time.......
if ( cent->muzzleFlashTime > 0 ) if ( cent->muzzleFlashTime > 0 )
{ {
if (cg.stereoView == STEREO_RIGHT) {
cent->muzzleFlashTime = 0; cent->muzzleFlashTime = 0;
}
const char *effect = NULL; const char *effect = NULL;
// CG_PositionEntityOnTag( &flash, &gun, gun.hModel, "tag_flash"); // CG_PositionEntityOnTag( &flash, &gun, gun.hModel, "tag_flash");