mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-29 02:10:36 +00:00
- Blood: Apply horizon input outside of pPlayer->q16look
and fix some incorrectly declared types.
* Looking up/down is a bit rough at first as q16look is disproportionate to where the player is currently looking. * Won't be an issue with a unified horizon algorithm in the backend.
This commit is contained in:
parent
eb0bd9638b
commit
9c56dfffe0
3 changed files with 6 additions and 10 deletions
|
@ -106,10 +106,6 @@ static void GetInputInternal(ControlInfo* const hidInput)
|
|||
static int32_t lastInputClock; // MED
|
||||
int32_t const elapsedTics = gFrameClock - lastInputClock;
|
||||
|
||||
// Blood's q16mlook scaling is different from the other games, therefore use the below constant to attenuate
|
||||
// the speed to match the other games.
|
||||
float const mlookScale = 3.25f;
|
||||
|
||||
lastInputClock = gFrameClock;
|
||||
|
||||
if (turnLeft || turnRight)
|
||||
|
@ -138,14 +134,14 @@ static void GetInputInternal(ControlInfo* const hidInput)
|
|||
input.fvel -= xs_CRoundToInt(scaleAdjust * (hidInput->dz * keyMove));
|
||||
|
||||
if (mouseaim)
|
||||
input.q16horz += FloatToFixed(hidInput->mousey / mlookScale);
|
||||
input.q16horz += FloatToFixed(hidInput->mousey);
|
||||
else
|
||||
input.fvel -= xs_CRoundToInt(hidInput->mousey * 64.);
|
||||
|
||||
if (!in_mouseflip)
|
||||
input.q16horz = -input.q16horz;
|
||||
|
||||
input.q16horz -= FloatToFixed(scaleAdjust * (hidInput->dpitch / mlookScale));
|
||||
input.q16horz -= FloatToFixed(scaleAdjust * hidInput->dpitch);
|
||||
|
||||
gInput.fvel = clamp(gInput.fvel + input.fvel, -2048, 2048);
|
||||
gInput.svel = clamp(gInput.svel + input.svel, -2048, 2048);
|
||||
|
|
|
@ -1363,7 +1363,7 @@ void sethorizon(PLAYER *pPlayer, fixed_t const q16horz, double const scaleAdjust
|
|||
pPlayer->q16look = max(pPlayer->q16look - FloatToFixed(scaleAdjust * 4.), IntToFixed(-60));
|
||||
}
|
||||
|
||||
pPlayer->q16look = clamp(pPlayer->q16look + q16horz, IntToFixed(-60), IntToFixed(60));
|
||||
pPlayer->q16look = clamp(pPlayer->q16look, IntToFixed(-60), IntToFixed(60));
|
||||
|
||||
if (pPlayer->q16look > 0)
|
||||
{
|
||||
|
@ -1375,7 +1375,7 @@ void sethorizon(PLAYER *pPlayer, fixed_t const q16horz, double const scaleAdjust
|
|||
}
|
||||
else
|
||||
{
|
||||
pPlayer->q16horiz = 0;
|
||||
pPlayer->q16horiz = clamp(pPlayer->q16horiz + q16horz, IntToFixed(-179), IntToFixed(119));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -109,8 +109,8 @@ struct PLAYER
|
|||
int zWeapon;
|
||||
int zWeaponVel;
|
||||
fixed_t q16look;
|
||||
int q16horiz; // horiz
|
||||
int q16slopehoriz; // horizoff
|
||||
fixed_t q16horiz; // horiz
|
||||
fixed_t q16slopehoriz; // horizoff
|
||||
int slope;
|
||||
bool isUnderwater;
|
||||
bool hasKey[8];
|
||||
|
|
Loading…
Reference in a new issue