Scale pitch before clamping range

This commit is contained in:
ceski 2024-05-31 00:32:08 -07:00
parent ef34eab76d
commit c89059e606
5 changed files with 13 additions and 12 deletions

View File

@ -178,6 +178,11 @@ void G_UpdateControllerVariables(void)
{ {
joy_scale_angle = angleturn[1] * direction[joy_invert_turn]; joy_scale_angle = angleturn[1] * direction[joy_invert_turn];
joy_scale_pitch = angleturn[1] * direction[joy_invert_look] * FRACUNIT; joy_scale_pitch = angleturn[1] * direction[joy_invert_look] * FRACUNIT;
if (correct_aspect_ratio)
{
joy_scale_pitch /= 1.2;
}
} }
void G_UpdateDeltaTics(void) void G_UpdateDeltaTics(void)
@ -303,6 +308,11 @@ void G_UpdateMouseVariables(void)
{ {
mouse_sens_pitch = ((double)(mouse_sensitivity_y_look + 5) * 8 / 10 mouse_sens_pitch = ((double)(mouse_sensitivity_y_look + 5) * 8 / 10
* direction[mouse_y_invert] * FRACUNIT); * direction[mouse_y_invert] * FRACUNIT);
if (correct_aspect_ratio)
{
mouse_sens_pitch /= 1.2;
}
} }
if (mouse_sensitivity_strafe) if (mouse_sensitivity_strafe)

View File

@ -83,7 +83,7 @@ boolean toggle_fullscreen;
boolean toggle_exclusive_fullscreen; boolean toggle_exclusive_fullscreen;
static boolean use_vsync; // killough 2/8/98: controls whether vsync is called static boolean use_vsync; // killough 2/8/98: controls whether vsync is called
static boolean correct_aspect_ratio; boolean correct_aspect_ratio;
static int fpslimit; // when uncapped, limit framerate to this value static int fpslimit; // when uncapped, limit framerate to this value
static boolean fullscreen; static boolean fullscreen;
static boolean exclusive_fullscreen; static boolean exclusive_fullscreen;

View File

@ -77,6 +77,7 @@ extern boolean resetneeded;
extern boolean setrefreshneeded; extern boolean setrefreshneeded;
extern boolean toggle_fullscreen; extern boolean toggle_fullscreen;
extern boolean toggle_exclusive_fullscreen; extern boolean toggle_exclusive_fullscreen;
extern boolean correct_aspect_ratio;
extern boolean screenvisible; extern boolean screenvisible;
extern int gamma2; extern int gamma2;

View File

@ -45,16 +45,7 @@
static fixed_t PlayerSlope(player_t *player) static fixed_t PlayerSlope(player_t *player)
{ {
const fixed_t pitch = player->pitch; const fixed_t pitch = player->pitch;
return pitch ? -finetangent[(ANG90 - pitch) >> ANGLETOFINESHIFT] : 0;
if (pitch)
{
const fixed_t slope = -finetangent[(ANG90 - pitch) >> ANGLETOFINESHIFT];
return (fixed_t)((int64_t)slope * SCREENHEIGHT / ACTUALHEIGHT);
}
else
{
return 0;
}
} }
// Index of the special effects (INVUL inverse) map. // Index of the special effects (INVUL inverse) map.

View File

@ -497,7 +497,6 @@ static void R_SetupFreelook(void)
if (viewpitch) if (viewpitch)
{ {
dy = FixedMul(projection, -finetangent[(ANG90 - viewpitch) >> ANGLETOFINESHIFT]); dy = FixedMul(projection, -finetangent[(ANG90 - viewpitch) >> ANGLETOFINESHIFT]);
dy = (fixed_t)((int64_t)dy * SCREENHEIGHT / ACTUALHEIGHT);
} }
else else
{ {