Ejemplo n.º 1
0
void P_RunEffects(void)
{
   int snum = 0;
   Thinker *th = &thinkercap;

   if(camera)
   {
      subsector_t *ss = R_PointInSubsector(camera->x, camera->y);
      snum = (ss->sector - sectors) * numsectors;
   }
   else
   {
      subsector_t *ss = players[displayplayer].mo->subsector;
      snum = (ss->sector - sectors) * numsectors;
   }

   while((th = th->next) != &thinkercap)
   {
      Mobj *mobj;
      if((mobj = thinker_cast<Mobj *>(th)))
      {
         int rnum = snum + (mobj->subsector->sector - sectors);
         if(mobj->effects)
         {
            // run only if possibly visible
            if(!(rejectmatrix[rnum>>3] & (1<<(rnum&7))))
               P_RunEffect(mobj, mobj->effects);
         }
      }
   }
Ejemplo n.º 2
0
//
// P_RunEffects
//
// Run effects on all actors in the world
//
void P_RunEffects (FLevelLocals *Level)
{
	AActor *actor;
	auto iterator = Level->GetThinkerIterator<AActor>();

	while ( (actor = iterator.Next ()) )
	{
		if (actor->effects || actor->fountaincolor)
		{
			P_RunEffect (actor, actor->effects);
		}
	}
}