Horz+ Widescreen support in the renderer
This commit is contained in:
@@ -390,6 +390,25 @@ void RE_RenderScene( const refdef_t *fd ) {
|
||||
parms.fovX = tr.refdef.fov_x;
|
||||
parms.fovY = tr.refdef.fov_y;
|
||||
|
||||
// leilei - widescreen
|
||||
// recalculate fov according to widescreen parameters
|
||||
{
|
||||
float zoomfov = tr.refdef.fov_x / 90; // figure out our zoom or changed fov magnitiude from cg_fov and cg_zoomfov
|
||||
|
||||
// try not to recalculate fov of ui and hud elements
|
||||
if (((tr.refdef.fov_x / tr.refdef.fov_y) > 1.3) && (tr.refdef.width > 320) && (tr.refdef.height > 240))
|
||||
{
|
||||
// undo vert-
|
||||
parms.fovY = parms.fovY * (73.739792 / tr.refdef.fov_y) * zoomfov;
|
||||
|
||||
// recalculate the fov
|
||||
parms.fovX = (atan (glConfig.vidWidth / (glConfig.vidHeight / tan ((parms.fovY * M_PI) / 360.0f))) * 360.0f) / M_PI;
|
||||
parms.fovY = (atan (glConfig.vidHeight / (glConfig.vidWidth / tan ((parms.fovX * M_PI) / 360.0f))) * 360.0f) / M_PI;
|
||||
}
|
||||
}
|
||||
|
||||
// leilei - end
|
||||
|
||||
parms.stereoFrame = tr.refdef.stereoFrame;
|
||||
|
||||
VectorCopy( fd->vieworg, parms.or.origin );
|
||||
|
Reference in New Issue
Block a user