components/prboom/p_spec.c
// Adds wall scroller. Scroll amount is rotated with respect to wall's
// linedef first, so that scrolling towards the wall in a perpendicular
// direction is translated into vertical motion, while scrolling along
// the wall in a parallel direction is translated into horizontal motion.
//
// killough 5/25/98: cleaned up arithmetic to avoid drift due to roundoff
//
// killough 10/98:
// fix scrolling aliasing problems, caused by long linedefs causing overflowing
Adds wall scroller. Scroll amount is rotated with respect to wall's
linedef first, so that scrolling towards the wall in a perpendicular
direction is translated into vertical motion, while scrolling along
the wall in a parallel direction is translated into horizontal motion.

killough 5/25/98: cleaned up arithmetic to avoid drift due to roundoff

killough 10/98:
fix scrolling aliasing problems, caused by long linedefs causing overflowing
Adds wall scroller . Scroll amount is rotated with respect to wall ' s linedef first so that scrolling towards the wall in a perpendicular direction is translated into vertical motion while scrolling along the wall in a parallel direction is translated into horizontal motion . killough 5 / 25 / 98 : cleaned up arithmetic to avoid drift due to roundoff killough 10 / 98 : fix scrolling aliasing problems caused by long linedefs causing overflowing
static void Add_WallScroller(fixed_t dx, fixed_t dy, const line_t *l,
                             int control, int accel)
{
  fixed_t x = D_abs(l->dx), y = D_abs(l->dy), d;
  if (y > x)
    d = x, x = y, y = d;
  d = FixedDiv(x, finesine[(tantoangle[FixedDiv(y,x) >> DBITS] + ANG90)
                          >> ANGLETOFINESHIFT]);
  if (compatibility_level >= lxdoom_1_compatibility) {
    x = (fixed_t)(((int_64_t)dy * -(int_64_t)l->dy - (int_64_t)dx * (int_64_t)l->dx) / (int_64_t)d);  
    y = (fixed_t)(((int_64_t)dy * (int_64_t)l->dx - (int_64_t)dx * (int_64_t)l->dy) / (int_64_t)d);   
  } else {
    x = -FixedDiv(FixedMul(dy, l->dy) + FixedMul(dx, l->dx), d);
    y = -FixedDiv(FixedMul(dx, l->dy) - FixedMul(dy, l->dx), d);
  }
  Add_Scroller(sc_side, x, y, control, *l->sidenum, accel);
}
static void Add_WallScroller ( fixed_t dx , fixed_t dy , const line_t * l , int control , int accel ) { fixed_t x = D_abs ( l -> dx ) , y = D_abs ( l -> dy ) , d ; if ( y > x ) d = x , x = y , y = d ; d = FixedDiv ( x , finesine [ ( tantoangle [ FixedDiv ( y , x ) >> DBITS ] + ANG90 ) >> ANGLETOFINESHIFT ] ) ; if ( compatibility_level >= lxdoom_1_compatibility ) { x = ( fixed_t ) ( ( ( int_64_t ) dy * - ( int_64_t ) l -> dy - ( int_64_t ) dx * ( int_64_t ) l -> dx ) / ( int_64_t ) d ) ; y = ( fixed_t ) ( ( ( int_64_t ) dy * ( int_64_t ) l -> dx - ( int_64_t ) dx * ( int_64_t ) l -> dy ) / ( int_64_t ) d ) ; } else { x = - FixedDiv ( FixedMul ( dy , l -> dy ) + FixedMul ( dx , l -> dx ) , d ) ; y = - FixedDiv ( FixedMul ( dx , l -> dy ) - FixedMul ( dy , l -> dx ) , d ) ; } Add_Scroller ( sc_side , x , y , control , * l -> sidenum , accel ) ; }
Adds wall scroller.
Adds wall scroller .
// CPhipps - Import scroller calc overflow fix, compatibility optioned // killough 10/98: // Use long long arithmetic