Beispiel #1
0
//
// R_SolidLineSeg
//
// [SL] Check for single-sided line, closed doors or other scenarios that
// would make this line seg solid.
//
// This fixes the automap floor height bug -- killough 1/18/98:
// killough 4/7/98: optimize: save result in doorclosed for use in r_segs.c
//
static bool R_SolidLineSeg(const seg_t* segline, const wall_t* wall)
{
	// TODO: remove use of global frontsector & backsector
	return !backsector
		|| !(segline->linedef->flags & ML_TWOSIDED)
		|| (wall->backc1.z <= wall->frontf1.z && wall->backc2.z <= wall->frontf2.z)
		|| (wall->backf1.z >= wall->frontc1.z && wall->backf2.z >= wall->frontc2.z)

		// if door is closed because back is shut:
		|| ((wall->backc1.z <= wall->backf1.z && wall->backc2.z <= wall->backf2.z) &&
			// preserve a kind of transparent door/lift special effect:
			((wall->backc1.z >= wall->frontc1.z && wall->backc2.z >= wall->frontc2.z) ||
			  segline->sidedef->toptexture != TextureManager::NO_TEXTURE_HANDLE) &&
		
			((wall->backf1.z <= wall->frontf1.z && wall->backf2.z <= wall->frontf2.z) ||
			  segline->sidedef->bottomtexture != TextureManager::NO_TEXTURE_HANDLE) &&

			// properly render skies (consider door "open" if both ceilings are sky):
			(!R_IsSkyFlat(frontsector->ceiling_texhandle) || !R_IsSkyFlat(backsector->ceiling_texhandle)));
}
Beispiel #2
0
//
// P_SetSectorCeilingPic
//
// haleyjd 08/30/09: Call this routine to set a sector's ceiling pic.
//
void P_SetSectorCeilingPic(sector_t *sector, int pic)
{
   // clear sky flag
   sector->intflags &= ~SIF_SKY;

   sector->ceilingpic = pic;

   // reset the sky flag
   if(R_IsSkyFlat(sector->ceilingpic))
      sector->intflags |= SIF_SKY;
}