mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2024-11-25 21:31:18 +00:00
Prevent division by zero in CalcFov().
This commit is contained in:
parent
6403d62a28
commit
2cb28b8f01
2 changed files with 2 additions and 2 deletions
|
@ -268,7 +268,7 @@ float CalcFov (float fov_x, float width, float height)
|
|||
|
||||
x = width/tan(fov_x/360*M_PI);
|
||||
|
||||
a = atan (height/x);
|
||||
a = (x == 0) ? 90 : atan(height/x);
|
||||
|
||||
a = a*360/M_PI;
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ float CalcFov (float fov_x, float width, float height)
|
|||
|
||||
x = width/tan(fov_x/360*M_PI);
|
||||
|
||||
a = atan (height/x);
|
||||
a = (x == 0) ? 90 : atan(height/x);
|
||||
|
||||
a = a*360/M_PI;
|
||||
|
||||
|
|
Loading…
Reference in a new issue