style: reformat

This commit is contained in:
Eric Wasylishen 2023-05-07 21:34:23 -06:00
parent bb6069f8d4
commit 18a7df1a1b
7 changed files with 29 additions and 32 deletions

View File

@ -1803,9 +1803,10 @@ static auto as_tuple(const surfflags_t &flags)
{
return std::tie(flags.native, flags.is_nodraw, flags.is_hintskip, flags.is_hint, flags.no_dirt, flags.no_shadow,
flags.no_bounce, flags.no_minlight, flags.no_expand, flags.no_phong, flags.light_ignore,
flags.surflight_rescale, flags.surflight_style, flags.surflight_color, flags.surflight_minlight_scale, flags.phong_angle, flags.phong_angle_concave, flags.phong_group, flags.minlight,
flags.minlight_color, flags.light_alpha, flags.maxlight, flags.lightcolorscale, flags.surflight_group,
flags.world_units_per_luxel, flags.object_channel_mask);
flags.surflight_rescale, flags.surflight_style, flags.surflight_color, flags.surflight_minlight_scale,
flags.phong_angle, flags.phong_angle_concave, flags.phong_group, flags.minlight, flags.minlight_color,
flags.light_alpha, flags.maxlight, flags.lightcolorscale, flags.surflight_group, flags.world_units_per_luxel,
flags.object_channel_mask);
}
bool surfflags_t::needs_write() const

View File

@ -110,14 +110,8 @@ constexpr struct
const char *suffix;
ext id;
decltype(load_wal) *loader;
} extension_list[] = {
{".png", ext::STB, load_stb},
{".jpg", ext::STB, load_stb},
{".tga", ext::TGA, load_tga},
{".wal", ext::WAL, load_wal},
{".mip", ext::MIP, load_mip},
{"", ext::MIP, load_mip}
};
} extension_list[] = {{".png", ext::STB, load_stb}, {".jpg", ext::STB, load_stb}, {".tga", ext::TGA, load_tga},
{".wal", ext::WAL, load_wal}, {".mip", ext::MIP, load_mip}, {"", ext::MIP, load_mip}};
// Attempt to load a texture from the specified name.
std::tuple<std::optional<texture>, fs::resolve_result, fs::data> load_texture(
@ -142,9 +136,7 @@ constexpr struct
meta_ext id;
decltype(load_wal_meta) *loader;
} meta_extension_list[] = {
{".wal_json", meta_ext::WAL_JSON, load_wal_json_meta},
{".wal", meta_ext::WAL, load_wal_meta}
};
{".wal_json", meta_ext::WAL_JSON, load_wal_json_meta}, {".wal", meta_ext::WAL, load_wal_meta}};
// Attempt to load a texture meta from the specified name.
std::tuple<std::optional<texture_meta>, fs::resolve_result, fs::data> load_texture_meta(

View File

@ -290,8 +290,8 @@ struct texture_def_issues_t : logging::stat_tracker_t
false, true);
stat &num_repaired = register_stat(
"faces have invalid texture projections and were repaired. Use -verbose to display affected faces."
, false, true);
"faces have invalid texture projections and were repaired. Use -verbose to display affected faces.", false,
true);
};
bool ParseEntity(parser_t &parser, mapentity_t &entity, texture_def_issues_t &issues_stats);

View File

@ -715,18 +715,18 @@ static void Brush_LoadEntity(mapentity_t &dst, mapentity_t &src, hull_index_t hu
if (map.is_world_entity(src) || IsWorldBrushEntity(src) || IsNonRemoveWorldBrushEntity(src)) {
if (map.region) {
if (map.region->bounds.disjoint(mapbrush.bounds)) {
//stats.regioned_brushes++;
//it = entity.mapbrushes.erase(it);
//logging::print("removed broosh\n");
// stats.regioned_brushes++;
// it = entity.mapbrushes.erase(it);
// logging::print("removed broosh\n");
continue;
}
}
for (auto &region : map.antiregions) {
if (!region.bounds.disjoint(mapbrush.bounds)) {
//stats.regioned_brushes++;
//it = entity.mapbrushes.erase(it);
//logging::print("removed broosh\n");
// stats.regioned_brushes++;
// it = entity.mapbrushes.erase(it);
// logging::print("removed broosh\n");
continue;
}
}

View File

@ -669,9 +669,10 @@ static surfflags_t SurfFlagsForEntity(
// FIXME: get_color, to match settings
if (entity.epairs.has("_surflight_color") && entity.epairs.get_vector("_surflight_color", color) == 3) {
if (color[0] <= 1 && color[1] <= 1 && color[2] <= 1) {
flags.surflight_color = qvec3b{ (uint8_t) (color[0] * 255), (uint8_t) (color[1] * 255), (uint8_t) (color[2] * 255) };
flags.surflight_color =
qvec3b{(uint8_t)(color[0] * 255), (uint8_t)(color[1] * 255), (uint8_t)(color[2] * 255)};
} else {
flags.surflight_color = qvec3b{ (uint8_t) (color[0]), (uint8_t) (color[1]), (uint8_t) (color[2]) };
flags.surflight_color = qvec3b{(uint8_t)(color[0]), (uint8_t)(color[1]), (uint8_t)(color[2])};
}
}
}
@ -681,7 +682,8 @@ static surfflags_t SurfFlagsForEntity(
if (entity.epairs.has("_surflight_minlight_scale"))
flags.surflight_minlight_scale = entity.epairs.get_float("_surflight_minlight_scale");
// Paril: inherit _surflight_minlight_scale from worldspawn if unset
else if (!entity.epairs.has("_surflight_minlight_scale") && map.world_entity().epairs.has("_surflight_minlight_scale"))
else if (!entity.epairs.has("_surflight_minlight_scale") &&
map.world_entity().epairs.has("_surflight_minlight_scale"))
flags.surflight_minlight_scale = map.world_entity().epairs.get_float("_surflight_minlight_scale");
// "_minlight_exclude", "_minlight_exclude2", "_minlight_exclude3"...
@ -2572,7 +2574,8 @@ static mapbrush_t ParseBrush(parser_t &parser, mapentity_t &entity, texture_def_
new_side.raw_info = side.raw_info;
new_side.texname = side.texname;
new_side.planenum = side.planenum;
new_side.planenum = map.add_or_find_plane({ new_side.get_plane().get_normal(), new_side.get_plane().get_dist() + 16.f });
new_side.planenum = map.add_or_find_plane(
{new_side.get_plane().get_normal(), new_side.get_plane().get_dist() + 16.f});
new_brush.faces.emplace_back(std::move(new_side));
// the inverted side is special
@ -2584,7 +2587,8 @@ static mapbrush_t ParseBrush(parser_t &parser, mapentity_t &entity, texture_def_
flipped_side.contents = side.contents;
flipped_side.raw_info = side.raw_info;
flipped_side.texname = side.texname;
flipped_side.planenum = map.add_or_find_plane({ -new_brush_side.get_plane().get_normal(), -new_brush_side.get_plane().get_dist() });
flipped_side.planenum = map.add_or_find_plane(
{-new_brush_side.get_plane().get_normal(), -new_brush_side.get_plane().get_dist()});
new_brush.faces.emplace_back(std::move(flipped_side));
} else {
@ -3234,7 +3238,7 @@ void ProcessMapBrushes()
// remove ents in region
if (map.region || map.antiregions.size()) {
for (auto it = map.entities.begin(); it != map.entities.end(); ) {
for (auto it = map.entities.begin(); it != map.entities.end();) {
auto &entity = *it;
bool removed = false;