예제 #1
0
파일: p_tick.c 프로젝트: mdgunn/doomretro
//
// P_RunThinkers
//
// killough 4/25/98:
//
// Fix deallocator to stop using "next" pointer after node has been freed
// (a DOOM bug).
//
// Process each thinker. For thinkers which are marked deleted, we must
// load the "next" pointer prior to freeing the node. In DOOM, the "next"
// pointer was loaded AFTER the thinker was freed, which could have caused
// crashes.
//
// But if we are not deleting the thinker, we should reload the "next"
// pointer after calling the function, in case additional thinkers are
// added at the end of the list.
//
// killough 11/98:
//
// Rewritten to delete nodes implicitly, by making currentthinker
// external and using P_RemoveThinkerDelayed() implicitly.
//
static void P_RunThinkers(void)
{
    currentthinker = thinkercap.next;

    while (currentthinker != &thinkercap)
    {
        if (currentthinker->function)
            currentthinker->function(currentthinker);
        currentthinker = currentthinker->next;
    }

    // Dedicated thinkers
    T_MAPMusic();
}
예제 #2
0
파일: p_tick.c 프로젝트: TheMatthew/DoomUst
static void P_RunThinkers (void)
{
  for (currentthinker = thinkercap.next;
       currentthinker != &thinkercap;
       currentthinker = currentthinker->next)
  {
    if (newthinkerpresent)
      R_ActivateThinkerInterpolations(currentthinker);
    if (currentthinker->function)
      currentthinker->function(currentthinker);
  }
  newthinkerpresent = false;

  // Dedicated thinkers
  T_MAPMusic();
}