mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-24 04:29:34 -04:00
Use same data type for pitch and angleturn (#1872)
This commit is contained in:
parent
d7e1a4550e
commit
eab8ca7c0e
@ -36,7 +36,7 @@ typedef struct ticcmd_s
|
||||
byte chatchar;
|
||||
byte buttons;
|
||||
|
||||
int pitch;
|
||||
short pitch;
|
||||
short ticangleturn; // Local angle delta for composite input only.
|
||||
} ticcmd_t;
|
||||
|
||||
|
@ -538,7 +538,7 @@ void G_PrepGyroTiccmd(void)
|
||||
|
||||
if (gyro_axes[GYRO_LOOK])
|
||||
{
|
||||
localview.rawpitch += gyro_axes[GYRO_LOOK] * FRACUNIT;
|
||||
localview.rawpitch += gyro_axes[GYRO_LOOK];
|
||||
basecmd.pitch = G_CarryPitch(localview.rawpitch);
|
||||
gyro_axes[GYRO_LOOK] = 0.0f;
|
||||
}
|
||||
|
@ -146,10 +146,11 @@ void G_UpdateAngleFunctions(void)
|
||||
}
|
||||
}
|
||||
|
||||
int G_CarryPitch(double pitch)
|
||||
short G_CarryPitch(double pitch)
|
||||
{
|
||||
return (localview.pitch =
|
||||
CarryError(pitch, &prevcarry.pitch, &carry.pitch));
|
||||
const short result = CarryError(pitch, &prevcarry.pitch, &carry.pitch);
|
||||
localview.pitch = result << FRACBITS;
|
||||
return result;
|
||||
}
|
||||
|
||||
int G_CarrySide(double side)
|
||||
@ -204,7 +205,7 @@ void G_UpdateGamepadVariables(void)
|
||||
if (I_StandardLayout())
|
||||
{
|
||||
joy_scale_angle = ANALOG_MULT * direction[joy_invert_turn];
|
||||
joy_scale_pitch = ANALOG_MULT * direction[joy_invert_look] * FRACUNIT;
|
||||
joy_scale_pitch = ANALOG_MULT * direction[joy_invert_look];
|
||||
|
||||
if (correct_aspect_ratio)
|
||||
{
|
||||
@ -312,7 +313,7 @@ void G_UpdateMouseVariables(void)
|
||||
if (mouse_sensitivity_y_look)
|
||||
{
|
||||
mouse_sens_pitch = ((double)(mouse_sensitivity_y_look + 5) * 8 / 10
|
||||
* direction[mouse_y_invert] * FRACUNIT);
|
||||
* direction[mouse_y_invert]);
|
||||
|
||||
if (correct_aspect_ratio)
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ void G_ClearCarry(void);
|
||||
extern short (*G_CarryAngleTic)(double angle);
|
||||
extern short (*G_CarryAngle)(double angle);
|
||||
void G_UpdateAngleFunctions(void);
|
||||
int G_CarryPitch(double pitch);
|
||||
short G_CarryPitch(double pitch);
|
||||
int G_CarrySide(double side);
|
||||
int G_CarryVert(double vert);
|
||||
|
||||
|
@ -250,7 +250,7 @@ void P_MovePlayer (player_t* player)
|
||||
|
||||
if (!menuactive && !demoplayback && !player->centering)
|
||||
{
|
||||
player->pitch += cmd->pitch;
|
||||
player->pitch += cmd->pitch << FRACBITS;
|
||||
player->pitch = BETWEEN(-MAX_PITCH_ANGLE, MAX_PITCH_ANGLE, player->pitch);
|
||||
player->slope = PlayerSlope(player);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user