diff --git a/common/bspfile_common.cc b/common/bspfile_common.cc index e08a5c95..59ebcf28 100644 --- a/common/bspfile_common.cc +++ b/common/bspfile_common.cc @@ -315,7 +315,7 @@ nlohmann::json surfflags_t::to_json() const surfflags_t surfflags_t::from_json(const nlohmann::json &val) { - surfflags_t flags{}; + surfflags_t flags; if (val.contains("is_nodraw")) { flags.set_nodraw(val.at("is_nodraw").get()); diff --git a/include/common/bspfile_common.hh b/include/common/bspfile_common.hh index f43101be..60d6974e 100644 --- a/include/common/bspfile_common.hh +++ b/include/common/bspfile_common.hh @@ -236,10 +236,10 @@ struct surfflags_t { // native flags value; what's written to the BSP for a Q2 map basically // when compiling Q1 maps, we can use these internally but obviously not write them out - q2_surf_flags_t native_q2; + q2_surf_flags_t native_q2 = static_cast(0); // native q1 flags - q1_surf_flags_t native_q1; + q1_surf_flags_t native_q1 = static_cast(0); // an invisible surface (Q1 "skip" texture, Q2 SURF_NODRAW) bool is_nodraw() const; @@ -257,23 +257,23 @@ struct surfflags_t void set_hintskip(bool hintskip); // don't receive dirtmapping - bool no_dirt : 1; + bool no_dirt : 1 = false; // don't cast a shadow - bool no_shadow : 1; + bool no_shadow : 1 = false; // light doesn't bounce off this face - bool no_bounce : 1; + bool no_bounce : 1 = false; // opt out of minlight on this face (including opting out of local minlight, so // not the same as just setting minlight to 0). - bool no_minlight : 1; + bool no_minlight : 1 = false; // don't expand this face for larger clip hulls - bool no_expand : 1; + bool no_expand : 1 = false; // this face doesn't receive light - bool light_ignore : 1; + bool light_ignore : 1 = false; // if true, rescales any surface light emitted by these brushes to emit 50% light at 90 degrees from the surface // normal if false, use a more natural angle falloff of 0% at 90 degrees @@ -295,19 +295,19 @@ struct surfflags_t std::optional surflight_atten; // if non zero, enables phong shading and gives the angle threshold to use - float phong_angle; + float phong_angle = 0.0f; // if non zero, overrides _phong_angle for concave joints - float phong_angle_concave; + float phong_angle_concave = 0.0f; // _phong_group key, equivalent q2 map format's use of the "value" field - int phong_group; + int phong_group = 0; // minlight value for this face. empty = inherit from worldspawn. std::optional minlight; // red minlight colors for this face - qvec3b minlight_color; + qvec3b minlight_color = qvec3b(0, 0, 0); // custom opacity std::optional light_alpha; @@ -316,13 +316,13 @@ struct surfflags_t std::optional light_twosided; // maxlight value for this face - float maxlight; + float maxlight = 0.0; // light color scale float lightcolorscale = 1.0; // surface light group - int32_t surflight_group; + int32_t surflight_group = 0; // custom world_units_per_luxel for this geometry std::optional world_units_per_luxel;