clean up GetLocalInput

This commit is contained in:
nukeykt 2019-09-01 02:09:42 +09:00 committed by Christoph Oelckers
parent a00d0f5986
commit 664596e369

View file

@ -59,50 +59,18 @@ void ClearSpaceBar(short nPlayer)
void GetLocalInput() void GetLocalInput()
{ {
int ebx = 6; int i;
int eax = 24; for (i = 6; i >= 0; i--)
int edx = -8;
uint8_t cl;
// TODO: clean up
uint32_t esi;
while (ebx >= 0)
{ {
if (eax <= 31) if (BUTTON(gamefunc_Weapon_1+i))
{
esi = CONTROL_ButtonState;
cl = eax;
}
else
{
esi = CONTROL_ButtonState>>32;
cl = edx;
}
if ((esi >> cl) & 1)
break; break;
eax--;
edx--;
ebx--;
} }
i++;
ebx++;
if (PlayerList[nLocalPlayer].nHealth) if (PlayerList[nLocalPlayer].nHealth)
{ {
eax = (BUTTON(gamefunc_Crouch) << 4) | (BUTTON(gamefunc_Fire) << 3); lLocalButtons = (BUTTON(gamefunc_Crouch) << 4) | (BUTTON(gamefunc_Fire) << 3)
| (BUTTON(gamefunc_Jump)<<0) | (i<<13);
edx = BUTTON(gamefunc_Jump);
ebx <<= 13;
eax |= edx;
eax |= ebx;
lLocalButtons = eax;
} }
else else
{ {