Пример #1
0
//
// Add_Scroller
//
// Add a generalized scroller to the thinker list.
//
// type: the enumerated type of scrolling: floor, ceiling, floor carrier,
//   wall, floor carrier & scroller
//
// (dx,dy): the direction and speed of the scrolling or its acceleration
//
// control: the sector whose heights control this scroller's effect
//   remotely, or -1 if no control sector
//
// affectee: the index of the affected object (sector or sidedef)
//
// accel: non-zero if this is an accelerative effect
//
void Add_Scroller(int type, fixed_t dx, fixed_t dy,
                  int control, int affectee, int accel, bool overridescroller)
{
   ScrollThinker *s = new ScrollThinker;

   s->type = type;
   s->dx = dx;
   s->dy = dy;
   s->accel = accel;
   s->vdx = s->vdy = 0;

   if((s->control = control) != -1)
      s->last_height =
       sectors[control].floorheight + sectors[control].ceilingheight;

   s->affectee = affectee;

   if(type != ScrollThinker::sc_side)
   {
      if(overridescroller)
         EV_stopFlatScrollerBySecnum(type, affectee);
      s->addScroller();
   }

   s->addThinker();
}
Пример #2
0
//
// Stop a scroller based on sector number
//
static bool EV_stopFlatScrollerBySecnum(int type, int secnum)
{
   if(!scrollers)
      return false;

   // search the scrolled sectors
   scrollerlist_t *sl = scrollers;
   while(sl)
   {
      ScrollThinker *scroller = sl->scroller;
      sl = sl->next; // MUST do this here or bad things happen
      if(scroller->affectee == secnum && scroller->type == type)
         scroller->removeScroller();
   }

   return true;
}
Пример #3
0
//
// Add_Scroller
//
// Add a generalized scroller to the thinker list.
//
// type: the enumerated type of scrolling: floor, ceiling, floor carrier,
//   wall, floor carrier & scroller
//
// (dx,dy): the direction and speed of the scrolling or its acceleration
//
// control: the sector whose heights control this scroller's effect
//   remotely, or -1 if no control sector
//
// affectee: the index of the affected object (sector or sidedef)
//
// accel: non-zero if this is an accelerative effect
//
void Add_Scroller(int type, fixed_t dx, fixed_t dy,
                  int control, int affectee, int accel)
{
    ScrollThinker *s = new ScrollThinker;

    s->type = type;
    s->dx = dx;
    s->dy = dy;
    s->accel = accel;
    s->vdx = s->vdy = 0;

    if((s->control = control) != -1)
        s->last_height =
            sectors[control].floorheight + sectors[control].ceilingheight;

    s->affectee = affectee;
    s->addThinker();
}