mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-13 08:27:42 +00:00
Wide screen fov adjustments.
This commit is contained in:
parent
e7047b316e
commit
333b400ca0
1 changed files with 9 additions and 6 deletions
|
@ -702,7 +702,6 @@ Fixed fov at intermissions, otherwise account for fov variable and zooms.
|
||||||
|
|
||||||
static int CG_CalcFov(void)
|
static int CG_CalcFov(void)
|
||||||
{
|
{
|
||||||
float x;
|
|
||||||
float phase;
|
float phase;
|
||||||
float v;
|
float v;
|
||||||
int contents;
|
int contents;
|
||||||
|
@ -736,7 +735,7 @@ static int CG_CalcFov(void)
|
||||||
zoomFov = 90;
|
zoomFov = 90;
|
||||||
cg.zoomed = qfalse;
|
cg.zoomed = qfalse;
|
||||||
} else {
|
} else {
|
||||||
switch ((int) fov_x) {
|
switch (CG_RQ3_GetLastFov()) {
|
||||||
case 20:
|
case 20:
|
||||||
zoomFov = 10;
|
zoomFov = 10;
|
||||||
cg.zoomed = qtrue;
|
cg.zoomed = qtrue;
|
||||||
|
@ -855,9 +854,13 @@ static int CG_CalcFov(void)
|
||||||
cg.zoomSensLock = qfalse;
|
cg.zoomSensLock = qfalse;
|
||||||
}
|
}
|
||||||
|
|
||||||
x = cg.refdef.width / tan(fov_x / 360 * M_PI);
|
// Makro - adjust for wide screen
|
||||||
fov_y = atan2(cg.refdef.height, x);
|
// We first determine fov_y corresponding to the previously computed fov_x,
|
||||||
fov_y = fov_y * 360 / M_PI;
|
// if the screen had been 4:3. Then, given that fov_y, we determine fov_x
|
||||||
|
// taking into account the actual aspect ratio.
|
||||||
|
|
||||||
|
fov_y = atan2(tan(fov_x / 360 * M_PI), 4.f / 3.f) * 360 / M_PI;
|
||||||
|
fov_x = 360.f / M_PI * atan2(tan(fov_y * M_PI / 360.f) * cg.refdef.width, cg.refdef.height);
|
||||||
|
|
||||||
// warp if underwater
|
// warp if underwater
|
||||||
contents = CG_PointContents(cg.refdef.vieworg, -1);
|
contents = CG_PointContents(cg.refdef.vieworg, -1);
|
||||||
|
@ -883,7 +886,7 @@ static int CG_CalcFov(void)
|
||||||
cg.zoomSensitivity = cg.refdef.fov_y / 75.0;
|
cg.zoomSensitivity = cg.refdef.fov_y / 75.0;
|
||||||
else {
|
else {
|
||||||
// Use user-defined sensitivites
|
// Use user-defined sensitivites
|
||||||
switch ((int) fov_x) {
|
switch (CG_RQ3_GetLastFov()) {
|
||||||
case 45:
|
case 45:
|
||||||
cg.zoomSensitivity = cg_RQ3_ssgSensitivity2x.value;
|
cg.zoomSensitivity = cg_RQ3_ssgSensitivity2x.value;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue