diff --git a/common/bspfile.cc b/common/bspfile.cc index befe4f04..a57bb5da 100644 --- a/common/bspfile.cc +++ b/common/bspfile.cc @@ -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 diff --git a/include/common/imglib.hh b/include/common/imglib.hh index 8cfdabd2..8d271ba7 100644 --- a/include/common/imglib.hh +++ b/include/common/imglib.hh @@ -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, 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, fs::resolve_result, fs::data> load_texture_meta( diff --git a/include/qbsp/map.hh b/include/qbsp/map.hh index f3927c9e..f0f190f7 100644 --- a/include/qbsp/map.hh +++ b/include/qbsp/map.hh @@ -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); diff --git a/light/lightgrid.cc b/light/lightgrid.cc index 330d80c2..62998234 100644 --- a/light/lightgrid.cc +++ b/light/lightgrid.cc @@ -463,7 +463,7 @@ void LightGrid(bspdata_t *bspdata) logging::print(" {} grid_mins\n", data.grid_mins); logging::print(" {} grid_maxs\n", grid_maxs); logging::print(" {} num_styles\n", data.num_styles); - + // octree lump if (light_options.lightgrid_format.value() == lightgrid_format_t::OCTREE) { bspdata->bspx.transfer("LIGHTGRID_OCTREE", MakeOctreeLump(bsp, data)); diff --git a/light/surflight.cc b/light/surflight.cc index 259524ea..16bd3ab3 100644 --- a/light/surflight.cc +++ b/light/surflight.cc @@ -105,7 +105,7 @@ static void MakeSurfaceLight(const mbsp_t *bsp, const settings::worldspawn_keys } else { // Handle arghrad sky light settings http://www.bspquakeeditor.com/arghrad/sunlight.html#sky if (!texture_color.has_value()) { - if (cfg.sky_surface.is_changed() && is_sky) { + if (cfg.sky_surface.is_changed() && is_sky) { // FIXME: this only handles the "_sky_surface" "red green blue" format. // There are other more complex variants we could handle documented in the link above. // FIXME: we require value to be nonzero, see the check above - not sure if this matches arghrad diff --git a/qbsp/brush.cc b/qbsp/brush.cc index 8c9ed914..436e84d3 100644 --- a/qbsp/brush.cc +++ b/qbsp/brush.cc @@ -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 ®ion : 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; } } diff --git a/qbsp/map.cc b/qbsp/map.cc index 37f38460..409237bd 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -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"... @@ -2561,7 +2563,7 @@ static mapbrush_t ParseBrush(parser_t &parser, mapentity_t &entity, texture_def_ new_brush.contents = brush.contents; new_brush.line = brush.line; - + for (auto &side : brush.faces) { // if it's the side we're extruding, increase its dist @@ -2572,10 +2574,11 @@ 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 + // the inverted side is special } else if (side.get_plane().get_normal() == -new_brush_side.get_plane().get_normal()) { // add the other side @@ -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;