From 496bb3e62459920ccfaef674953945d06eea3da0 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Fri, 10 Apr 2020 15:03:05 -0400 Subject: [PATCH] Runtime/Camera: Replace bitfield unions with constructor initializers --- Runtime/Camera/CCameraManager.cpp | 12 +++++++++--- Runtime/Camera/CCameraManager.hpp | 24 +++++------------------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/Runtime/Camera/CCameraManager.cpp b/Runtime/Camera/CCameraManager.cpp index a2fd101e7..f2a61f4f7 100644 --- a/Runtime/Camera/CCameraManager.cpp +++ b/Runtime/Camera/CCameraManager.cpp @@ -21,9 +21,15 @@ namespace urde { float CCameraManager::sFirstPersonFOV = 55.f; -CCameraManager::CCameraManager(TUniqueId curCameraId) : x0_curCameraId(curCameraId) { - CSfxManager::AddListener(CSfxManager::ESfxChannels::Game, zeus::skZero3f, zeus::skZero3f, - {1.f, 0.f, 0.f}, {0.f, 0.f, 1.f}, 50.f, 50.f, 1000.f, 1, 1.f); +CCameraManager::CCameraManager(TUniqueId curCameraId) +: x0_curCameraId(curCameraId) +, xa0_24_pendingRumble(false) +, xa0_25_rumbling(false) +, xa0_26_inWater(false) +, x3b8_24_(false) +, x3b8_25_(false) { + CSfxManager::AddListener(CSfxManager::ESfxChannels::Game, zeus::skZero3f, zeus::skZero3f, {1.f, 0.f, 0.f}, + {0.f, 0.f, 1.f}, 50.f, 50.f, 1000.f, 1, 1.f); sFirstPersonFOV = g_tweakGame->GetFirstPersonFOV(); } diff --git a/Runtime/Camera/CCameraManager.hpp b/Runtime/Camera/CCameraManager.hpp index 7268b6bf8..60b5edd40 100644 --- a/Runtime/Camera/CCameraManager.hpp +++ b/Runtime/Camera/CCameraManager.hpp @@ -40,16 +40,9 @@ class CCameraManager { float x94_fogDensityFactor = 1.f; float x98_fogDensitySpeed = 0.f; float x9c_fogDensityFactorTarget = 1.f; - - union { - struct { - bool xa0_24_pendingRumble : 1; - bool xa0_25_rumbling : 1; - bool xa0_26_inWater : 1; - }; - u8 _dummy1 = 0; - }; - + bool xa0_24_pendingRumble : 1; + bool xa0_25_rumbling : 1; + bool xa0_26_inWater : 1; TUniqueId xa2_spindleCamId = kInvalidUniqueId; TUniqueId xa4_pathCamId = kInvalidUniqueId; TUniqueId xa6_camHintId = kInvalidUniqueId; @@ -57,15 +50,8 @@ class CCameraManager { rstl::reserved_vector, 64> xac_cameraHints; rstl::reserved_vector x2b0_inactiveCameraHints; rstl::reserved_vector x334_activeCameraHints; - - union { - struct { - bool x3b8_24_ : 1; - bool x3b8_25_ : 1; - }; - u8 _dummy2; - }; - + bool x3b8_24_ : 1; + bool x3b8_25_ : 1; float x3bc_curFov = 60.f; void SetPathCamera(TUniqueId id, CStateManager& mgr);