qbsp: remove dead code contents_are_mirrored()

This commit is contained in:
Eric Wasylishen 2023-05-28 11:43:30 -06:00
parent 31ab43a181
commit ed7a684583
3 changed files with 2 additions and 53 deletions

View File

@ -494,18 +494,6 @@ public:
return bits.detail && bits.mist;
}
bool contents_are_mirrored(const contentflags_t &contents) const override
{
const auto bits = contentflags_to_bits(contents);
if (bits.mirror_inside)
return true;
const auto visible = bits.visible_contents();
// If the brush is non-solid, mirror faces for the inside view
return visible.water || visible.slime || visible.lava;
}
bool contents_are_origin(const contentflags_t &contents) const override
{
// fixme-brushbsp: document whether this is an exclusive test (i.e. what does it return for water|origin)
@ -1129,19 +1117,6 @@ struct gamedef_q2_t : public gamedef_t
return ((contents.native & mist1_type) == mist1_type) || ((contents.native & mist2_type) == mist2_type);
}
bool contents_are_mirrored(const contentflags_t &contents) const override
{
// if we have mirrorinside set, go ahead
if (contents.mirror_inside.has_value())
return contents.mirror_inside.value();
// Q2 is a bit different here. in vanilla tools,
// every content except SOLID and WINDOW is implicitly mirrorinside.
// the only exception is that 4bsp has the unused AUX
// contents to default to not mirroring the insides.
return !(contents.native & (Q2_CONTENTS_SOLID | Q2_CONTENTS_AUX));
}
bool contents_are_origin(const contentflags_t &contents) const override
{
return contents.native & Q2_CONTENTS_ORIGIN;
@ -1867,11 +1842,6 @@ bool contentflags_t::is_detail_illusionary(const gamedef_t *game) const
return game->contents_are_detail_illusionary(*this);
}
bool contentflags_t::is_mirrored(const gamedef_t *game) const
{
return game->contents_are_mirrored(*this);
}
contentflags_t &contentflags_t::set_mirrored(const std::optional<bool> &mirror_inside_value)
{
mirror_inside = mirror_inside_value;
@ -1943,9 +1913,8 @@ std::string contentflags_t::to_string(const gamedef_t *game) const
{
std::string s = game->get_contents_display(*this);
if (contentflags_t{native}.is_mirrored(game) != is_mirrored(game)) {
s += fmt::format(
" | MIRROR_INSIDE[{}]", mirror_inside.has_value() ? (mirror_inside.value() ? "true" : "false") : "nullopt");
if (mirror_inside != std::nullopt) {
s += fmt::format(" | MIRROR_INSIDE[{}]", mirror_inside.value() ? "true" : "false");
}
if (contentflags_t{native}.will_clip_same_type(game) != will_clip_same_type(game)) {

View File

@ -115,7 +115,6 @@ struct contentflags_t
bool is_detail_fence(const gamedef_t *game) const;
bool is_detail_illusionary(const gamedef_t *game) const;
bool is_mirrored(const gamedef_t *game) const;
contentflags_t &set_mirrored(const std::optional<bool> &mirror_inside_value);
inline bool will_clip_same_type(const gamedef_t *game) const { return will_clip_same_type(game, *this); }
@ -314,7 +313,6 @@ struct gamedef_t
virtual bool contents_are_detail_wall(const contentflags_t &contents) const = 0;
virtual bool contents_are_detail_fence(const contentflags_t &contents) const = 0;
virtual bool contents_are_detail_illusionary(const contentflags_t &contents) const = 0;
virtual bool contents_are_mirrored(const contentflags_t &contents) const = 0;
virtual bool contents_are_origin(const contentflags_t &contents) const = 0;
virtual bool contents_are_clip(const contentflags_t &contents) const = 0;
virtual bool contents_are_empty(const contentflags_t &contents) const = 0;

View File

@ -473,24 +473,6 @@ static std::unique_ptr<face_t> FaceFromPortal(portal_t *p, bool pside)
f->portal = p;
f->original_side = side->source;
#if 0
bool make_face =
qbsp_options.target_game->directional_visible_contents(p->nodes[pside]->contents, p->nodes[!pside]->contents);
if (!make_face) {
// content type / game rules requested to skip generating a face on this side
return nullptr;
}
if (!p->nodes[pside]->contents.is_empty(qbsp_options.target_game)) {
bool our_contents_mirrorinside = qbsp_options.target_game->contents_are_mirrored(p->nodes[pside]->contents);
if (!our_contents_mirrorinside) {
if (side->plane_flipped != pside) {
return nullptr;
}
}
}
#endif
if (pside) {
f->w = p->winding.flip();
} else {