Browse Source

Draw lava, slime and teleporters as liquids, but not transparent.

master
Nico de Poel 3 years ago
parent
commit
9f1ed1f35f
  1. 6
      main.cpp
  2. 2
      ps1bsp.h

6
main.cpp

@ -156,7 +156,11 @@ int process_faces(const world_t* world, const std::vector<ps1bsp_texture_t>& tex
// Draw water as fullbright transparent surfaces
if (miptex->name[0] == '*')
{
outFace->flags |= SURF_DRAWTURB | SURF_DRAWWATER;
// Detect special liquid types that should not be transparent
if (strncmp(miptex->name, "*lava", 5) && strncmp(miptex->name, "*slime", 6) && strncmp(miptex->name, "*tele", 5))
outFace->flags |= SURF_DRAWWATER;
outFace->flags |= SURF_DRAWLIQUID;
}
auto polygons = tesselator.tesselateFace(face);

2
ps1bsp.h

@ -85,7 +85,7 @@ typedef struct
} ps1bsp_facevertex_t;
#define SURF_DRAWSKY 0x2
#define SURF_DRAWTURB 0x4
#define SURF_DRAWLIQUID 0x4
#define SURF_DRAWWATER 0x8
// High quality: Face -> polygons -> polygon vertex indices (index + UV + light) -> vertices

Loading…
Cancel
Save