mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
Fixed: don't interpolate view movements if a key press didn't result in any changes.
This commit is contained in:
parent
7d67d5e998
commit
80701927e8
3 changed files with 8 additions and 14 deletions
|
@ -328,12 +328,12 @@ void D_PostEvent (const event_t *ev)
|
||||||
int look = int(ev->y * m_pitch * mouse_sensitivity * 16.0);
|
int look = int(ev->y * m_pitch * mouse_sensitivity * 16.0);
|
||||||
if (invertmouse)
|
if (invertmouse)
|
||||||
look = -look;
|
look = -look;
|
||||||
G_AddViewPitch (look);
|
G_AddViewPitch (look, true);
|
||||||
events[eventhead].y = 0;
|
events[eventhead].y = 0;
|
||||||
}
|
}
|
||||||
if (!Button_Strafe.bDown && !lookstrafe)
|
if (!Button_Strafe.bDown && !lookstrafe)
|
||||||
{
|
{
|
||||||
G_AddViewAngle (int(ev->x * m_yaw * mouse_sensitivity * 8.0));
|
G_AddViewAngle (int(ev->x * m_yaw * mouse_sensitivity * 8.0), true);
|
||||||
events[eventhead].x = 0;
|
events[eventhead].x = 0;
|
||||||
}
|
}
|
||||||
if ((events[eventhead].x | events[eventhead].y) == 0)
|
if ((events[eventhead].x | events[eventhead].y) == 0)
|
||||||
|
|
|
@ -608,24 +608,20 @@ void G_BuildTiccmd (ticcmd_t *cmd)
|
||||||
if (Button_Right.bDown)
|
if (Button_Right.bDown)
|
||||||
{
|
{
|
||||||
G_AddViewAngle (angleturn[tspeed]);
|
G_AddViewAngle (angleturn[tspeed]);
|
||||||
LocalKeyboardTurner = true;
|
|
||||||
}
|
}
|
||||||
if (Button_Left.bDown)
|
if (Button_Left.bDown)
|
||||||
{
|
{
|
||||||
G_AddViewAngle (-angleturn[tspeed]);
|
G_AddViewAngle (-angleturn[tspeed]);
|
||||||
LocalKeyboardTurner = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Button_LookUp.bDown)
|
if (Button_LookUp.bDown)
|
||||||
{
|
{
|
||||||
G_AddViewPitch (lookspeed[speed]);
|
G_AddViewPitch (lookspeed[speed]);
|
||||||
LocalKeyboardTurner = true;
|
|
||||||
}
|
}
|
||||||
if (Button_LookDown.bDown)
|
if (Button_LookDown.bDown)
|
||||||
{
|
{
|
||||||
G_AddViewPitch (-lookspeed[speed]);
|
G_AddViewPitch (-lookspeed[speed]);
|
||||||
LocalKeyboardTurner = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Button_MoveUp.bDown)
|
if (Button_MoveUp.bDown)
|
||||||
|
@ -701,12 +697,10 @@ void G_BuildTiccmd (ticcmd_t *cmd)
|
||||||
if (joyaxes[JOYAXIS_Pitch] != 0)
|
if (joyaxes[JOYAXIS_Pitch] != 0)
|
||||||
{
|
{
|
||||||
G_AddViewPitch(joyint(joyaxes[JOYAXIS_Pitch] * 2048));
|
G_AddViewPitch(joyint(joyaxes[JOYAXIS_Pitch] * 2048));
|
||||||
LocalKeyboardTurner = true;
|
|
||||||
}
|
}
|
||||||
if (joyaxes[JOYAXIS_Yaw] != 0)
|
if (joyaxes[JOYAXIS_Yaw] != 0)
|
||||||
{
|
{
|
||||||
G_AddViewAngle(joyint(-1280 * joyaxes[JOYAXIS_Yaw]));
|
G_AddViewAngle(joyint(-1280 * joyaxes[JOYAXIS_Yaw]));
|
||||||
LocalKeyboardTurner = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
side -= joyint(sidemove[speed] * joyaxes[JOYAXIS_Side]);
|
side -= joyint(sidemove[speed] * joyaxes[JOYAXIS_Side]);
|
||||||
|
@ -794,7 +788,7 @@ void G_BuildTiccmd (ticcmd_t *cmd)
|
||||||
//[Graf Zahl] This really helps if the mouse update rate can't be increased!
|
//[Graf Zahl] This really helps if the mouse update rate can't be increased!
|
||||||
CVAR (Bool, smooth_mouse, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
CVAR (Bool, smooth_mouse, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
||||||
|
|
||||||
void G_AddViewPitch (int look)
|
void G_AddViewPitch (int look, bool mouse)
|
||||||
{
|
{
|
||||||
if (gamestate == GS_TITLELEVEL)
|
if (gamestate == GS_TITLELEVEL)
|
||||||
{
|
{
|
||||||
|
@ -837,11 +831,11 @@ void G_AddViewPitch (int look)
|
||||||
}
|
}
|
||||||
if (look != 0)
|
if (look != 0)
|
||||||
{
|
{
|
||||||
LocalKeyboardTurner = smooth_mouse;
|
LocalKeyboardTurner = (!mouse || smooth_mouse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void G_AddViewAngle (int yaw)
|
void G_AddViewAngle (int yaw, bool mouse)
|
||||||
{
|
{
|
||||||
if (gamestate == GS_TITLELEVEL)
|
if (gamestate == GS_TITLELEVEL)
|
||||||
{
|
{
|
||||||
|
@ -857,7 +851,7 @@ void G_AddViewAngle (int yaw)
|
||||||
LocalViewAngle -= yaw;
|
LocalViewAngle -= yaw;
|
||||||
if (yaw != 0)
|
if (yaw != 0)
|
||||||
{
|
{
|
||||||
LocalKeyboardTurner = smooth_mouse;
|
LocalKeyboardTurner = (!mouse || smooth_mouse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,10 +89,10 @@ void G_DoReborn (int playernum, bool freshbot);
|
||||||
void G_DoPlayerPop(int playernum);
|
void G_DoPlayerPop(int playernum);
|
||||||
|
|
||||||
// Adds pitch to consoleplayer's viewpitch and clamps it
|
// Adds pitch to consoleplayer's viewpitch and clamps it
|
||||||
void G_AddViewPitch (int look);
|
void G_AddViewPitch (int look, bool mouse = false);
|
||||||
|
|
||||||
// Adds to consoleplayer's viewangle if allowed
|
// Adds to consoleplayer's viewangle if allowed
|
||||||
void G_AddViewAngle (int yaw);
|
void G_AddViewAngle (int yaw, bool mouse = false);
|
||||||
|
|
||||||
#define BODYQUESIZE 32
|
#define BODYQUESIZE 32
|
||||||
class AActor;
|
class AActor;
|
||||||
|
|
Loading…
Reference in a new issue