diff --git a/Runtime/Audio/CSfxManager.hpp b/Runtime/Audio/CSfxManager.hpp index a324f8c07..979284e3c 100644 --- a/Runtime/Audio/CSfxManager.hpp +++ b/Runtime/Audio/CSfxManager.hpp @@ -65,19 +65,12 @@ public: s16 xa_prio; //CSfxHandle xc_handle; TAreaId x10_area; - union - { - struct - { - bool x14_24_isActive:1; - bool x14_25_isPlaying:1; - bool x14_26_looped:1; - bool x14_27_inArea:1; - bool x14_28_available:1; - bool x14_29_useAcoustics:1; - }; - u16 _dummy = 0; - }; + bool x14_24_isActive:1; + bool x14_25_isPlaying:1; + bool x14_26_looped:1; + bool x14_27_inArea:1; + bool x14_28_available:1; + bool x14_29_useAcoustics:1; public: virtual ~CBaseSfxWrapper() = default; virtual void SetActive(bool v) { x14_24_isActive = v; } diff --git a/Runtime/CDvdFile.hpp b/Runtime/CDvdFile.hpp index ed9852025..5438bc10c 100644 --- a/Runtime/CDvdFile.hpp +++ b/Runtime/CDvdFile.hpp @@ -78,6 +78,7 @@ public: return m_reader->readBytesToBuf(buf, len); } u64 Length() {return m_reader->length();} + const std::string& GetPath() const { return x18_path; } }; } diff --git a/Runtime/Camera/CGameCamera.hpp b/Runtime/Camera/CGameCamera.hpp index 9bb30c43a..65483b39a 100644 --- a/Runtime/Camera/CGameCamera.hpp +++ b/Runtime/Camera/CGameCamera.hpp @@ -18,14 +18,8 @@ class CGameCamera : public CActor float x164_zfar; float x168_aspect; u32 x16c_; - union { - struct - { - bool x170_24_perspDirty : 1; - bool x170_25_disablesInput : 1; - }; - u32 _dummy = 0; - }; + bool x170_24_perspDirty : 1; + bool x170_25_disablesInput : 1; float x174_ = 0.f; float x178_ = 0.f; float x17c_ = 0.f; diff --git a/Runtime/Graphics/CMoviePlayer.cpp b/Runtime/Graphics/CMoviePlayer.cpp index 82dd739fa..5c0a7d263 100644 --- a/Runtime/Graphics/CMoviePlayer.cpp +++ b/Runtime/Graphics/CMoviePlayer.cpp @@ -358,8 +358,11 @@ u32 CMoviePlayer::THPAudioDecode(s16* buffer, const u8* audioFrame, bool stereo) } CMoviePlayer::CMoviePlayer(const char* path, float preLoadSeconds, bool loop, bool deinterlace) -: CDvdFile(path), xec_preLoadSeconds(preLoadSeconds), xf4_24_loop(loop), m_deinterlace(deinterlace) +: CDvdFile(path), xec_preLoadSeconds(preLoadSeconds) { + xf4_24_loop = loop; + m_deinterlace = deinterlace; + /* Read THP header information */ u8 buf[64]; SyncRead(buf, 64); diff --git a/Runtime/Graphics/CMoviePlayer.hpp b/Runtime/Graphics/CMoviePlayer.hpp index c8074202d..c578abe1c 100644 --- a/Runtime/Graphics/CMoviePlayer.hpp +++ b/Runtime/Graphics/CMoviePlayer.hpp @@ -121,12 +121,12 @@ private: union { + u32 m_dummy = 0; struct { bool xf4_24_loop : 1; bool xf4_25_hasAudio : 1; bool xf4_26_fieldFlip : 1; bool m_deinterlace : 1; }; - u8 m_dummy = 0; }; specter::View::ViewBlock m_viewVertBlock; diff --git a/Runtime/MP1/CMFGame.cpp b/Runtime/MP1/CMFGame.cpp index fbf866b2d..d6cf79861 100644 --- a/Runtime/MP1/CMFGame.cpp +++ b/Runtime/MP1/CMFGame.cpp @@ -14,8 +14,9 @@ namespace MP1 CMFGame::CMFGame(const std::weak_ptr& stateMgr, const std::weak_ptr& guiMgr, const CArchitectureQueue&) -: CMFGameBase("CMFGame"), x14_stateManager(stateMgr.lock()), x18_guiManager(guiMgr.lock()), x2a_25_(true) +: CMFGameBase("CMFGame"), x14_stateManager(stateMgr.lock()), x18_guiManager(guiMgr.lock()) { + x2a_25_ = true; //g_Main->x160_25_ = true; } diff --git a/Runtime/Weapon/CGunController.hpp b/Runtime/Weapon/CGunController.hpp index 4817f1cbb..43eaadf3a 100644 --- a/Runtime/Weapon/CGunController.hpp +++ b/Runtime/Weapon/CGunController.hpp @@ -39,7 +39,12 @@ class CGunController }; public: - CGunController(CModelData& modelData) : x0_modelData(modelData), x58_24_(true) {} + CGunController(CModelData& modelData) + : x0_modelData(modelData) + { + x58_24_ = true; + } + void UnLoadFidget(); void LoadFidgetAnimAsync(CStateManager&, s32, s32, s32); void GetFreeLookSetId() const; diff --git a/Runtime/World/CEntity.cpp b/Runtime/World/CEntity.cpp index 21d32ab7b..796b62c36 100644 --- a/Runtime/World/CEntity.cpp +++ b/Runtime/World/CEntity.cpp @@ -7,7 +7,10 @@ const std::vector CEntity::NullConnectionList; CEntity::CEntity(TUniqueId uniqueId, const CEntityInfo& info, bool active, const std::string& name) : x4_areaId(info.GetAreaId()), x8_uid(uniqueId), xc_editorId(info.GetEditorId()), x10_name(name), - x20_conns(info.GetConnectionList()), x30_24_active(active) {} + x20_conns(info.GetConnectionList()) +{ + x30_24_active = active; +} void CEntity::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr) { diff --git a/Runtime/World/CGameArea.cpp b/Runtime/World/CGameArea.cpp index 6747058c9..594f47fe2 100644 --- a/Runtime/World/CGameArea.cpp +++ b/Runtime/World/CGameArea.cpp @@ -355,8 +355,9 @@ const zeus::CTransform& CDummyGameArea::IGetTM() const } CGameArea::CGameArea(CInputStream& in, int idx, int mlvlVersion) -: x4_selfIdx(idx), xf0_25_active(true) +: x4_selfIdx(idx) { + xf0_25_active = true; x8_nameSTRG = in.readUint32Big(); xc_transform.read34RowMajor(in); x3c_invTransform = xc_transform.inverse(); diff --git a/Runtime/World/CPhysicsActor.cpp b/Runtime/World/CPhysicsActor.cpp index f5d0c537f..7c65b526a 100644 --- a/Runtime/World/CPhysicsActor.cpp +++ b/Runtime/World/CPhysicsActor.cpp @@ -10,7 +10,6 @@ CPhysicsActor::CPhysicsActor(TUniqueId uid, bool active, const std::string& name : CActor(uid, active, name, info, xf, std::move(mData), matList, actorParms, kInvalidUniqueId) , xe8_mass(moverData.x30_mass) , xec_massRecip(moverData.x30_mass <= 0.f ? 1.f : 1.f / moverData.x30_mass) -, xf8_24_(true) , x150_momentum(moverData.x18_) , x1c0_collisionPrimitive(box, matList) , x1f4_translation(xf.origin) @@ -18,6 +17,7 @@ CPhysicsActor::CPhysicsActor(TUniqueId uid, bool active, const std::string& name , x23c_stepUpHeight(stepUp) , x240_stepDownHeight(stepDown) { + xf8_24_ = true; SetMass(moverData.x30_mass); MoveCollisionPrimitive(zeus::CVector3f::skZero); SetVelocityOR(moverData.x0_velocity); diff --git a/Runtime/World/CScriptActorKeyframe.cpp b/Runtime/World/CScriptActorKeyframe.cpp index 7d9e21acc..0dffcd4a2 100644 --- a/Runtime/World/CScriptActorKeyframe.cpp +++ b/Runtime/World/CScriptActorKeyframe.cpp @@ -10,10 +10,10 @@ CScriptActorKeyframe::CScriptActorKeyframe(TUniqueId uid, const std::string& nam , x38_(f1) , x3c_(totalPlayback) , x40_(f1) -, x44_24_(b1) -, x44_25_(b2) -, x44_26_(w2) { + x44_24_ = b1; + x44_25_ = b2; + x44_26_ = w2; } void CScriptActorKeyframe::Accept(IVisitor& visitor) diff --git a/Runtime/World/CScriptCameraHintTrigger.cpp b/Runtime/World/CScriptCameraHintTrigger.cpp index 5e94aa306..f161ec07d 100644 --- a/Runtime/World/CScriptCameraHintTrigger.cpp +++ b/Runtime/World/CScriptCameraHintTrigger.cpp @@ -12,9 +12,9 @@ CScriptCameraHintTrigger::CScriptCameraHintTrigger(TUniqueId uid, bool active, c CActorParameters::None(), kInvalidUniqueId) , xe8_obb(xf, scale) , x124_scale(scale) -, x130_24_(b2) -, x130_25_(b3) { + x130_24_ = b2; + x130_25_ = b3; } void CScriptCameraHintTrigger::Accept(IVisitor& visitor) diff --git a/Runtime/World/CScriptColorModulate.cpp b/Runtime/World/CScriptColorModulate.cpp index 5552e7cac..6ce411916 100644 --- a/Runtime/World/CScriptColorModulate.cpp +++ b/Runtime/World/CScriptColorModulate.cpp @@ -9,19 +9,18 @@ CScriptColorModulate::CScriptColorModulate(TUniqueId uid, const std::string& nam const zeus::CColor& c1, const zeus::CColor& c2, EBlendMode bm, float f1, float f2, bool b1, bool b2, bool b3, bool b4, bool b5, bool active) - : CEntity(uid, info, active, name), - x40_(c1), - x44_(c2), - x48_blendMode(bm), - x4c_(f1), - x50_(f2), - x54_24_(b1), - x54_25_(b2), - x54_26_(b3), - x54_27_(b4), - x54_28_(b5) +: CEntity(uid, info, active, name), + x40_(c1), + x44_(c2), + x48_blendMode(bm), + x4c_(f1), + x50_(f2) { - + x54_24_ = b1; + x54_25_ = b2; + x54_26_ = b3; + x54_27_ = b4; + x54_28_ = b5; } void CScriptColorModulate::Accept(IVisitor& visitor) diff --git a/Runtime/World/CScriptCoverPoint.cpp b/Runtime/World/CScriptCoverPoint.cpp index be8e8158f..985dedf78 100644 --- a/Runtime/World/CScriptCoverPoint.cpp +++ b/Runtime/World/CScriptCoverPoint.cpp @@ -10,9 +10,9 @@ CScriptCoverPoint::CScriptCoverPoint(TUniqueId uid, const std::string &name, con : CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), CActorParameters::None(), kInvalidUniqueId), xe8_flags(flags), - xf4_coverTime(coverTime), - xf8_24_crouch(crouch) + xf4_coverTime(coverTime) { + xf8_24_crouch = crouch; xec_cosHorizontalAngle = std::cos(zeus::degToRad(horizontalAngle) * 0.5f); xf0_sinVerticalAngle = std::sin(zeus::degToRad(verticalAngle) * 0.5f); x100_touchBounds.emplace(xf.origin, xf.origin); diff --git a/Runtime/World/CScriptDock.cpp b/Runtime/World/CScriptDock.cpp index 9ee607012..c704142b6 100644 --- a/Runtime/World/CScriptDock.cpp +++ b/Runtime/World/CScriptDock.cpp @@ -28,8 +28,8 @@ CScriptDock::CScriptDock(TUniqueId uid, const std::string& name, const CEntityIn , x258_dockReferenceCount(dockReferenceCount) , x25c_dock(dock) , x260_area(area) -, x268_25_loadConnected(loadConnected) { + x268_25_loadConnected = loadConnected; } void CScriptDock::Accept(IVisitor& visitor) diff --git a/Runtime/World/CScriptDoor.cpp b/Runtime/World/CScriptDoor.cpp index 8f4765c20..91c346608 100644 --- a/Runtime/World/CScriptDoor.cpp +++ b/Runtime/World/CScriptDoor.cpp @@ -30,13 +30,13 @@ CScriptDoor::CScriptDoor(TUniqueId uid, const std::string& name, const CEntityIn const zeus::CVector3f&, const zeus::CAABox& aabb, bool active, bool open, bool b2, float, bool ballDoor) : CPhysicsActor(uid, active, name, info, xf, std::move(mData), MakeDoorMaterialList(open), - aabb, SMoverData(1.f), actParms, 0.3f, 0.1f), - x2a8_29_ballDoor(ballDoor), - x2a8_25_(open), - x2a8_26_(open), - x2a8_28_(b2), - x2a8_27_(true) + aabb, SMoverData(1.f), actParms, 0.3f, 0.1f) { + x2a8_29_ballDoor = ballDoor; + x2a8_25_ = open; + x2a8_26_ = open; + x2a8_28_ = b2; + x2a8_27_ = true; x264_ = GetBoundingBox(); x284_modelBounds = x64_modelData->GetBounds(xf.getRotation()); diff --git a/Runtime/World/CScriptShadowProjector.cpp b/Runtime/World/CScriptShadowProjector.cpp index b6be64bd1..9eca98dc5 100644 --- a/Runtime/World/CScriptShadowProjector.cpp +++ b/Runtime/World/CScriptShadowProjector.cpp @@ -19,8 +19,8 @@ CScriptShadowProjector::CScriptShadowProjector(TUniqueId uid, const std::string& , xfc_opacity(opacity) , x100_opacityRecip(opacity < 0.00001 ? 1.f : opacityQ / opacity) , x10c_textureSize(textureSize) -, x110_24_persistent(b2) { + x110_24_persistent = b2; } void CScriptShadowProjector::Accept(IVisitor& visitor) diff --git a/Runtime/World/CScriptSound.cpp b/Runtime/World/CScriptSound.cpp index 09864d842..70b84586f 100644 --- a/Runtime/World/CScriptSound.cpp +++ b/Runtime/World/CScriptSound.cpp @@ -24,14 +24,14 @@ CScriptSound::CScriptSound(TUniqueId uid, const std::string& name, const CEntity , x114_(w5) , x116_(w6) , x118_(w7 + 8192) -, x11c_25_(b1) -, x11c_26_(b2) -, x11c_27_(b3) -, x11c_28_(b4) -, x11c_29_(b5) -, x11c_30_(b6) -, x11d_24_(b7) { + x11c_25_ = b1; + x11c_26_ = b2; + x11c_27_ = b3; + x11c_28_ = b4; + x11c_29_ = b5; + x11c_30_ = b6; + x11d_24_ = b7; if (x11c_30_ && (!x11c_26_ || !x11c_25_)) x11c_30_ = false; } diff --git a/Runtime/World/CScriptSpecialFunction.cpp b/Runtime/World/CScriptSpecialFunction.cpp index 0b5e3e898..1286b5de3 100644 --- a/Runtime/World/CScriptSpecialFunction.cpp +++ b/Runtime/World/CScriptSpecialFunction.cpp @@ -30,8 +30,8 @@ CScriptSpecialFunction::CScriptSpecialFunction(TUniqueId uid, const std::string& , x1bc_(aId1) , x1c0_(aId2) , x1c4_(aId3) -, x1e4_26_(true) { + x1e4_26_ = true; if (xe8_function == ESpecialFunction::HUDTarget) x1c8_ = {{zeus::CVector3f(-1.f), zeus::CVector3f(1.f)}}; } diff --git a/Runtime/World/CScriptTrigger.cpp b/Runtime/World/CScriptTrigger.cpp index b3fd1f696..04c34d3ca 100644 --- a/Runtime/World/CScriptTrigger.cpp +++ b/Runtime/World/CScriptTrigger.cpp @@ -23,9 +23,9 @@ CScriptTrigger::CScriptTrigger(TUniqueId uid, const std::string& name, const CEn , x128_forceMagnitude(forceField.magnitude()) , x12c_flags(triggerFlags) , x130_bounds(bounds) -, x148_26_deactivateOnEntered(b2) -, x148_27_deactivateOnExited(b3) { + x148_26_deactivateOnEntered = b2; + x148_27_deactivateOnExited = b3; } void CScriptTrigger::Accept(IVisitor& visitor) diff --git a/Runtime/World/CWorldTransManager.hpp b/Runtime/World/CWorldTransManager.hpp index 72b1871ac..ac55a9852 100644 --- a/Runtime/World/CWorldTransManager.hpp +++ b/Runtime/World/CWorldTransManager.hpp @@ -99,7 +99,7 @@ private: void DrawText(); public: - CWorldTransManager() : x44_24_transFinished(true) {} + CWorldTransManager() { x44_24_transFinished = true; } void Update(float);