mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-24 21:11:03 +00:00
Correct aspect ratio on scope / binoculars overlay
This commit is contained in:
parent
3fe778ea7f
commit
92ef497bbc
2 changed files with 25 additions and 2 deletions
|
@ -2512,6 +2512,24 @@ static qboolean CG_RenderingFromMiscCamera()
|
|||
return qfalse;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
-------------------------
|
||||
CG_DrawZoomBorders
|
||||
-------------------------
|
||||
*/
|
||||
|
||||
static void CG_DrawZoomBorders( void )
|
||||
{
|
||||
vec4_t modulate;
|
||||
modulate[0] = modulate[1] = modulate[2] = 0.0f;
|
||||
modulate[3] = 1.0f;
|
||||
|
||||
int bar_height = 80;
|
||||
CG_FillRect( 0, 0, 640, bar_height, modulate );
|
||||
CG_FillRect( 0, 480 - 80, 640, bar_height, modulate );
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
CG_Draw2D
|
||||
|
@ -2555,6 +2573,11 @@ static void CG_Draw2D( void )
|
|||
CGCam_DrawWideScreen();
|
||||
}
|
||||
|
||||
if (cg.zoomMode)
|
||||
{
|
||||
CG_DrawZoomBorders();
|
||||
}
|
||||
|
||||
cg.drawingHUD = CG_HUD_SCALED;
|
||||
|
||||
CG_DrawBatteryCharge();
|
||||
|
@ -2831,7 +2854,7 @@ void CG_DrawActive( stereoFrame_t stereoView ) {
|
|||
|
||||
// offset vieworg appropriately if we're doing stereo separation
|
||||
VectorCopy( cg.refdef.vieworg, baseOrg );
|
||||
if ( separation != 0 && (!in_camera || vr->immersive_cinematics) && !in_misccamera) {
|
||||
if ( separation != 0 && (!in_camera || vr->immersive_cinematics) && !in_misccamera && cg.zoomMode != 2 ) {
|
||||
VectorMA( cg.refdef.vieworg, -separation, cg.refdef.viewaxis[1], cg.refdef.vieworg );
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ void CG_AdjustFrom640( float *x, float *y, float *w, float *h ) {
|
|||
if (cg.drawingHUD && !vr->cin_camera && !vr->using_screen_layer)
|
||||
{
|
||||
float screenXScale = 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 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) {
|
||||
|
|
Loading…
Reference in a new issue