components/prboom/p_switch.c
//
// P_StartButton()
//
// Start a button (retriggerable switch) counting down till it turns off.
//
// Passed the linedef the button is on, which texture on the sidedef contains
// the button, the texture number of the button, and the time the button is
// to remain active in gametics.
// No return.
//
P_StartButton()
Start a button (retriggerable switch) counting down till it turns off.

Passed the linedef the button is on, which texture on the sidedef contains
the button, the texture number of the button, and the time the button is
to remain active in gametics.
No return.
P_StartButton () Start a button ( retriggerable switch ) counting down till it turns off . Passed the linedef the button is on which texture on the sidedef contains the button the texture number of the button and the time the button is to remain active in gametics . No return .
static void P_StartButton
( line_t*       line,
  bwhere_e      w,
  int           texture,
  int           time )
{
  int           i;
  for (i = 0;i < MAXBUTTONS;i++)
    if (buttonlist[i].btimer && buttonlist[i].line == line)
      return;
  for (i = 0;i < MAXBUTTONS;i++)
    if (!buttonlist[i].btimer)    
    {
      buttonlist[i].line = line;
      buttonlist[i].where = w;
      buttonlist[i].btexture = texture;
      buttonlist[i].btimer = time;
      buttonlist[i].soundorg = (mobj_t *)&line->soundorg;
      return;
    }
  I_Error("P_StartButton: no button slots left!");
}
static void P_StartButton ( line_t * line , bwhere_e w , int texture , int time ) { int i ; for ( i = 0 ; i < MAXBUTTONS ; i ++ ) if ( buttonlist [ i ] . btimer && buttonlist [ i ] . line == line ) return ; for ( i = 0 ; i < MAXBUTTONS ; i ++ ) if ( ! buttonlist [ i ] . btimer ) { buttonlist [ i ] . line = line ; buttonlist [ i ] . where = w ; buttonlist [ i ] . btexture = texture ; buttonlist [ i ] . btimer = time ; buttonlist [ i ] . soundorg = ( mobj_t * ) & line -> soundorg ; return ; } I_Error ( " " ) ; }
P_StartButton()
Start a button (retriggerable switch) counting down till it turns off.
P_StartButton () Start a button ( retriggerable switch ) counting down till it turns off .
// See if button is already pressed // use first unused element of list /* use sound origin of line itself - no need to compatibility-wrap
       * as the popout code gets it wrong whatever its value */