- renamed fields in Exhumed's packed struct.

One step closer to getting these merged.
This commit is contained in:
Christoph Oelckers 2020-08-26 17:09:47 +02:00
parent c7f5f05e14
commit 2ae5f960c5
3 changed files with 11 additions and 11 deletions

View file

@ -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);

View file

@ -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,

View file

@ -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();