Skip to content

Commit

Permalink
World|Sector: Non-drawable materials classify for "missing texture" m…
Browse files Browse the repository at this point in the history
…ap hacks

The first texture defined in the TEXTURE1/2 lump of the IWAD is never
drawn by the original software renderer due to a resource management
quirk. Some mods take advantage of this behavior by applying it to
missing texture map hacks instead of omitting a texture.
  • Loading branch information
danij-deng committed Sep 22, 2013
1 parent 3477936 commit a38943b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
14 changes: 13 additions & 1 deletion doomsday/client/include/world/surface.h
Expand Up @@ -172,12 +172,24 @@ class Surface : public de::MapElement
* Convenient helper method for determining whether a sky-masked material
* is bound to the surface.
*
* @return @c true iff a sky-masked material is bound; otherwise @c 0.
* @return @c true iff a sky-masked material is bound.
*/
inline bool hasSkyMaskedMaterial() const {
return hasMaterial() && material().isSkyMasked();
}

/**
* Convenient helper method for determining whether a drawable, non @em fix
* material is bound to the surface.
*
* @return @c true iff drawable, non @em fix masked material is bound.
*
* @see hasMaterial(), hasFixMaterial(), Material::isDrawable()
*/
inline bool hasDrawableNonFixMaterial() const {
return hasMaterial() && !hasFixMaterial() && material().isDrawable();
}

/**
* Returns the attributed material of the surface.
*
Expand Down
8 changes: 4 additions & 4 deletions doomsday/client/src/world/sectorcluster.cpp
Expand Up @@ -290,24 +290,24 @@ DENG2_OBSERVES(Plane, HeightChange)

flags &= ~AllSelfRef;

if(frontSide.bottom().hasMaterial() && !frontSide.bottom().hasFixMaterial())
if(frontSide.bottom().hasDrawableNonFixMaterial())
{
flags &= ~AllMissingBottom;
}

if(frontSide.top().hasMaterial() && !frontSide.top().hasFixMaterial())
if(frontSide.top().hasDrawableNonFixMaterial())
{
flags &= ~AllMissingTop;
}

if(backCluster->floor().height() < self.sector().floor().height() &&
backSide.bottom().hasMaterial() && !backSide.bottom().hasFixMaterial())
backSide.bottom().hasDrawableNonFixMaterial())
{
flags &= ~AllMissingBottom;
}

if(backCluster->ceiling().height() > self.sector().ceiling().height() &&
backSide.top().hasMaterial() && !backSide.top().hasFixMaterial())
backSide.top().hasDrawableNonFixMaterial())
{
flags &= ~AllMissingTop;
}
Expand Down

0 comments on commit a38943b

Please sign in to comment.