cleanup: rename surfflags_t::is_skip to is_nodraw
This is a break to the .json format
This commit is contained in:
parent
addf621074
commit
acf334daee
|
|
@ -164,7 +164,7 @@ struct surfflags_t
|
||||||
int32_t native;
|
int32_t native;
|
||||||
|
|
||||||
// an invisible surface (Q1 "skip" texture, Q2 SURF_NODRAW)
|
// an invisible surface (Q1 "skip" texture, Q2 SURF_NODRAW)
|
||||||
bool is_skip;
|
bool is_nodraw;
|
||||||
|
|
||||||
// completely ignore, allowing non-closed brushes (Q2 SURF_SKIP)
|
// completely ignore, allowing non-closed brushes (Q2 SURF_SKIP)
|
||||||
bool is_hintskip;
|
bool is_hintskip;
|
||||||
|
|
@ -220,7 +220,7 @@ struct surfflags_t
|
||||||
private:
|
private:
|
||||||
constexpr auto as_tuple() const
|
constexpr auto as_tuple() const
|
||||||
{
|
{
|
||||||
return std::tie(native, is_skip, is_hintskip, is_hint, no_dirt, no_shadow, no_bounce, no_minlight, no_expand,
|
return std::tie(native, is_nodraw, is_hintskip, is_hint, no_dirt, no_shadow, no_bounce, no_minlight, no_expand,
|
||||||
light_ignore, phong_angle, phong_angle_concave, minlight, minlight_color, light_alpha, maxlight, lightcolorscale);
|
light_ignore, phong_angle, phong_angle_concave, minlight, minlight_color, light_alpha, maxlight, lightcolorscale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -763,8 +763,8 @@ static void LoadExtendedTexinfoFlags(const fs::path &sourcefilename, const mbsp_
|
||||||
auto &val = it.value();
|
auto &val = it.value();
|
||||||
auto &flags = extended_texinfo_flags[index];
|
auto &flags = extended_texinfo_flags[index];
|
||||||
|
|
||||||
if (val.contains("is_skip")) {
|
if (val.contains("is_nodraw")) {
|
||||||
flags.is_skip = val.at("is_skip").get<bool>();
|
flags.is_nodraw = val.at("is_nodraw").get<bool>();
|
||||||
}
|
}
|
||||||
if (val.contains("is_hint")) {
|
if (val.contains("is_hint")) {
|
||||||
flags.is_hint = val.at("is_hint").get<bool>();
|
flags.is_hint = val.at("is_hint").get<bool>();
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ bool side_t::is_visible() const
|
||||||
{
|
{
|
||||||
// workaround for qbsp_q2_mist_clip.map - we want to treat nodraw faces as "!visible"
|
// workaround for qbsp_q2_mist_clip.map - we want to treat nodraw faces as "!visible"
|
||||||
// so they're used as splitters after mist
|
// so they're used as splitters after mist
|
||||||
if (get_texinfo().flags.is_skip) {
|
if (get_texinfo().flags.is_nodraw) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ static void ExportObj_Marksurfaces_r(const node_t *node, std::unordered_set<cons
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto &face : node->markfaces) {
|
for (auto &face : node->markfaces) {
|
||||||
if (!face->get_texinfo().flags.is_skip) {
|
if (!face->get_texinfo().flags.is_nodraw) {
|
||||||
dest->insert(face);
|
dest->insert(face);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ struct makefaces_stats_t : logging::stat_tracker_t
|
||||||
|
|
||||||
static bool ShouldOmitFace(face_t *f)
|
static bool ShouldOmitFace(face_t *f)
|
||||||
{
|
{
|
||||||
if (!qbsp_options.includeskip.value() && f->get_texinfo().flags.is_skip)
|
if (!qbsp_options.includeskip.value() && f->get_texinfo().flags.is_nodraw)
|
||||||
return true;
|
return true;
|
||||||
if (map.mtexinfos.at(f->texinfo).flags.is_hint)
|
if (map.mtexinfos.at(f->texinfo).flags.is_hint)
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -329,7 +329,7 @@ static std::list<std::unique_ptr<face_t>> SubdivideFace(std::unique_ptr<face_t>
|
||||||
/* special (non-surface cached) faces don't need subdivision */
|
/* special (non-surface cached) faces don't need subdivision */
|
||||||
const maptexinfo_t &tex = f->get_texinfo();
|
const maptexinfo_t &tex = f->get_texinfo();
|
||||||
|
|
||||||
if (tex.flags.is_skip || tex.flags.is_hint || !qbsp_options.target_game->surf_is_subdivided(tex.flags)) {
|
if (tex.flags.is_nodraw || tex.flags.is_hint || !qbsp_options.target_game->surf_is_subdivided(tex.flags)) {
|
||||||
std::list<std::unique_ptr<face_t>> result;
|
std::list<std::unique_ptr<face_t>> result;
|
||||||
result.push_back(std::move(f));
|
result.push_back(std::move(f));
|
||||||
return result;
|
return result;
|
||||||
|
|
|
||||||
|
|
@ -528,7 +528,7 @@ static surfflags_t SurfFlagsForEntity(const maptexinfo_t &texinfo, const mapenti
|
||||||
// splitturb, etc) from there.
|
// splitturb, etc) from there.
|
||||||
if (qbsp_options.target_game->id != GAME_QUAKE_II) {
|
if (qbsp_options.target_game->id != GAME_QUAKE_II) {
|
||||||
if (IsSkipName(texname))
|
if (IsSkipName(texname))
|
||||||
flags.is_skip = true;
|
flags.is_nodraw = true;
|
||||||
if (IsHintName(texname))
|
if (IsHintName(texname))
|
||||||
flags.is_hint = true;
|
flags.is_hint = true;
|
||||||
if (IsSpecialName(texname))
|
if (IsSpecialName(texname))
|
||||||
|
|
@ -537,7 +537,7 @@ static surfflags_t SurfFlagsForEntity(const maptexinfo_t &texinfo, const mapenti
|
||||||
flags.native = texinfo.flags.native;
|
flags.native = texinfo.flags.native;
|
||||||
|
|
||||||
if ((flags.native & Q2_SURF_NODRAW) || IsSkipName(texname))
|
if ((flags.native & Q2_SURF_NODRAW) || IsSkipName(texname))
|
||||||
flags.is_skip = true;
|
flags.is_nodraw = true;
|
||||||
if ((flags.native & Q2_SURF_HINT) || IsHintName(texname))
|
if ((flags.native & Q2_SURF_HINT) || IsHintName(texname))
|
||||||
flags.is_hint = true;
|
flags.is_hint = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1064,7 +1064,7 @@ static int MakeSkipTexinfo()
|
||||||
maptexinfo_t mt{};
|
maptexinfo_t mt{};
|
||||||
|
|
||||||
mt.miptex = FindMiptex("skip", true);
|
mt.miptex = FindMiptex("skip", true);
|
||||||
mt.flags.is_skip = true;
|
mt.flags.is_nodraw = true;
|
||||||
|
|
||||||
return FindTexinfo(mt);
|
return FindTexinfo(mt);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ size_t ExportMapTexinfo(size_t texinfonum)
|
||||||
|
|
||||||
if (src.outputnum.has_value())
|
if (src.outputnum.has_value())
|
||||||
return src.outputnum.value();
|
return src.outputnum.value();
|
||||||
else if (!qbsp_options.includeskip.value() && src.flags.is_skip)
|
else if (!qbsp_options.includeskip.value() && src.flags.is_nodraw)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
// this will be the index of the exported texinfo in the BSP lump
|
// this will be the index of the exported texinfo in the BSP lump
|
||||||
|
|
@ -169,7 +169,7 @@ static void ExportLeaf(node_t *node)
|
||||||
dleaf.firstmarksurface = static_cast<int>(map.bsp.dleaffaces.size());
|
dleaf.firstmarksurface = static_cast<int>(map.bsp.dleaffaces.size());
|
||||||
|
|
||||||
for (auto &face : node->markfaces) {
|
for (auto &face : node->markfaces) {
|
||||||
if (!qbsp_options.includeskip.value() && face->get_texinfo().flags.is_skip) {
|
if (!qbsp_options.includeskip.value() && face->get_texinfo().flags.is_nodraw) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -333,8 +333,8 @@ static void WriteExtendedTexinfoFlags(void)
|
||||||
|
|
||||||
json t = json::object();
|
json t = json::object();
|
||||||
|
|
||||||
if (tx.flags.is_skip) {
|
if (tx.flags.is_nodraw) {
|
||||||
t["is_skip"] = tx.flags.is_skip;
|
t["is_nodraw"] = tx.flags.is_nodraw;
|
||||||
}
|
}
|
||||||
if (tx.flags.is_hint) {
|
if (tx.flags.is_hint) {
|
||||||
t["is_hint"] = tx.flags.is_hint;
|
t["is_hint"] = tx.flags.is_hint;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue