mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-10 15:21:44 +00:00
Vignetting aspect on widescreen.
Fixed a compiler double/float warning. Fog background on widescreen.
This commit is contained in:
parent
3c08e99162
commit
91503e431c
3 changed files with 26 additions and 6 deletions
|
@ -1989,16 +1989,36 @@ static void CG_DrawCrosshair(void)
|
|||
}
|
||||
|
||||
trap_R_SetColor(NULL);
|
||||
// vignetting
|
||||
if (cgs.media.zoomMask)
|
||||
{
|
||||
const float ZMC_NORMAL = 0.f;
|
||||
const float ZMC_MAX = 0.175f;
|
||||
|
||||
float frac = (cg.refdef.fov_x - 10.f) / (90.f - 10.f);
|
||||
float fCoordX = ZMC_NORMAL * frac + ZMC_MAX * (1.f - frac);
|
||||
float fCoordY = fCoordX * cg.refdef.height / SCREEN_HEIGHT;
|
||||
float fov_frac = (cg.refdef.fov_x - 10.f) / (90.f - 10.f);
|
||||
float frac = 1.f - 2.f * (ZMC_NORMAL * fov_frac + ZMC_MAX * (1.f - fov_frac));
|
||||
|
||||
trap_R_DrawStretchPic(0, 0, cg.refdef.width, cg.refdef.height, fCoordX, fCoordY, 1.f - fCoordX, 1.f - fCoordY, cgs.media.zoomMask);
|
||||
float sx = cgs.glconfig.vidWidth / (float) SCREEN_WIDTH;
|
||||
float sy = cgs.glconfig.vidHeight / (float) SCREEN_HEIGHT;
|
||||
|
||||
float tex[2];
|
||||
|
||||
if (sx >= sy)
|
||||
{
|
||||
tex[0] = 0.f;
|
||||
tex[1] = 0.5f * (1.f - sy / sx);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
tex[0] = 0.5f * (1.f - sx / sy);
|
||||
tex[1] = 0.f;
|
||||
}
|
||||
|
||||
tex[0] = (tex[0] - 0.5f) * frac + 0.5f;
|
||||
tex[1] = (tex[1] - 0.5f) * frac + 0.5f;
|
||||
|
||||
trap_R_DrawStretchPic(0, 0, cg.refdef.width, cg.refdef.height, tex[0], tex[1], 1.f - tex[0], 1.f - tex[1], cgs.media.zoomMask);
|
||||
}
|
||||
|
||||
drawSSG = 1;
|
||||
|
|
|
@ -1067,7 +1067,7 @@ float UI_ProportionalSizeScale(int style)
|
|||
|
||||
//return 1.00;
|
||||
//TTI: HUD font upgrade
|
||||
return 0.4;
|
||||
return 0.4f;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1316,7 +1316,7 @@ void CG_DrawActiveFrame(int serverTime, stereoFrame_t stereoView, qboolean demoP
|
|||
fogcolor[1] = cgs.clearColor[1];
|
||||
fogcolor[2] = cgs.clearColor[2];
|
||||
fogcolor[3] = 1.0f;
|
||||
CG_FillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, fogcolor);
|
||||
CG_FillRect(cgs.screenXMin, 0, cgs.screenWidth, SCREEN_HEIGHT, fogcolor);
|
||||
}
|
||||
//CG_DrawBigPolygon();
|
||||
|
||||
|
|
Loading…
Reference in a new issue