components/prboom/p_lights.c
//
// T_Glow()
//
// Glowing light action routine, called once per tick
//
// Passed a glow_t structure containing light levels and timing
// Returns nothing
//
T_Glow()
Glowing light action routine, called once per tick

Passed a glow_t structure containing light levels and timing
Returns nothing
T_Glow () Glowing light action routine called once per tick Passed a glow_t structure containing light levels and timing Returns nothing
void T_Glow(glow_t* g)
{
  switch(g->direction)
  {
    case -1:
      g->sector->lightlevel -= GLOWSPEED;
      if (g->sector->lightlevel <= g->minlight)
      {
        g->sector->lightlevel += GLOWSPEED;
        g->direction = 1;
      }
      break;
    case 1:
      g->sector->lightlevel += GLOWSPEED;
      if (g->sector->lightlevel >= g->maxlight)
      {
        g->sector->lightlevel -= GLOWSPEED;
        g->direction = -1;
      }
      break;
  }
}
void T_Glow ( glow_t * g ) { switch ( g -> direction ) { case -1 : g -> sector -> lightlevel -= GLOWSPEED ; if ( g -> sector -> lightlevel <= g -> minlight ) { g -> sector -> lightlevel += GLOWSPEED ; g -> direction = 1 ; } break ; case 1 : g -> sector -> lightlevel += GLOWSPEED ; if ( g -> sector -> lightlevel >= g -> maxlight ) { g -> sector -> lightlevel -= GLOWSPEED ; g -> direction = -1 ; } break ; } }
T_Glow()
Glowing light action routine, called once per tick
T_Glow () Glowing light action routine called once per tick
// light dims // light brightens