- Added GetPlayerInput() for examining a player's inputs from ACS. Most

buttons are now passed across the network, and there are four new user
  buttons specifically for use with this command. Also defined +zoom
  and +reload for future implementation.

  See http://zdoom.org/files/examples/playerinput.zip for an example.


SVN r1215 (trunk)
This commit is contained in:
Randy Heit 2008-09-13 02:55:45 +00:00
commit 5cd4604f81
14 changed files with 252 additions and 49 deletions

View file

@ -531,20 +531,32 @@ void G_BuildTiccmd (ticcmd_t *cmd)
side -= sidemove[speed];
// buttons
if (Button_Attack.bDown)
cmd->ucmd.buttons |= BT_ATTACK;
if (Button_Attack.bDown) cmd->ucmd.buttons |= BT_ATTACK;
if (Button_AltAttack.bDown) cmd->ucmd.buttons |= BT_ALTATTACK;
if (Button_Use.bDown) cmd->ucmd.buttons |= BT_USE;
if (Button_Jump.bDown) cmd->ucmd.buttons |= BT_JUMP;
if (Button_Crouch.bDown) cmd->ucmd.buttons |= BT_CROUCH;
if (Button_Zoom.bDown) cmd->ucmd.buttons |= BT_ZOOM;
if (Button_Reload.bDown) cmd->ucmd.buttons |= BT_RELOAD;
if (Button_AltAttack.bDown)
cmd->ucmd.buttons |= BT_ALTATTACK;
if (Button_User1.bDown) cmd->ucmd.buttons |= BT_USER1;
if (Button_User2.bDown) cmd->ucmd.buttons |= BT_USER2;
if (Button_User3.bDown) cmd->ucmd.buttons |= BT_USER3;
if (Button_User4.bDown) cmd->ucmd.buttons |= BT_USER4;
if (Button_Use.bDown)
cmd->ucmd.buttons |= BT_USE;
if (Button_Jump.bDown)
cmd->ucmd.buttons |= BT_JUMP;
if (Button_Crouch.bDown)
cmd->ucmd.buttons |= BT_DUCK;
if (Button_Speed.bDown) cmd->ucmd.buttons |= BT_SPEED;
if (Button_Strafe.bDown) cmd->ucmd.buttons |= BT_STRAFE;
if (Button_MoveRight.bDown) cmd->ucmd.buttons |= BT_MOVERIGHT;
if (Button_MoveLeft.bDown) cmd->ucmd.buttons |= BT_MOVELEFT;
if (Button_LookDown.bDown) cmd->ucmd.buttons |= BT_LOOKDOWN;
if (Button_LookUp.bDown) cmd->ucmd.buttons |= BT_LOOKUP;
if (Button_Back.bDown) cmd->ucmd.buttons |= BT_BACK;
if (Button_Forward.bDown) cmd->ucmd.buttons |= BT_FORWARD;
if (Button_Right.bDown) cmd->ucmd.buttons |= BT_RIGHT;
if (Button_Left.bDown) cmd->ucmd.buttons |= BT_LEFT;
if (Button_MoveDown.bDown) cmd->ucmd.buttons |= BT_MOVEDOWN;
if (Button_MoveUp.bDown) cmd->ucmd.buttons |= BT_MOVEUP;
if (Button_ShowScores.bDown) cmd->ucmd.buttons |= BT_SHOWSCORES;
// [RH] Scale joystick moves to full range of allowed speeds
if (JoyAxes[JOYAXIS_PITCH] != 0)
@ -1208,7 +1220,8 @@ void G_PlayerReborn (int player)
p->skill = b_skill; //Added by MC:
p->oldbuttons = 255, p->attackdown = true; // don't do anything immediately
p->oldbuttons = ~0, p->attackdown = true; // don't do anything immediately
p->original_oldbuttons = ~0;
p->playerstate = PST_LIVE;
if (gamestate != GS_TITLELEVEL)