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 {
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();
}

View File

@ -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<std::pair<s32, TUniqueId>, 64> xac_cameraHints;
rstl::reserved_vector<TUniqueId, 64> x2b0_inactiveCameraHints;
rstl::reserved_vector<TUniqueId, 64> 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);