components/prboom/r_segs.c
//
// R_ScaleFromGlobalAngle
// Returns the texture mapping scale
//  for the current line (horizontal span)
//  at the given angle.
// rw_distance must be calculated first.
//
// killough 5/2/98: reformatted, cleaned up
// CPhipps - moved here from r_main.c
R_ScaleFromGlobalAngle
Returns the texture mapping scale
for the current line (horizontal span)
at the given angle.
rw_distance must be calculated first.

killough 5/2/98: reformatted, cleaned up
CPhipps - moved here from r_main.c
R_ScaleFromGlobalAngle Returns the texture mapping scale for the current line ( horizontal span ) at the given angle . rw_distance must be calculated first . killough 5 / 2 / 98 : reformatted cleaned up CPhipps - moved here from r_main . c
static fixed_t R_ScaleFromGlobalAngle(angle_t visangle)
{
  int     anglea = ANG90 + (visangle-viewangle);
  int     angleb = ANG90 + (visangle-rw_normalangle);
  int     den = FixedMul(rw_distance, finesine[anglea>>ANGLETOFINESHIFT]);
  fixed_t num = FixedMul(projectiony, finesine[angleb>>ANGLETOFINESHIFT]);
  return den > num>>16 ? (num = FixedDiv(num, den)) > 64*FRACUNIT ?
    64*FRACUNIT : num < 256 ? 256 : num : 64*FRACUNIT;
}
static fixed_t R_ScaleFromGlobalAngle ( angle_t visangle ) { int anglea = ANG90 + ( visangle - viewangle ) ; int angleb = ANG90 + ( visangle - rw_normalangle ) ; int den = FixedMul ( rw_distance , finesine [ anglea >> ANGLETOFINESHIFT ] ) ; fixed_t num = FixedMul ( projectiony , finesine [ angleb >> ANGLETOFINESHIFT ] ) ; return den > num >> 16 ? ( num = FixedDiv ( num , den ) ) > 64 * FRACUNIT ? 64 * FRACUNIT : num < 256 ? 256 : num : 64 * FRACUNIT ; }
R_ScaleFromGlobalAngle
Returns the texture mapping scale
for the current line (horizontal span)
at the given angle.
R_ScaleFromGlobalAngle Returns the texture mapping scale for the current line ( horizontal span ) at the given angle .
// proff 11/06/98: Changed for high-res