components/prboom/r_bsp.c
// killough 1/18/98 -- This function is used to fix the automap bug which
// showed lines behind closed doors simply because the door had a dropoff.
//
// cph - converted to R_RecalcLineFlags. This recalculates all the flags for
// a line, including closure and texture tiling.
killough 1/18/98 -- This function is used to fix the automap bug which
showed lines behind closed doors simply because the door had a dropoff.


killough 1 / 18 / 98 -- This function is used to fix the automap bug which showed lines behind closed doors simply because the door had a dropoff .
static void R_RecalcLineFlags(void)
{
  linedef->r_validcount = gametic;
  if (!(linedef->flags & ML_TWOSIDED)
      || backsector->ceilingheight <= frontsector->floorheight
      || backsector->floorheight >= frontsector->ceilingheight
      || (
    backsector->ceilingheight <= backsector->floorheight
    && (backsector->ceilingheight >= frontsector->ceilingheight ||
        curline->sidedef->toptexture)
    && (backsector->floorheight <= frontsector->floorheight ||
        curline->sidedef->bottomtexture)
    && (backsector->ceilingpic !=skyflatnum ||
        frontsector->ceilingpic!=skyflatnum)
    )
      )
    linedef->r_flags = RF_CLOSED;
  else {
    if (backsector->ceilingheight != frontsector->ceilingheight
  || backsector->floorheight != frontsector->floorheight
  || curline->sidedef->midtexture
  || memcmp(&backsector->floor_xoffs, &frontsector->floor_xoffs,
      sizeof(frontsector->floor_xoffs) + sizeof(frontsector->floor_yoffs) +
      sizeof(frontsector->ceiling_xoffs) + sizeof(frontsector->ceiling_yoffs) +
      sizeof(frontsector->ceilingpic) + sizeof(frontsector->floorpic) +
      sizeof(frontsector->lightlevel) + sizeof(frontsector->floorlightsec) +
      sizeof(frontsector->ceilinglightsec))) {
      linedef->r_flags = 0; return;
    } else
      linedef->r_flags = RF_IGNORE;
  }
  if (curline->sidedef->rowoffset) return;
  if (linedef->flags & ML_TWOSIDED) {
    int c;
    if ((c = frontsector->ceilingheight - backsector->ceilingheight) > 0 &&
   (textureheight[texturetranslation[curline->sidedef->toptexture]] > c))
      linedef->r_flags |= RF_TOP_TILE;
    if ((c = frontsector->floorheight - backsector->floorheight) > 0 &&
   (textureheight[texturetranslation[curline->sidedef->bottomtexture]] > c))
      linedef->r_flags |= RF_BOT_TILE;
  } else {
    int c;
    if ((c = frontsector->ceilingheight - frontsector->floorheight) > 0 &&
   (textureheight[texturetranslation[curline->sidedef->midtexture]] > c))
      linedef->r_flags |= RF_MID_TILE;
  }
}
static void R_RecalcLineFlags ( void ) { linedef -> r_validcount = gametic ; if ( ! ( linedef -> flags & ML_TWOSIDED ) || backsector -> ceilingheight <= frontsector -> floorheight || backsector -> floorheight >= frontsector -> ceilingheight || ( backsector -> ceilingheight <= backsector -> floorheight && ( backsector -> ceilingheight >= frontsector -> ceilingheight || curline -> sidedef -> toptexture ) && ( backsector -> floorheight <= frontsector -> floorheight || curline -> sidedef -> bottomtexture ) && ( backsector -> ceilingpic != skyflatnum || frontsector -> ceilingpic != skyflatnum ) ) ) linedef -> r_flags = RF_CLOSED ; else { if ( backsector -> ceilingheight != frontsector -> ceilingheight || backsector -> floorheight != frontsector -> floorheight || curline -> sidedef -> midtexture || memcmp ( & backsector -> floor_xoffs , & frontsector -> floor_xoffs , sizeof ( frontsector -> floor_xoffs ) + sizeof ( frontsector -> floor_yoffs ) + sizeof ( frontsector -> ceiling_xoffs ) + sizeof ( frontsector -> ceiling_yoffs ) + sizeof ( frontsector -> ceilingpic ) + sizeof ( frontsector -> floorpic ) + sizeof ( frontsector -> lightlevel ) + sizeof ( frontsector -> floorlightsec ) + sizeof ( frontsector -> ceilinglightsec ) ) ) { linedef -> r_flags = 0 ; return ; } else linedef -> r_flags = RF_IGNORE ; } if ( curline -> sidedef -> rowoffset ) return ; if ( linedef -> flags & ML_TWOSIDED ) { int c ; if ( ( c = frontsector -> ceilingheight - backsector -> ceilingheight ) > 0 && ( textureheight [ texturetranslation [ curline -> sidedef -> toptexture ] ] > c ) ) linedef -> r_flags |= RF_TOP_TILE ; if ( ( c = frontsector -> floorheight - backsector -> floorheight ) > 0 && ( textureheight [ texturetranslation [ curline -> sidedef -> bottomtexture ] ] > c ) ) linedef -> r_flags |= RF_BOT_TILE ; } else { int c ; if ( ( c = frontsector -> ceilingheight - frontsector -> floorheight ) > 0 && ( textureheight [ texturetranslation [ curline -> sidedef -> midtexture ] ] > c ) ) linedef -> r_flags |= RF_MID_TILE ; } }
killough 1/18/98 -- This function is used to fix the automap bug which
showed lines behind closed doors simply because the door had a dropoff.
killough 1 / 18 / 98 -- This function is used to fix the automap bug which showed lines behind closed doors simply because the door had a dropoff .
/* First decide if the line is closed, normal, or invisible */ // if door is closed because back is shut: // preserve a kind of transparent door/lift special effect: // properly render skies (consider door "open" if both ceilings are sky): // Reject empty lines used for triggers //  and special events. // Identical floor and ceiling on both sides, // identical light levels on both sides, // and no middle texture. // CPhipps - recode for speed, not certain if this is portable though /* cph - I'm too lazy to try and work with offsets in this */ /* Now decide on texture tiling */ /* Does top texture need tiling */ /* Does bottom texture need tiling */ /* Does middle texture need tiling */