diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index f49f182a6..465e7fcbf 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -493,11 +493,11 @@ void GameTicker() int lLocalButtons = GetLocalInput(); // shouldn't this be placed in localInput? PlayerInterruptKeys(); - nPlayerDAng = fix16_sadd(nPlayerDAng, localInput.nAngle); + nPlayerDAng = fix16_sadd(nPlayerDAng, localInput.q16avel); inita &= kAngleMask; - lPlayerXVel += localInput.yVel * Cos(inita) + localInput.xVel * Sin(inita); - lPlayerYVel += localInput.yVel * Sin(inita) - localInput.xVel * Cos(inita); + lPlayerXVel += localInput.fvel * Cos(inita) + localInput.svel * Sin(inita); + lPlayerYVel += localInput.fvel * Sin(inita) - localInput.svel * Cos(inita); lPlayerXVel -= (lPlayerXVel >> 5) + (lPlayerXVel >> 6); lPlayerYVel -= (lPlayerYVel >> 5) + (lPlayerYVel >> 6); diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index 169be9d4c..ea18c6f7e 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -258,10 +258,10 @@ void PlayerInterruptKeys() if (buttonMap.ButtonDown(gamefunc_Move_Backward)) input.yVel += -keyMove; - localInput.yVel = clamp(localInput.yVel + input.yVel, -12, 12); - localInput.xVel = clamp(localInput.xVel + input.xVel, -12, 12); + localInput.fvel = clamp(localInput.fvel + input.yVel, -12, 12); + localInput.svel = clamp(localInput.svel + input.xVel, -12, 12); - localInput.nAngle = fix16_sadd(localInput.nAngle, input.nAngle); + localInput.q16avel = fix16_sadd(localInput.q16avel, input.nAngle); PlayerList[nLocalPlayer].q16angle = fix16_sadd(PlayerList[nLocalPlayer].q16angle, input.nAngle) & 0x7FFFFFF; // A horiz diff of 128 equal 45 degrees, diff --git a/source/exhumed/src/ps_input.h b/source/exhumed/src/ps_input.h index 011ff7847..0c298fe62 100644 --- a/source/exhumed/src/ps_input.h +++ b/source/exhumed/src/ps_input.h @@ -49,13 +49,13 @@ struct PlayerInput int8_t nItem; }; -struct LocalInput // TODO consider adjusting this for demo compatibility +struct LocalInput { - int xVel; - int yVel; - fix16_t nAngle; + int svel; + int fvel; + fix16_t q16avel; uint16_t buttons; - fix16_t horizon; + fix16_t q16horz; }; void InitInput();