qbsp: experimental func_illusionary_visblocker
This commit is contained in:
parent
abf2a3665b
commit
2ea0076160
|
|
@ -110,6 +110,7 @@
|
||||||
#define CONTENTS_DETAIL -10 /* compiler internal use only */
|
#define CONTENTS_DETAIL -10 /* compiler internal use only */
|
||||||
#define CONTENTS_DETAIL_ILLUSIONARY -11 /* compiler internal use only */
|
#define CONTENTS_DETAIL_ILLUSIONARY -11 /* compiler internal use only */
|
||||||
#define CONTENTS_DETAIL_FENCE -12 /* compiler internal use only */
|
#define CONTENTS_DETAIL_FENCE -12 /* compiler internal use only */
|
||||||
|
#define CONTENTS_ILLUSIONARY_VISBLOCKER -13
|
||||||
|
|
||||||
// Special contents flags for the compiler only
|
// Special contents flags for the compiler only
|
||||||
#define CFLAGS_STRUCTURAL_COVERED_BY_DETAIL (1U << 0)
|
#define CFLAGS_STRUCTURAL_COVERED_BY_DETAIL (1U << 0)
|
||||||
|
|
|
||||||
|
|
@ -1122,11 +1122,18 @@ Brush_LoadEntity(mapentity_t *dst, const mapentity_t *src, const int hullnum)
|
||||||
if (atoi(ValueForKey(src, "_mirrorinside"))) {
|
if (atoi(ValueForKey(src, "_mirrorinside"))) {
|
||||||
cflags |= CFLAGS_BMODEL_MIRROR_INSIDE;
|
cflags |= CFLAGS_BMODEL_MIRROR_INSIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool func_illusionary_visblocker =
|
||||||
|
(0 == Q_strcasecmp(classname, "func_illusionary_visblocker"));
|
||||||
|
|
||||||
for (i = 0; i < src->nummapbrushes; i++, mapbrush++) {
|
for (i = 0; i < src->nummapbrushes; i++, mapbrush++) {
|
||||||
mapbrush = &src->mapbrush(i);
|
mapbrush = &src->mapbrush(i);
|
||||||
contents = Brush_GetContents(mapbrush);
|
contents = Brush_GetContents(mapbrush);
|
||||||
|
|
||||||
|
/* FIXME: move into Brush_GetContents? */
|
||||||
|
if (func_illusionary_visblocker)
|
||||||
|
contents = CONTENTS_ILLUSIONARY_VISBLOCKER;
|
||||||
|
|
||||||
/* "origin" brushes always discarded */
|
/* "origin" brushes always discarded */
|
||||||
if (contents == CONTENTS_ORIGIN)
|
if (contents == CONTENTS_ORIGIN)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -1730,6 +1730,8 @@ IsWorldBrushEntity(const mapentity_t *entity)
|
||||||
return true;
|
return true;
|
||||||
if (!Q_strcasecmp(classname, "func_detail_fence"))
|
if (!Q_strcasecmp(classname, "func_detail_fence"))
|
||||||
return true;
|
return true;
|
||||||
|
if (!Q_strcasecmp(classname, "func_illusionary_visblocker"))
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,10 @@ PortalThru(const portal_t *p)
|
||||||
if (contents0 == CONTENTS_SOLID || contents1 == CONTENTS_SOLID)
|
if (contents0 == CONTENTS_SOLID || contents1 == CONTENTS_SOLID)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* Can't see through func_illisionary_visblocker */
|
||||||
|
if (contents0 == CONTENTS_ILLUSIONARY_VISBLOCKER || contents1 == CONTENTS_ILLUSIONARY_VISBLOCKER)
|
||||||
|
return false;
|
||||||
|
|
||||||
/* If contents values are the same and not solid, can see through */
|
/* If contents values are the same and not solid, can see through */
|
||||||
if (contents0 == contents1)
|
if (contents0 == contents1)
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ int splitnodes;
|
||||||
static int leaffaces;
|
static int leaffaces;
|
||||||
static int nodefaces;
|
static int nodefaces;
|
||||||
static int c_solid, c_empty, c_water, c_detail, c_detail_illusionary, c_detail_fence;
|
static int c_solid, c_empty, c_water, c_detail, c_detail_illusionary, c_detail_fence;
|
||||||
|
static int c_illusionary_visblocker;
|
||||||
static bool usemidsplit;
|
static bool usemidsplit;
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
@ -746,6 +747,9 @@ GetContentsName( int Contents ) {
|
||||||
case CONTENTS_DETAIL_FENCE:
|
case CONTENTS_DETAIL_FENCE:
|
||||||
return "DetailFence";
|
return "DetailFence";
|
||||||
|
|
||||||
|
case CONTENTS_ILLUSIONARY_VISBLOCKER:
|
||||||
|
return "IllusionaryVisblocker";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return "Error";
|
return "Error";
|
||||||
}
|
}
|
||||||
|
|
@ -767,7 +771,8 @@ int Contents_Priority(int contents)
|
||||||
case CONTENTS_WATER: return 2;
|
case CONTENTS_WATER: return 2;
|
||||||
case CONTENTS_SLIME: return 2;
|
case CONTENTS_SLIME: return 2;
|
||||||
case CONTENTS_LAVA: return 2;
|
case CONTENTS_LAVA: return 2;
|
||||||
|
case CONTENTS_ILLUSIONARY_VISBLOCKER: return 2;
|
||||||
|
|
||||||
case CONTENTS_EMPTY: return 1;
|
case CONTENTS_EMPTY: return 1;
|
||||||
case 0: return 0;
|
case 0: return 0;
|
||||||
|
|
||||||
|
|
@ -846,6 +851,9 @@ LinkConvexFaces(surface_t *planelist, node_t *leafnode)
|
||||||
case CONTENTS_DETAIL_FENCE:
|
case CONTENTS_DETAIL_FENCE:
|
||||||
c_detail_fence++;
|
c_detail_fence++;
|
||||||
break;
|
break;
|
||||||
|
case CONTENTS_ILLUSIONARY_VISBLOCKER:
|
||||||
|
c_illusionary_visblocker++;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
Error("Bad contents in face (%s)", __func__);
|
Error("Bad contents in face (%s)", __func__);
|
||||||
}
|
}
|
||||||
|
|
@ -1035,6 +1043,7 @@ SolidBSP(const mapentity_t *entity, surface_t *surfhead, bool midsplit)
|
||||||
c_detail = 0;
|
c_detail = 0;
|
||||||
c_detail_illusionary = 0;
|
c_detail_illusionary = 0;
|
||||||
c_detail_fence = 0;
|
c_detail_fence = 0;
|
||||||
|
c_illusionary_visblocker = 0;
|
||||||
|
|
||||||
PartitionSurfaces(surfhead, headnode);
|
PartitionSurfaces(surfhead, headnode);
|
||||||
|
|
||||||
|
|
@ -1045,6 +1054,7 @@ SolidBSP(const mapentity_t *entity, surface_t *surfhead, bool midsplit)
|
||||||
Message(msgStat, "%8d detail leafs", c_detail);
|
Message(msgStat, "%8d detail leafs", c_detail);
|
||||||
Message(msgStat, "%8d detail illusionary leafs", c_detail_illusionary);
|
Message(msgStat, "%8d detail illusionary leafs", c_detail_illusionary);
|
||||||
Message(msgStat, "%8d detail fence leafs", c_detail_fence);
|
Message(msgStat, "%8d detail fence leafs", c_detail_fence);
|
||||||
|
Message(msgStat, "%8d illusionary visblocker leafs", c_illusionary_visblocker);
|
||||||
Message(msgStat, "%8d leaffaces", leaffaces);
|
Message(msgStat, "%8d leaffaces", leaffaces);
|
||||||
Message(msgStat, "%8d nodefaces", nodefaces);
|
Message(msgStat, "%8d nodefaces", nodefaces);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,9 @@ RemapContentsForExport(int content)
|
||||||
*/
|
*/
|
||||||
return CONTENTS_SOLID;
|
return CONTENTS_SOLID;
|
||||||
}
|
}
|
||||||
|
if (content == CONTENTS_ILLUSIONARY_VISBLOCKER) {
|
||||||
|
return CONTENTS_EMPTY;
|
||||||
|
}
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue