components/prboom/p_spec.c
//
// P_FindShortestUpperAround()
//
// Passed a sector number, returns the shortest upper texture on a
// linedef bounding the sector.
//
// Note: If no upper texture exists 32000*FRACUNIT is returned.
//       but if compatibility then INT_MAX is returned
//
// jff 03/20/98 Add routine to find shortest upper texture
//
P_FindShortestUpperAround()
Passed a sector number, returns the shortest upper texture on a
linedef bounding the sector.

If no upper texture exists 32000*FRACUNIT is returned.
but if compatibility then INT_MAX is returned

jff 03/20/98 Add routine to find shortest upper texture
P_FindShortestUpperAround () Passed a sector number returns the shortest upper texture on a linedef bounding the sector . If no upper texture exists 32000 * FRACUNIT is returned . but if compatibility then INT_MAX is returned jff 03 / 20 / 98 Add routine to find shortest upper texture
fixed_t P_FindShortestUpperAround(int secnum)
{
  int minsize = INT_MAX;
  side_t*     side;
  int i;
  sector_t *sec = &sectors[secnum];
  if (!comp[comp_model])
    minsize = 32000<<FRACBITS; 
  for (i = 0; i < sec->linecount; i++)
  {
    if (twoSided(secnum, i))
    {
      side = getSide(secnum,i,0);
      if (side->toptexture > 0)     
        if (textureheight[side->toptexture] < minsize)
          minsize = textureheight[side->toptexture];
      side = getSide(secnum,i,1);
      if (side->toptexture > 0)     
        if (textureheight[side->toptexture] < minsize)
          minsize = textureheight[side->toptexture];
    }
  }
  return minsize;
}
fixed_t P_FindShortestUpperAround ( int secnum ) { int minsize = INT_MAX ; side_t * side ; int i ; sector_t * sec = & sectors [ secnum ] ; if ( ! comp [ comp_model ] ) minsize = 32000 << FRACBITS ; for ( i = 0 ; i < sec -> linecount ; i ++ ) { if ( twoSided ( secnum , i ) ) { side = getSide ( secnum , i , 0 ) ; if ( side -> toptexture > 0 ) if ( textureheight [ side -> toptexture ] < minsize ) minsize = textureheight [ side -> toptexture ] ; side = getSide ( secnum , i , 1 ) ; if ( side -> toptexture > 0 ) if ( textureheight [ side -> toptexture ] < minsize ) minsize = textureheight [ side -> toptexture ] ; } } return minsize ; }
P_FindShortestUpperAround()
Passed a sector number, returns the shortest upper texture on a
linedef bounding the sector.
P_FindShortestUpperAround () Passed a sector number returns the shortest upper texture on a linedef bounding the sector .
//jff 3/13/98 prevent overflow // in height calcs //jff 8/14/98 texture 0 is a placeholder //jff 8/14/98 texture 0 is a placeholder