components/prboom/p_lights.c
//
// P_SpawnStrobeFlash
//
// Spawns a blinking light thinker
//
// Passed the sector that spawned the thinker, speed of blinking
// and whether blinking is to by syncrhonous with other sectors
//
// Returns nothing
//
P_SpawnStrobeFlash
Spawns a blinking light thinker

Passed the sector that spawned the thinker, speed of blinking
and whether blinking is to by syncrhonous with other sectors

Returns nothing
P_SpawnStrobeFlash Spawns a blinking light thinker Passed the sector that spawned the thinker speed of blinking and whether blinking is to by syncrhonous with other sectors Returns nothing
void P_SpawnStrobeFlash
( sector_t* sector,
  int   fastOrSlow,
  int   inSync )
{
  strobe_t* flash;
  flash = Z_Malloc ( sizeof(*flash), PU_LEVSPEC, 0);
  memset(flash, 0, sizeof(*flash));
  P_AddThinker (&flash->thinker);
  flash->sector = sector;
  flash->darktime = fastOrSlow;
  flash->brighttime = STROBEBRIGHT;
  flash->thinker.function = T_StrobeFlash;
  flash->maxlight = sector->lightlevel;
  flash->minlight = P_FindMinSurroundingLight(sector, sector->lightlevel);
  if (flash->minlight == flash->maxlight)
    flash->minlight = 0;
  sector->special &= ~31; 
  if (!inSync)
    flash->count = (P_Random(pr_lights)&7)+1;
  else
    flash->count = 1;
}
void P_SpawnStrobeFlash ( sector_t * sector , int fastOrSlow , int inSync ) { strobe_t * flash ; flash = Z_Malloc ( sizeof ( * flash ) , PU_LEVSPEC , 0 ) ; memset ( flash , 0 , sizeof ( * flash ) ) ; P_AddThinker ( & flash -> thinker ) ; flash -> sector = sector ; flash -> darktime = fastOrSlow ; flash -> brighttime = STROBEBRIGHT ; flash -> thinker . function = T_StrobeFlash ; flash -> maxlight = sector -> lightlevel ; flash -> minlight = P_FindMinSurroundingLight ( sector , sector -> lightlevel ) ; if ( flash -> minlight == flash -> maxlight ) flash -> minlight = 0 ; sector -> special &= ~ 31 ; if ( ! inSync ) flash -> count = ( P_Random ( pr_lights ) & 7 ) + 1 ; else flash -> count = 1 ; }
P_SpawnStrobeFlash
Spawns a blinking light thinker
P_SpawnStrobeFlash Spawns a blinking light thinker
// nothing special about it during gameplay //jff 3/14/98 clear non-generalized sector type