mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 20:41:25 +00:00
Adjust field of view to the aspect ratio
This commit is contained in:
parent
923e9c4a3b
commit
0d943e31b1
1 changed files with 5 additions and 0 deletions
|
@ -941,6 +941,11 @@ void R_ExecuteSetViewSize(void)
|
||||||
if (splitscreen == 1) // Splitscreen FOV should be adjusted to maintain expected vertical view
|
if (splitscreen == 1) // Splitscreen FOV should be adjusted to maintain expected vertical view
|
||||||
fovtan = 17*fovtan/10;
|
fovtan = 17*fovtan/10;
|
||||||
|
|
||||||
|
// Adjust field of view to the aspect ratio
|
||||||
|
fixed_t resmul = FixedDiv(vid.width * FRACUNIT, vid.height * FRACUNIT);
|
||||||
|
if (resmul > FRACUNIT)
|
||||||
|
fovtan = FixedMul(fovtan, resmul);
|
||||||
|
|
||||||
projection = projectiony = FixedDiv(centerxfrac, fovtan);
|
projection = projectiony = FixedDiv(centerxfrac, fovtan);
|
||||||
|
|
||||||
R_InitViewBuffer(scaledviewwidth, viewheight);
|
R_InitViewBuffer(scaledviewwidth, viewheight);
|
||||||
|
|
Loading…
Reference in a new issue