CModel: Make CModelFlags constexpr constructible.

Allows initializers to be elided where applicable.

While we're at it, we can make the conditional flag tests more explicit
and eliminate implicit truncation in the case of the second flag test.
This commit is contained in:
Lioncash 2020-04-11 15:17:12 -04:00
parent 7e8ca5e808
commit 4bdcc5efdb
1 changed files with 4 additions and 4 deletions

View File

@ -37,12 +37,12 @@ struct CModelFlags {
zeus::CColor addColor = zeus::skClear; zeus::CColor addColor = zeus::skClear;
zeus::CAABox mbShadowBox; zeus::CAABox mbShadowBox;
CModelFlags() = default; constexpr CModelFlags() = default;
CModelFlags(u8 blendMode, u8 shadIdx, u16 flags, const zeus::CColor& col) constexpr CModelFlags(u8 blendMode, u8 shadIdx, u16 flags, const zeus::CColor& col)
: x0_blendMode(blendMode), x1_matSetIdx(shadIdx), x2_flags(flags), x4_color(col) { : x0_blendMode(blendMode), x1_matSetIdx(shadIdx), x2_flags(flags), x4_color(col) {
/* Blend mode will override this if the surface's original material is opaque */ /* Blend mode will override this if the surface's original material is opaque */
m_noZWrite = !(x2_flags & 0x2); m_noZWrite = (x2_flags & 0x2) == 0;
m_depthGreater = (x2_flags & 0x8); m_depthGreater = (x2_flags & 0x8) != 0;
} }
/* Flags /* Flags