mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-28 12:30:46 +00:00
- restrict keyboard input to the actual tic in SW as well.
Also fixed the blocking of the strafe key with sector objects - this must have gotten lost somewhere.
This commit is contained in:
parent
1f4594b450
commit
eb4e0b1b83
1 changed files with 33 additions and 25 deletions
|
@ -199,7 +199,7 @@ static void processWeapon(PLAYERp const pp)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
static void processMovement(PLAYERp const pp, ControlInfo* const hidInput, bool const mouseaim)
|
||||
static void processMovement(PLAYERp const pp, ControlInfo* const hidInput, bool const mouseaim, bool allowkeys)
|
||||
{
|
||||
double const scaleAdjust = InputScale();
|
||||
bool const strafeKey = buttonMap.ButtonDown(gamefunc_Strafe) && !pp->sop;
|
||||
|
@ -239,17 +239,7 @@ static void processMovement(PLAYERp const pp, ControlInfo* const hidInput, bool
|
|||
svel -= xs_CRoundToInt(scaleAdjust * (hidInput->dx * keymove));
|
||||
fvel -= xs_CRoundToInt(scaleAdjust * (hidInput->dz * keymove));
|
||||
|
||||
if (strafeKey)
|
||||
{
|
||||
if (abs(svel) < keymove)
|
||||
{
|
||||
if (buttonMap.ButtonDown(gamefunc_Turn_Left))
|
||||
svel += keymove;
|
||||
if (buttonMap.ButtonDown(gamefunc_Turn_Right))
|
||||
svel -= keymove;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (strafeKey || pp->sop)
|
||||
{
|
||||
if (buttonMap.ButtonDown(gamefunc_Turn_Left) || (buttonMap.ButtonDown(gamefunc_Strafe_Left) && pp->sop))
|
||||
{
|
||||
|
@ -267,21 +257,39 @@ static void processMovement(PLAYERp const pp, ControlInfo* const hidInput, bool
|
|||
}
|
||||
}
|
||||
|
||||
if (abs(loc.svel) < keymove)
|
||||
if (allowkeys)
|
||||
{
|
||||
if (buttonMap.ButtonDown(gamefunc_Strafe_Left) && !pp->sop)
|
||||
svel += keymove;
|
||||
if (!pp->sop)
|
||||
{
|
||||
if (strafeKey)
|
||||
{
|
||||
if (abs(svel) < keymove)
|
||||
{
|
||||
if (buttonMap.ButtonDown(gamefunc_Turn_Left))
|
||||
svel += keymove;
|
||||
if (buttonMap.ButtonDown(gamefunc_Turn_Right))
|
||||
svel -= keymove;
|
||||
}
|
||||
}
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Strafe_Right) && !pp->sop)
|
||||
svel -= keymove;
|
||||
}
|
||||
if (abs(loc.fvel) < keymove)
|
||||
{
|
||||
if (buttonMap.ButtonDown(gamefunc_Move_Forward))
|
||||
fvel += keymove;
|
||||
if (abs(loc.svel) < keymove)
|
||||
{
|
||||
if (buttonMap.ButtonDown(gamefunc_Strafe_Left))
|
||||
svel += keymove;
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Move_Backward))
|
||||
fvel -= keymove;
|
||||
if (buttonMap.ButtonDown(gamefunc_Strafe_Right))
|
||||
svel -= keymove;
|
||||
}
|
||||
}
|
||||
|
||||
if (abs(loc.fvel) < keymove)
|
||||
{
|
||||
if (buttonMap.ButtonDown(gamefunc_Move_Forward))
|
||||
fvel += keymove;
|
||||
|
||||
if (buttonMap.ButtonDown(gamefunc_Move_Backward))
|
||||
fvel -= keymove;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cl_syncinput)
|
||||
|
@ -358,7 +366,7 @@ void GameInterface::GetInput(InputPacket *packet, ControlInfo* const hidInput)
|
|||
bool mouseaim;
|
||||
|
||||
processInputBits(pp, hidInput, &mouseaim);
|
||||
processMovement(pp, hidInput, mouseaim);
|
||||
processMovement(pp, hidInput, mouseaim, packet != nullptr);
|
||||
processWeapon(pp);
|
||||
|
||||
if (packet)
|
||||
|
|
Loading…
Reference in a new issue