From 873e0b8a35f4327ebd24d3370df815671b069f1a Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Tue, 3 Oct 2017 14:42:19 -0600 Subject: [PATCH] common: Face_IsLightmapped: q2 support --- common/bsputils.cc | 10 ++++++++-- include/common/bspfile.hh | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/common/bsputils.cc b/common/bsputils.cc index 7c044e82..dcb1de2b 100644 --- a/common/bsputils.cc +++ b/common/bsputils.cc @@ -152,8 +152,14 @@ bool Face_IsLightmapped(const mbsp_t *bsp, const bsp2_dface_t *face) if (texinfo == nullptr) return false; - if (texinfo->flags & TEX_SPECIAL) - return false; + if (bsp->loadversion == Q2_BSPVERSION) { + if (texinfo->flags & (Q2_SURF_WARP|Q2_SURF_SKY)) { + return false; + } + } else { + if (texinfo->flags & TEX_SPECIAL) + return false; + } return true; } diff --git a/include/common/bspfile.hh b/include/common/bspfile.hh index 5d0687d0..4a276760 100644 --- a/include/common/bspfile.hh +++ b/include/common/bspfile.hh @@ -297,6 +297,21 @@ typedef struct { #define TEX_MINLIGHT_COLOR_B_MASK (255ULL << TEX_MINLIGHT_COLOR_B_SHIFT) /* 8 bit value, blue minlight color for this face. */ #define TEX_NOSHADOW (1ULL << 44) /* don't cast a shadow */ +// Q2 Texture flags. +#define Q2_SURF_LIGHT 0x1 // value will hold the light strength + +#define Q2_SURF_SLICK 0x2 // effects game physics + +#define Q2_SURF_SKY 0x4 // don't draw, but add to skybox +#define Q2_SURF_WARP 0x8 // turbulent water warp +#define Q2_SURF_TRANS33 0x10 +#define Q2_SURF_TRANS66 0x20 +#define Q2_SURF_FLOWING 0x40 // scroll towards angle +#define Q2_SURF_NODRAW 0x80 // don't bother referencing the texture + +#define Q2_SURF_HINT 0x100 // make a primary bsp splitter +#define Q2_SURF_SKIP 0x200 // completely ignore, allowing non-closed brushes + /* * Note that edge 0 is never used, because negative edge nums are used for * counterclockwise use of the edge in a face