components/prboom/p_lights.c
//
// EV_LightTurnOn()
//
// Turn sectors tagged to line lights on to specified or max neighbor level
//
// Passed the activating line, and a level to set the light to
// If level passed is 0, the maximum neighbor lighting is used
// Returns true
//
// jff 2/12/98 added int return value, fixed return
//
EV_LightTurnOn()
Turn sectors tagged to line lights on to specified or max neighbor level

Passed the activating line, and a level to set the light to
If level passed is 0, the maximum neighbor lighting is used
Returns true

jff 2/12/98 added int return value, fixed return
EV_LightTurnOn () Turn sectors tagged to line lights on to specified or max neighbor level Passed the activating line and a level to set the light to If level passed is 0 the maximum neighbor lighting is used Returns true jff 2 / 12 / 98 added int return value fixed return
int EV_LightTurnOn(line_t *line, int bright)
{
  int i;
  for (i = -1; (i = P_FindSectorFromLineTag(line,i)) >= 0;)
    {
      sector_t *temp, *sector = sectors+i;
      int j, tbright = bright; 
      if (!bright)
  for (j = 0;j < sector->linecount; j++)
    if ((temp = getNextSector(sector->lines[j],sector)) &&
        temp->lightlevel > tbright)
      tbright = temp->lightlevel;
      sector->lightlevel = tbright;
      if (comp[comp_model])
  bright = tbright;
    }
  return 1;
}
int EV_LightTurnOn ( line_t * line , int bright ) { int i ; for ( i = -1 ; ( i = P_FindSectorFromLineTag ( line , i ) ) >= 0 ; ) { sector_t * temp , * sector = sectors + i ; int j , tbright = bright ; if ( ! bright ) for ( j = 0 ; j < sector -> linecount ; j ++ ) if ( ( temp = getNextSector ( sector -> lines [ j ] , sector ) ) && temp -> lightlevel > tbright ) tbright = temp -> lightlevel ; sector -> lightlevel = tbright ; if ( comp [ comp_model ] ) bright = tbright ; } return 1 ; }
EV_LightTurnOn()
Turn sectors tagged to line lights on to specified or max neighbor level
EV_LightTurnOn () Turn sectors tagged to line lights on to specified or max neighbor level
// search all sectors for ones with same tag as activating line // killough 10/98: replace inefficient search with fast search //jff 5/17/98 search for maximum PER sector // bright = 0 means to search for highest light level surrounding sector //jff 5/17/98 unless compatibility optioned //then maximum near ANY tagged sector