Runtime/Camera: Replace bitfield unions with constructor initializers

This commit is contained in:
Luke Street 2020-04-10 15:03:05 -04:00
parent 8e691d0f73
commit 496bb3e624
2 changed files with 14 additions and 22 deletions

View File

@ -21,9 +21,15 @@
namespace urde { namespace urde {
float CCameraManager::sFirstPersonFOV = 55.f; float CCameraManager::sFirstPersonFOV = 55.f;
CCameraManager::CCameraManager(TUniqueId curCameraId) : x0_curCameraId(curCameraId) { CCameraManager::CCameraManager(TUniqueId curCameraId)
CSfxManager::AddListener(CSfxManager::ESfxChannels::Game, zeus::skZero3f, zeus::skZero3f, : x0_curCameraId(curCameraId)
{1.f, 0.f, 0.f}, {0.f, 0.f, 1.f}, 50.f, 50.f, 1000.f, 1, 1.f); , 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(); sFirstPersonFOV = g_tweakGame->GetFirstPersonFOV();
} }

View File

@ -40,16 +40,9 @@ class CCameraManager {
float x94_fogDensityFactor = 1.f; float x94_fogDensityFactor = 1.f;
float x98_fogDensitySpeed = 0.f; float x98_fogDensitySpeed = 0.f;
float x9c_fogDensityFactorTarget = 1.f; float x9c_fogDensityFactorTarget = 1.f;
bool xa0_24_pendingRumble : 1;
union { bool xa0_25_rumbling : 1;
struct { bool xa0_26_inWater : 1;
bool xa0_24_pendingRumble : 1;
bool xa0_25_rumbling : 1;
bool xa0_26_inWater : 1;
};
u8 _dummy1 = 0;
};
TUniqueId xa2_spindleCamId = kInvalidUniqueId; TUniqueId xa2_spindleCamId = kInvalidUniqueId;
TUniqueId xa4_pathCamId = kInvalidUniqueId; TUniqueId xa4_pathCamId = kInvalidUniqueId;
TUniqueId xa6_camHintId = kInvalidUniqueId; TUniqueId xa6_camHintId = kInvalidUniqueId;
@ -57,15 +50,8 @@ class CCameraManager {
rstl::reserved_vector<std::pair<s32, TUniqueId>, 64> xac_cameraHints; rstl::reserved_vector<std::pair<s32, TUniqueId>, 64> xac_cameraHints;
rstl::reserved_vector<TUniqueId, 64> x2b0_inactiveCameraHints; rstl::reserved_vector<TUniqueId, 64> x2b0_inactiveCameraHints;
rstl::reserved_vector<TUniqueId, 64> x334_activeCameraHints; rstl::reserved_vector<TUniqueId, 64> x334_activeCameraHints;
bool x3b8_24_ : 1;
union { bool x3b8_25_ : 1;
struct {
bool x3b8_24_ : 1;
bool x3b8_25_ : 1;
};
u8 _dummy2;
};
float x3bc_curFov = 60.f; float x3bc_curFov = 60.f;
void SetPathCamera(TUniqueId id, CStateManager& mgr); void SetPathCamera(TUniqueId id, CStateManager& mgr);