mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-13 07:58:04 +00:00
- renamed fields in Exhumed's packed struct.
One step closer to getting these merged.
This commit is contained in:
parent
c7f5f05e14
commit
2ae5f960c5
3 changed files with 11 additions and 11 deletions
|
@ -493,11 +493,11 @@ void GameTicker()
|
||||||
int lLocalButtons = GetLocalInput(); // shouldn't this be placed in localInput?
|
int lLocalButtons = GetLocalInput(); // shouldn't this be placed in localInput?
|
||||||
PlayerInterruptKeys();
|
PlayerInterruptKeys();
|
||||||
|
|
||||||
nPlayerDAng = fix16_sadd(nPlayerDAng, localInput.nAngle);
|
nPlayerDAng = fix16_sadd(nPlayerDAng, localInput.q16avel);
|
||||||
inita &= kAngleMask;
|
inita &= kAngleMask;
|
||||||
|
|
||||||
lPlayerXVel += localInput.yVel * Cos(inita) + localInput.xVel * Sin(inita);
|
lPlayerXVel += localInput.fvel * Cos(inita) + localInput.svel * Sin(inita);
|
||||||
lPlayerYVel += localInput.yVel * Sin(inita) - localInput.xVel * Cos(inita);
|
lPlayerYVel += localInput.fvel * Sin(inita) - localInput.svel * Cos(inita);
|
||||||
lPlayerXVel -= (lPlayerXVel >> 5) + (lPlayerXVel >> 6);
|
lPlayerXVel -= (lPlayerXVel >> 5) + (lPlayerXVel >> 6);
|
||||||
lPlayerYVel -= (lPlayerYVel >> 5) + (lPlayerYVel >> 6);
|
lPlayerYVel -= (lPlayerYVel >> 5) + (lPlayerYVel >> 6);
|
||||||
|
|
||||||
|
|
|
@ -258,10 +258,10 @@ void PlayerInterruptKeys()
|
||||||
if (buttonMap.ButtonDown(gamefunc_Move_Backward))
|
if (buttonMap.ButtonDown(gamefunc_Move_Backward))
|
||||||
input.yVel += -keyMove;
|
input.yVel += -keyMove;
|
||||||
|
|
||||||
localInput.yVel = clamp(localInput.yVel + input.yVel, -12, 12);
|
localInput.fvel = clamp(localInput.fvel + input.yVel, -12, 12);
|
||||||
localInput.xVel = clamp(localInput.xVel + input.xVel, -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;
|
PlayerList[nLocalPlayer].q16angle = fix16_sadd(PlayerList[nLocalPlayer].q16angle, input.nAngle) & 0x7FFFFFF;
|
||||||
|
|
||||||
// A horiz diff of 128 equal 45 degrees,
|
// A horiz diff of 128 equal 45 degrees,
|
||||||
|
|
|
@ -49,13 +49,13 @@ struct PlayerInput
|
||||||
int8_t nItem;
|
int8_t nItem;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LocalInput // TODO consider adjusting this for demo compatibility
|
struct LocalInput
|
||||||
{
|
{
|
||||||
int xVel;
|
int svel;
|
||||||
int yVel;
|
int fvel;
|
||||||
fix16_t nAngle;
|
fix16_t q16avel;
|
||||||
uint16_t buttons;
|
uint16_t buttons;
|
||||||
fix16_t horizon;
|
fix16_t q16horz;
|
||||||
};
|
};
|
||||||
|
|
||||||
void InitInput();
|
void InitInput();
|
||||||
|
|
Loading…
Reference in a new issue