2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 15:04:56 +00:00

RuntimeCommon: Make use of bitfield initializers where applicable

Continues and finishes the migration towards initializing all bitfield
members where applicable
This commit is contained in:
Lioncash
2020-04-21 03:22:41 -04:00
parent d3a44259c3
commit fa3e639a9d
129 changed files with 467 additions and 866 deletions

View File

@@ -681,18 +681,8 @@ void CBooRenderer::LoadBallFade() {
}
CBooRenderer::CBooRenderer(IObjectStore& store, IFactory& resFac)
: x8_factory(resFac), xc_store(store), x2a8_thermalRand(20)
, x318_24_refectionDirty(false)
, x318_25_drawWireframe(false)
, x318_26_requestRGBA6(false)
, x318_27_currentRGBA6(false)
, x318_28_disableFog(false)
, x318_29_thermalVisor(false)
, x318_30_inAreaDraw(false)
, x318_31_persistRGBA6(false)
, m_thermalHotPass(false) {
: x8_factory(resFac), xc_store(store), x2a8_thermalRand(20) {
g_Renderer = this;
xee_24_ = true;
m_staticEntropy = store.GetObj("RandomStaticEntropy");

View File

@@ -105,7 +105,7 @@ class CBooRenderer final : public IRenderer {
u32 xe0_pvsAreaIdx = 0;
// boo::ITextureS* xe4_blackTex = nullptr;
bool xee_24_ : 1;
bool xee_24_ : 1 = true;
boo::ObjToken<boo::ITexture> m_clearTexture;
boo::ObjToken<boo::ITexture> m_blackTexture;
@@ -152,15 +152,15 @@ class CBooRenderer final : public IRenderer {
// std::unique_ptr<CTexture> x314_phazonSuitMask;
CPhazonSuitFilter m_phazonSuitFilter;
bool x318_24_refectionDirty : 1;
bool x318_25_drawWireframe : 1;
bool x318_26_requestRGBA6 : 1;
bool x318_27_currentRGBA6 : 1;
bool x318_28_disableFog : 1;
bool x318_29_thermalVisor : 1;
bool x318_30_inAreaDraw : 1;
bool x318_31_persistRGBA6 : 1;
bool m_thermalHotPass : 1;
bool x318_24_refectionDirty : 1 = false;
bool x318_25_drawWireframe : 1 = false;
bool x318_26_requestRGBA6 : 1 = false;
bool x318_27_currentRGBA6 : 1 = false;
bool x318_28_disableFog : 1 = false;
bool x318_29_thermalVisor : 1 = false;
bool x318_30_inAreaDraw : 1 = false;
bool x318_31_persistRGBA6 : 1 = false;
bool m_thermalHotPass : 1 = false;
void GenerateFogVolumeRampTex(boo::IGraphicsDataFactory::Context& ctx);
void GenerateSphereRampTex(boo::IGraphicsDataFactory::Context& ctx);

View File

@@ -6,7 +6,7 @@
namespace urde {
class CDrawablePlaneObject : public CDrawable {
friend class Buckets;
u16 x24_targetBucket;
u16 x24_targetBucket = 0;
float x28_farDist;
zeus::CPlane x2c_plane;
bool x3c_24_invertTest : 1;
@@ -15,10 +15,11 @@ class CDrawablePlaneObject : public CDrawable {
public:
CDrawablePlaneObject(EDrawableType dtype, float closeDist, float farDist, const zeus::CAABox& aabb, bool invertTest,
const zeus::CPlane& plane, bool zOnly, void* data)
: CDrawable(dtype, 0, closeDist, aabb, data), x24_targetBucket(0), x28_farDist(farDist), x2c_plane(plane) {
x3c_24_invertTest = invertTest;
x3c_25_zOnly = zOnly;
}
: CDrawable(dtype, 0, closeDist, aabb, data)
, x28_farDist(farDist)
, x2c_plane(plane)
, x3c_24_invertTest{invertTest}
, x3c_25_zOnly{zOnly} {}
const zeus::CPlane& GetPlane() const { return x2c_plane; }
};
} // namespace urde

View File

@@ -55,9 +55,7 @@ CLight::CLight(const zeus::CVector3f& pos, const zeus::CVector3f& dir, const zeu
, x2c_distQ(distQ)
, x30_angleC(angleC)
, x34_angleL(angleL)
, x38_angleQ(angleQ)
, x4c_24_intensityDirty(true)
, x4c_25_radiusDirty(true) {}
, x38_angleQ(angleQ) {}
CLight::CLight(ELightType type, const zeus::CVector3f& pos, const zeus::CVector3f& dir, const zeus::CColor& color,
float cutoff)
@@ -65,9 +63,7 @@ CLight::CLight(ELightType type, const zeus::CVector3f& pos, const zeus::CVector3
, xc_dir(dir)
, x18_color(color)
, x1c_type(type)
, x20_spotCutoff(cutoff)
, x4c_24_intensityDirty(true)
, x4c_25_radiusDirty(true) {
, x20_spotCutoff(cutoff) {
switch (type) {
case ELightType::Spot: {
const float cosCutoff = std::cos(zeus::degToRad(cutoff));

View File

@@ -37,16 +37,13 @@ class CLight {
u32 x40_lightId = 0; // Serves as unique key
mutable float x44_cachedRadius = 0.f;
mutable float x48_cachedIntensity = 0.f;
mutable bool x4c_24_intensityDirty : 1;
mutable bool x4c_25_radiusDirty : 1;
mutable bool x4c_24_intensityDirty : 1 = true;
mutable bool x4c_25_radiusDirty : 1 = true;
float CalculateLightRadius() const;
public:
CLight() {
x4c_24_intensityDirty = true;
x4c_25_radiusDirty = true;
}
CLight() = default;
CLight(const zeus::CVector3f& pos, const zeus::CVector3f& dir, const zeus::CColor& color, float distC, float distL,
float distQ, float angleC, float angleL, float angleQ);

View File

@@ -143,8 +143,8 @@ private:
zeus::CAABox x20_aabb;
CBooSurface* x38_firstUnsortedSurface = nullptr;
CBooSurface* x3c_firstSortedSurface = nullptr;
bool x40_24_texturesLoaded : 1;
bool x40_25_modelVisible : 1;
bool x40_24_texturesLoaded : 1 = false;
bool x40_25_modelVisible : 1 = false;
u8 x41_mask;
u32 x44_areaInstanceIdx = UINT32_MAX;

View File

@@ -178,8 +178,6 @@ CBooModel::CBooModel(TToken<CModel>& token, CModel* parent, std::vector<CBooSurf
, m_pipelines(&shader.m_shaders)
, x1c_textures(shader.x0_textures)
, x20_aabb(aabb)
, x40_24_texturesLoaded(false)
, x40_25_modelVisible(0)
, x41_mask(renderMask)
, m_staticVbo(vbo)
, m_staticIbo(ibo) {

View File

@@ -143,8 +143,6 @@ CMoviePlayer::CMoviePlayer(const char* path, float preLoadSeconds, bool loop, bo
: CDvdFile(path)
, xec_preLoadSeconds(preLoadSeconds)
, xf4_24_loop(loop)
, xf4_25_hasAudio(false)
, xf4_26_fieldFlip(false)
, m_deinterlace(deinterlace) {
/* Read THP header information */
u8 buf[64];

View File

@@ -100,8 +100,8 @@ private:
float xec_preLoadSeconds;
u32 xf0_preLoadFrames = 0;
bool xf4_24_loop : 1;
bool xf4_25_hasAudio : 1;
bool xf4_26_fieldFlip : 1;
bool xf4_25_hasAudio : 1 = false;
bool xf4_26_fieldFlip : 1 = false;
bool m_deinterlace : 1;
u32 xf8_ = 0;
u32 xfc_fieldIndex = 0;

View File

@@ -12,8 +12,6 @@ CRainSplashGenerator::CRainSplashGenerator(const zeus::CVector3f& scale, u32 max
: x14_scale(scale), x2c_minZ(minZ) {
x30_alpha = std::min(1.f, alpha);
x44_genRate = std::min(maxSplashes, genRate);
x48_24 = false;
x48_25_raining = true;
x0_rainSplashes.reserve(maxSplashes);
CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
for (u32 i = 0; i < maxSplashes; ++i)

View File

@@ -56,8 +56,8 @@ class CRainSplashGenerator {
u32 x3c_queueHead = 0;
u32 x40_queueSize = 0;
u32 x44_genRate;
bool x48_24 : 1;
bool x48_25_raining : 1;
bool x48_24 : 1 = false;
bool x48_25_raining : 1 = true;
void UpdateRainSplashRange(CStateManager& mgr, int start, int end, float dt);
void UpdateRainSplashes(CStateManager& mgr, float magnitude, float dt);
void DoDraw(const zeus::CTransform& xf);

View File

@@ -6,11 +6,7 @@
namespace urde {
CSimpleShadow::CSimpleShadow(float scale, float userAlpha, float maxObjHeight, float displacement)
: x30_scale(scale), x38_userAlpha(userAlpha), x40_maxObjHeight(maxObjHeight), x44_displacement(displacement) {
x48_24_collision = false;
x48_25_alwaysCalculateRadius = true;
x48_26_radiusCalculated = false;
}
: x30_scale(scale), x38_userAlpha(userAlpha), x40_maxObjHeight(maxObjHeight), x44_displacement(displacement) {}
zeus::CAABox CSimpleShadow::GetMaxShadowBox(const zeus::CAABox& aabb) const {
float extent = x34_radius * x30_scale;

View File

@@ -19,9 +19,9 @@ class CSimpleShadow {
float x3c_heightAlpha = 1.f;
float x40_maxObjHeight;
float x44_displacement;
bool x48_24_collision : 1;
bool x48_25_alwaysCalculateRadius : 1;
bool x48_26_radiusCalculated : 1;
bool x48_24_collision : 1 = false;
bool x48_25_alwaysCalculateRadius : 1 = true;
bool x48_26_radiusCalculated : 1 = false;
std::optional<CTexturedQuadFilter> m_filter;
public: