Merge pull request #304 from AxioDL/remove-union-bitfields

Runtime: Replace bitfield unions with explicit initializers
This commit is contained in:
Luke Street 2020-04-11 02:12:21 -04:00 committed by GitHub
commit 304340bd35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
180 changed files with 1493 additions and 1634 deletions

View File

@ -446,14 +446,9 @@ public:
private: private:
dspadpcm_header x0_header; dspadpcm_header x0_header;
std::string x60_fileName; // arg1 std::string x60_fileName; // arg1
union {
u32 dummy = 0;
struct {
bool x70_24_unclaimed : 1; bool x70_24_unclaimed : 1;
bool x70_25_headerReadCancelled : 1; bool x70_25_headerReadCancelled : 1;
u8 x70_26_headerReadState : 2; // 0: not read 1: reading 2: read u8 x70_26_headerReadState : 2; // 0: not read 1: reading 2: read
};
};
s8 x71_companionRight = -1; s8 x71_companionRight = -1;
s8 x72_companionLeft = -1; s8 x72_companionLeft = -1;
float x73_volume = 0.f; float x73_volume = 0.f;
@ -465,13 +460,16 @@ private:
static std::array<CDSPStreamManager, 4> g_Streams; static std::array<CDSPStreamManager, 4> g_Streams;
public: public:
CDSPStreamManager() { x70_24_unclaimed = true; } CDSPStreamManager() : x70_24_unclaimed(true), x70_25_headerReadCancelled(false), x70_26_headerReadState(0) {}
CDSPStreamManager(std::string_view fileName, s32 handle, float volume, bool oneshot) CDSPStreamManager(std::string_view fileName, s32 handle, float volume, bool oneshot)
: x60_fileName(fileName), x73_volume(volume), x74_oneshot(oneshot), x78_handleId(handle) { : x60_fileName(fileName)
if (!CDvdFile::FileExists(fileName)) , x70_24_unclaimed(!CDvdFile::FileExists(fileName))
x70_24_unclaimed = true; , x70_25_headerReadCancelled(false)
} , x70_26_headerReadState(0)
, x73_volume(volume)
, x74_oneshot(oneshot)
, x78_handleId(handle) {}
static s32 FindUnclaimedStreamIdx() { static s32 FindUnclaimedStreamIdx() {
for (size_t i = 0; i < g_Streams.size(); ++i) { for (size_t i = 0; i < g_Streams.size(); ++i) {

View File

@ -212,10 +212,12 @@ void CGameOptions::PutTo(CBitStreamWriter& writer) const {
writer.WriteEncoded(x68_27_swapBeamsControls, 1); writer.WriteEncoded(x68_27_swapBeamsControls, 1);
} }
CGameOptions::CGameOptions() { CGameOptions::CGameOptions()
x68_24_hudLag = true; : x68_24_hudLag(true)
x68_26_rumble = true; , x68_25_invertY(false)
x68_28_hintSystem = true; , x68_26_rumble(true)
, x68_27_swapBeamsControls(false)
, x68_28_hintSystem(true) {
InitSoundMode(); InitSoundMode();
} }

View File

@ -56,21 +56,21 @@ class CPersistentOptions {
u32 xc4_frozenBallCount = 0; u32 xc4_frozenBallCount = 0;
u32 xc8_powerBombAmmoCount = 0; u32 xc8_powerBombAmmoCount = 0;
u32 xcc_logScanPercent = 0; u32 xcc_logScanPercent = 0;
union {
struct {
bool xd0_24_fusionLinked : 1; bool xd0_24_fusionLinked : 1;
bool xd0_25_normalModeBeat : 1; bool xd0_25_normalModeBeat : 1;
bool xd0_26_hardModeBeat : 1; bool xd0_26_hardModeBeat : 1;
bool xd0_27_fusionBeat : 1; bool xd0_27_fusionBeat : 1;
bool xd0_28_fusionSuitActive : 1; bool xd0_28_fusionSuitActive : 1;
bool xd0_29_allItemsCollected : 1; bool xd0_29_allItemsCollected : 1;
};
u16 _dummy = 0;
};
public: public:
CPersistentOptions() = default; CPersistentOptions()
: xd0_24_fusionLinked(false)
, xd0_25_normalModeBeat(false)
, xd0_26_hardModeBeat(false)
, xd0_27_fusionBeat(false)
, xd0_28_fusionSuitActive(false)
, xd0_29_allItemsCollected(false) {}
explicit CPersistentOptions(CBitStreamReader& stream); explicit CPersistentOptions(CBitStreamReader& stream);
bool GetCinematicState(CAssetId mlvlId, TEditorId cineId) const; bool GetCinematicState(CAssetId mlvlId, TEditorId cineId) const;
@ -116,22 +116,15 @@ class CGameOptions {
u32 x5c_musicVol = 0x7f; u32 x5c_musicVol = 0x7f;
u32 x60_hudAlpha = 0xff; u32 x60_hudAlpha = 0xff;
u32 x64_helmetAlpha = 0xff; u32 x64_helmetAlpha = 0xff;
s32 m_gamma = 0;
union {
struct {
bool x68_24_hudLag : 1; bool x68_24_hudLag : 1;
bool x68_25_invertY : 1; bool x68_25_invertY : 1;
bool x68_26_rumble : 1; bool x68_26_rumble : 1;
bool x68_27_swapBeamsControls : 1; bool x68_27_swapBeamsControls : 1;
bool x68_28_hintSystem : 1; bool x68_28_hintSystem : 1;
};
u16 _dummy = 0;
};
std::vector<std::pair<CAssetId, CAssetId>> x6c_controlTxtrMap; std::vector<std::pair<CAssetId, CAssetId>> x6c_controlTxtrMap;
s32 m_gamma = 0;
public: public:
CGameOptions(); CGameOptions();
explicit CGameOptions(CBitStreamReader& stream); explicit CGameOptions(CBitStreamReader& stream);

View File

@ -137,6 +137,7 @@ CGameState::GameFileStateInfo CGameState::LoadGameFileState(const u8* data) {
CGameState::CGameState() { CGameState::CGameState() {
x98_playerState = std::make_shared<CPlayerState>(); x98_playerState = std::make_shared<CPlayerState>();
x9c_transManager = std::make_shared<CWorldTransManager>(); x9c_transManager = std::make_shared<CWorldTransManager>();
x228_24_hardMode = false;
x228_25_initPowerupsAtFirstSpawn = true; x228_25_initPowerupsAtFirstSpawn = true;
if (g_MemoryCardSys) if (g_MemoryCardSys)
InitializeMemoryStates(); InitializeMemoryStates();
@ -144,6 +145,7 @@ CGameState::CGameState() {
CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx) : x20c_saveFileIdx(saveIdx) { CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx) : x20c_saveFileIdx(saveIdx) {
x9c_transManager = std::make_shared<CWorldTransManager>(); x9c_transManager = std::make_shared<CWorldTransManager>();
x228_24_hardMode = false;
x228_25_initPowerupsAtFirstSpawn = true; x228_25_initPowerupsAtFirstSpawn = true;
for (bool& value : x0_) { for (bool& value : x0_) {

View File

@ -81,14 +81,8 @@ class CGameState {
u32 x20c_saveFileIdx = 0; u32 x20c_saveFileIdx = 0;
u64 x210_cardSerial = 0; u64 x210_cardSerial = 0;
std::vector<u8> x218_backupBuf; std::vector<u8> x218_backupBuf;
union {
struct {
bool x228_24_hardMode : 1; bool x228_24_hardMode : 1;
bool x228_25_initPowerupsAtFirstSpawn : 1; bool x228_25_initPowerupsAtFirstSpawn : 1;
};
u8 _dummy = 0;
};
public: public:
CGameState(); CGameState();

View File

@ -8,6 +8,7 @@ CPakFile::CPakFile(std::string_view filename, bool buildDepList, bool worldPak,
Log.report(logvisor::Fatal, fmt("{}: Unable to open"), GetPath()); Log.report(logvisor::Fatal, fmt("{}: Unable to open"), GetPath());
x28_24_buildDepList = buildDepList; x28_24_buildDepList = buildDepList;
//x28_24_buildDepList = true; // Always do this so URDE can rapidly pre-warm shaders //x28_24_buildDepList = true; // Always do this so URDE can rapidly pre-warm shaders
x28_25_aramFile = false;
x28_26_worldPak = worldPak; x28_26_worldPak = worldPak;
x28_27_stashedInARAM = false; x28_27_stashedInARAM = false;
m_override = override; m_override = override;

View File

@ -36,16 +36,11 @@ public:
}; };
private: private:
union {
struct {
bool x28_24_buildDepList : 1; bool x28_24_buildDepList : 1;
bool x28_25_aramFile : 1; bool x28_25_aramFile : 1;
bool x28_26_worldPak : 1; bool x28_26_worldPak : 1;
bool x28_27_stashedInARAM : 1; bool x28_27_stashedInARAM : 1;
bool m_override : 1; bool m_override : 1;
};
u32 _dummy = 0;
};
enum class EAsyncPhase { enum class EAsyncPhase {
Warmup = 0, Warmup = 0,
InitialHeader = 1, InitialHeader = 1,

View File

@ -74,13 +74,13 @@ constexpr std::array<float, 5> ComboAmmoPeriods{
}; };
} // Anonymous namespace } // Anonymous namespace
CPlayerState::CPlayerState() : x188_staticIntf(5) { CPlayerState::CPlayerState()
x0_24_alive = true; : x0_24_alive(true), x0_25_firingComboBeam(false), x0_26_fusion(false), x188_staticIntf(5) {
x24_powerups.resize(41); x24_powerups.resize(41);
} }
CPlayerState::CPlayerState(CBitStreamReader& stream) : x188_staticIntf(5) { CPlayerState::CPlayerState(CBitStreamReader& stream)
x0_24_alive = true; : x0_24_alive(true), x0_25_firingComboBeam(false), x0_26_fusion(false), x188_staticIntf(5) {
x4_enabledItems = u32(stream.ReadEncoded(32)); x4_enabledItems = u32(stream.ReadEncoded(32));
const u32 integralHP = u32(stream.ReadEncoded(32)); const u32 integralHP = u32(stream.ReadEncoded(32));

View File

@ -94,15 +94,9 @@ private:
constexpr CPowerUp() = default; constexpr CPowerUp() = default;
constexpr CPowerUp(u32 amount, u32 capacity) : x0_amount(amount), x4_capacity(capacity) {} constexpr CPowerUp(u32 amount, u32 capacity) : x0_amount(amount), x4_capacity(capacity) {}
}; };
union {
struct {
bool x0_24_alive : 1; bool x0_24_alive : 1;
bool x0_25_firingComboBeam : 1; bool x0_25_firingComboBeam : 1;
bool x0_26_fusion : 1; bool x0_26_fusion : 1;
};
u32 dummy = 0;
};
u32 x4_enabledItems = 0; u32 x4_enabledItems = 0;
EBeamId x8_currentBeam = EBeamId::Power; EBeamId x8_currentBeam = EBeamId::Power;
CHealthInfo xc_health = {99.f, 50.f}; CHealthInfo xc_health = {99.f, 50.f};

View File

@ -62,7 +62,14 @@ CStateManager::CStateManager(const std::weak_ptr<CRelayTracker>& relayTracker,
, x8bc_relayTracker(relayTracker) , x8bc_relayTracker(relayTracker)
, x8c0_mapWorldInfo(mwInfo) , x8c0_mapWorldInfo(mwInfo)
, x8c4_worldTransManager(wtMgr) , x8c4_worldTransManager(wtMgr)
, x8c8_worldLayerState(layerState) { , x8c8_worldLayerState(layerState)
, xf94_24_readyToRender(false)
, xf94_25_quitGame(false)
, xf94_26_generatingObject(false)
, xf94_27_inMapScreen(false)
, xf94_28_inSaveUI(false)
, xf94_29_cinematicPause(false)
, xf94_30_fullThreat(false) {
x86c_stateManagerContainer = std::make_unique<CStateManagerContainer>(); x86c_stateManagerContainer = std::make_unique<CStateManagerContainer>();
x870_cameraManager = &x86c_stateManagerContainer->x0_cameraManager; x870_cameraManager = &x86c_stateManagerContainer->x0_cameraManager;
x874_sortedListManager = &x86c_stateManagerContainer->x3c0_sortedListManager; x874_sortedListManager = &x86c_stateManagerContainer->x3c0_sortedListManager;

View File

@ -202,9 +202,6 @@ private:
CAssetId xf88_; CAssetId xf88_;
float xf8c_ = 0.f; float xf8c_ = 0.f;
EStateManagerTransition xf90_deferredTransition = EStateManagerTransition::InGame; EStateManagerTransition xf90_deferredTransition = EStateManagerTransition::InGame;
union {
struct {
bool xf94_24_readyToRender : 1; bool xf94_24_readyToRender : 1;
bool xf94_25_quitGame : 1; bool xf94_25_quitGame : 1;
bool xf94_26_generatingObject : 1; bool xf94_26_generatingObject : 1;
@ -212,9 +209,6 @@ private:
bool xf94_28_inSaveUI : 1; bool xf94_28_inSaveUI : 1;
bool xf94_29_cinematicPause : 1; bool xf94_29_cinematicPause : 1;
bool xf94_30_fullThreat : 1; bool xf94_30_fullThreat : 1;
};
u32 xf94_ = 0;
};
CColoredQuadFilter m_deathWhiteout{EFilterType::Add}; CColoredQuadFilter m_deathWhiteout{EFilterType::Add};
CColoredQuadFilter m_escapeWhiteout{EFilterType::Add}; CColoredQuadFilter m_escapeWhiteout{EFilterType::Add};

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;
union {
struct {
bool xa0_24_pendingRumble : 1; bool xa0_24_pendingRumble : 1;
bool xa0_25_rumbling : 1; bool xa0_25_rumbling : 1;
bool xa0_26_inWater : 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;
union {
struct {
bool x3b8_24_ : 1; bool x3b8_24_ : 1;
bool x3b8_25_ : 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);

View File

@ -18,20 +18,22 @@ s32 CActorLights::sFrameSchedulerCount = 0;
CActorLights::CActorLights(u32 areaUpdateFramePeriod, const zeus::CVector3f& actorPosBias, int maxDynamicLights, CActorLights::CActorLights(u32 areaUpdateFramePeriod, const zeus::CVector3f& actorPosBias, int maxDynamicLights,
int maxAreaLights, bool ambientChannelOverflow, bool layer2, bool disableWorldLights, int maxAreaLights, bool ambientChannelOverflow, bool layer2, bool disableWorldLights,
float positionUpdateThreshold) float positionUpdateThreshold)
: x2a8_areaUpdateFramePeriod(areaUpdateFramePeriod) : x298_24_dirty(true)
, x298_25_castShadows(true)
, x298_26_hasAreaLights(false)
, x298_27_findShadowLight(false)
, x298_28_inArea(!disableWorldLights && maxAreaLights > 0)
, x298_29_ambienceGenerated(ambientChannelOverflow)
, x298_30_layer2(layer2)
, x298_31_disableWorldLights(disableWorldLights)
, x299_24_inBrightLight(true)
, x299_25_useBrightLightLag(false)
, x299_26_ambientOnly(false)
, x2a8_areaUpdateFramePeriod(areaUpdateFramePeriod)
, x2ac_actorPosBias(actorPosBias) , x2ac_actorPosBias(actorPosBias)
, x2b8_maxAreaLights(maxAreaLights) , x2b8_maxAreaLights(maxAreaLights)
, x2bc_maxDynamicLights(maxDynamicLights) , x2bc_maxDynamicLights(maxDynamicLights)
, x2cc_actorPositionDeltaUpdateThreshold(positionUpdateThreshold * positionUpdateThreshold) { , x2cc_actorPositionDeltaUpdateThreshold(positionUpdateThreshold * positionUpdateThreshold) {
x298_24_dirty = true;
x298_25_castShadows = true;
x298_28_inArea = !disableWorldLights && maxAreaLights > 0;
x298_29_ambienceGenerated = ambientChannelOverflow;
x298_30_layer2 = layer2;
x298_31_disableWorldLights = disableWorldLights;
x299_24_inBrightLight = true;
sFrameSchedulerCount++; sFrameSchedulerCount++;
sFrameSchedulerCount &= 7; sFrameSchedulerCount &= 7;
} }

View File

@ -20,9 +20,6 @@ class CActorLights {
std::vector<CLight> x144_dynamicLights; std::vector<CLight> x144_dynamicLights;
zeus::CColor x288_ambientColor = zeus::skBlack; zeus::CColor x288_ambientColor = zeus::skBlack;
TAreaId x294_aid = kInvalidAreaId; TAreaId x294_aid = kInvalidAreaId;
union {
struct {
bool x298_24_dirty : 1; bool x298_24_dirty : 1;
bool x298_25_castShadows : 1; bool x298_25_castShadows : 1;
bool x298_26_hasAreaLights : 1; bool x298_26_hasAreaLights : 1;
@ -34,9 +31,6 @@ class CActorLights {
bool x299_24_inBrightLight : 1; bool x299_24_inBrightLight : 1;
bool x299_25_useBrightLightLag : 1; bool x299_25_useBrightLightLag : 1;
bool x299_26_ambientOnly : 1; bool x299_26_ambientOnly : 1;
};
u16 _dummy = 0;
};
bool x29a_findNearestDynamicLights = false; bool x29a_findNearestDynamicLights = false;
s32 x29c_shadowLightArrIdx = -1; s32 x29c_shadowLightArrIdx = -1;
s32 x2a0_shadowLightIdx = -1; s32 x2a0_shadowLightIdx = -1;

View File

@ -45,9 +45,9 @@ CAnimData::CAnimData(CAssetId id, const CCharacterInfo& character, int defaultAn
const std::weak_ptr<CAnimSysContext>& ctx, std::shared_ptr<CAnimationManager> animMgr, const std::weak_ptr<CAnimSysContext>& ctx, std::shared_ptr<CAnimationManager> animMgr,
std::shared_ptr<CTransitionManager> transMgr, TLockedToken<CCharacterFactory> charFactory, std::shared_ptr<CTransitionManager> transMgr, TLockedToken<CCharacterFactory> charFactory,
int drawInstCount) int drawInstCount)
: x0_charFactory(std::move(charFactory)) : x0_charFactory(charFactory)
, xc_charInfo(character) , xc_charInfo(character)
, xcc_layoutData(std::move(layout)) , xcc_layoutData(layout)
, xd8_modelData(std::move(model)) , xd8_modelData(std::move(model))
, xfc_animCtx(ctx.lock()) , xfc_animCtx(ctx.lock())
, x100_animMgr(std::move(animMgr)) , x100_animMgr(std::move(animMgr))
@ -55,6 +55,14 @@ CAnimData::CAnimData(CAssetId id, const CCharacterInfo& character, int defaultAn
, x1fc_transMgr(std::move(transMgr)) , x1fc_transMgr(std::move(transMgr))
, x204_charIdx(charIdx) , x204_charIdx(charIdx)
, x208_defaultAnim(defaultAnim) , x208_defaultAnim(defaultAnim)
, x220_24_animating(false)
, x220_25_loop(false)
, x220_26_aligningPos(false)
, x220_27_(false)
, x220_28_(false)
, x220_29_animationJustStarted(false)
, x220_30_poseBuilt(false)
, x220_31_poseCached(false)
, x224_pose(layout->GetSegIdList().GetList().size()) , x224_pose(layout->GetSegIdList().GetList().size())
, x2fc_poseBuilder(CLayoutDescription{layout}) , x2fc_poseBuilder(CLayoutDescription{layout})
, m_drawInstCount(drawInstCount) { , m_drawInstCount(drawInstCount) {

View File

@ -124,10 +124,6 @@ private:
u32 x214_passedParticleCount = 0; u32 x214_passedParticleCount = 0;
u32 x218_passedSoundCount = 0; u32 x218_passedSoundCount = 0;
s32 x21c_particleLightIdx = 0; s32 x21c_particleLightIdx = 0;
union {
u32 x220_flags = 0;
struct {
bool x220_24_animating : 1; bool x220_24_animating : 1;
bool x220_25_loop : 1; bool x220_25_loop : 1;
bool x220_26_aligningPos : 1; bool x220_26_aligningPos : 1;
@ -136,9 +132,6 @@ private:
bool x220_29_animationJustStarted : 1; bool x220_29_animationJustStarted : 1;
bool x220_30_poseBuilt : 1; bool x220_30_poseBuilt : 1;
bool x220_31_poseCached : 1; bool x220_31_poseCached : 1;
};
};
CPoseAsTransforms x224_pose; CPoseAsTransforms x224_pose;
CHierarchyPoseBuilder x2fc_poseBuilder; CHierarchyPoseBuilder x2fc_poseBuilder;

View File

@ -12,8 +12,15 @@
namespace urde { namespace urde {
CBodyController::CBodyController(CActor& actor, float turnSpeed, EBodyType bodyType) CBodyController::CBodyController(CActor& actor, float turnSpeed, EBodyType bodyType)
: x0_actor(actor), x2a4_bodyStateInfo(actor, bodyType), x2f4_bodyType(bodyType), x2fc_turnSpeed(turnSpeed) { : x0_actor(actor)
x300_28_playDeathAnims = true; , x2a4_bodyStateInfo(actor, bodyType)
, x2f4_bodyType(bodyType)
, x2fc_turnSpeed(turnSpeed)
, x300_24_animationOver(false)
, x300_25_active(false)
, x300_26_frozen(false)
, x300_27_hasBeenFrozen(false)
, x300_28_playDeathAnims(true) {
x2a4_bodyStateInfo.x18_bodyController = this; x2a4_bodyStateInfo.x18_bodyController = this;
} }

View File

@ -28,16 +28,11 @@ class CBodyController {
EBodyType x2f4_bodyType; EBodyType x2f4_bodyType;
s32 x2f8_curAnim = -1; s32 x2f8_curAnim = -1;
float x2fc_turnSpeed; float x2fc_turnSpeed;
union {
struct {
bool x300_24_animationOver : 1; bool x300_24_animationOver : 1;
bool x300_25_active : 1; bool x300_25_active : 1;
bool x300_26_frozen : 1; bool x300_26_frozen : 1;
bool x300_27_hasBeenFrozen : 1; bool x300_27_hasBeenFrozen : 1;
bool x300_28_playDeathAnims : 1; bool x300_28_playDeathAnims : 1;
};
u32 _dummy = 0;
};
float x304_intoFreezeDur = 0.f; float x304_intoFreezeDur = 0.f;
float x308_frozenDur = 0.f; float x308_frozenDur = 0.f;
float x30c_breakoutDur = 0.f; float x30c_breakoutDur = 0.f;

View File

@ -202,22 +202,23 @@ class CBSJump : public CBodyState {
zeus::CVector3f xc_waypoint1; zeus::CVector3f xc_waypoint1;
zeus::CVector3f x18_velocity; zeus::CVector3f x18_velocity;
zeus::CVector3f x24_waypoint2; zeus::CVector3f x24_waypoint2;
union {
struct {
bool x30_24_bodyForceSet : 1; bool x30_24_bodyForceSet : 1;
bool x30_25_wallJump : 1; bool x30_25_wallJump : 1;
bool x30_26_wallBounceRight : 1; bool x30_26_wallBounceRight : 1;
bool x30_27_wallBounceComplete : 1; bool x30_27_wallBounceComplete : 1;
bool x30_28_startInJumpLoop : 1; bool x30_28_startInJumpLoop : 1;
};
u32 _dummy = 0;
};
pas::EAnimationState GetBodyStateTransition(float dt, const CBodyController& bc) const; pas::EAnimationState GetBodyStateTransition(float dt, const CBodyController& bc) const;
bool CheckForWallJump(CBodyController& bc, CStateManager& mgr); bool CheckForWallJump(CBodyController& bc, CStateManager& mgr);
void CheckForLand(CBodyController& bc, CStateManager& mgr); void CheckForLand(CBodyController& bc, CStateManager& mgr);
void PlayJumpLoop(CStateManager& mgr, CBodyController& bc); void PlayJumpLoop(CStateManager& mgr, CBodyController& bc);
public: public:
CBSJump()
: x30_24_bodyForceSet(false)
, x30_25_wallJump(false)
, x30_26_wallBounceRight(false)
, x30_27_wallBounceComplete(false)
, x30_28_startInJumpLoop(false) {}
bool IsMoving() const override { return true; } bool IsMoving() const override { return true; }
bool ApplyHeadTracking() const override { return false; } bool ApplyHeadTracking() const override { return false; }
bool CanShoot() const override; bool CanShoot() const override;
@ -277,17 +278,13 @@ public:
}; };
class CBSScripted : public CBodyState { class CBSScripted : public CBodyState {
union {
struct {
bool x4_24_loopAnim : 1; bool x4_24_loopAnim : 1;
bool x4_25_timedLoop : 1; bool x4_25_timedLoop : 1;
};
u32 _dummy = 0;
};
float x8_remTime = 0.f; float x8_remTime = 0.f;
pas::EAnimationState GetBodyStateTransition(float dt, const CBodyController& bc) const; pas::EAnimationState GetBodyStateTransition(float dt, const CBodyController& bc) const;
public: public:
CBSScripted() : x4_24_loopAnim(false), x4_25_timedLoop(false) {}
bool ApplyHeadTracking() const override { return false; } bool ApplyHeadTracking() const override { return false; }
void Start(CBodyController& bc, CStateManager& mgr) override; void Start(CBodyController& bc, CStateManager& mgr) override;
pas::EAnimationState UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) override; pas::EAnimationState UpdateBody(float dt, CBodyController& bc, CStateManager& mgr) override;
@ -313,13 +310,8 @@ class CBSWallHang : public CBodyState {
pas::EWallHangState x4_state = pas::EWallHangState::Invalid; pas::EWallHangState x4_state = pas::EWallHangState::Invalid;
TUniqueId x8_wpId = kInvalidUniqueId; TUniqueId x8_wpId = kInvalidUniqueId;
zeus::CVector3f xc_launchVel; zeus::CVector3f xc_launchVel;
union {
struct {
bool x18_24_launched : 1; bool x18_24_launched : 1;
bool x18_25_needsExit : 1; bool x18_25_needsExit : 1;
};
u32 _dummy = 0;
};
pas::EAnimationState GetBodyStateTransition(float dt, const CBodyController& bc) const; pas::EAnimationState GetBodyStateTransition(float dt, const CBodyController& bc) const;
void FixInPlace(CBodyController& bc); void FixInPlace(CBodyController& bc);
bool CheckForLand(CBodyController& bc, CStateManager& mgr); bool CheckForLand(CBodyController& bc, CStateManager& mgr);
@ -327,6 +319,7 @@ class CBSWallHang : public CBodyState {
void SetLaunchVelocity(CBodyController& bc); void SetLaunchVelocity(CBodyController& bc);
public: public:
CBSWallHang() : x18_24_launched(false), x18_25_needsExit(false) {}
bool IsMoving() const override { return true; } bool IsMoving() const override { return true; }
bool CanShoot() const override { return x4_state == pas::EWallHangState::WallHang; } bool CanShoot() const override { return x4_state == pas::EWallHangState::WallHang; }
bool IsInAir(const CBodyController& bc) const override; bool IsInAir(const CBodyController& bc) const override;

View File

@ -15,6 +15,8 @@ CBoneTracking::CBoneTracking(const CAnimData& animData, std::string_view bone,
: x14_segId(animData.GetCharLayoutInfo().GetSegIdFromString(bone)) : x14_segId(animData.GetCharLayoutInfo().GetSegIdFromString(bone))
, x1c_maxTrackingAngle(maxTrackingAngle) , x1c_maxTrackingAngle(maxTrackingAngle)
, x20_angSpeed(angSpeed) , x20_angSpeed(angSpeed)
, x36_24_active(false)
, x36_25_hasTrackedRotation(false)
, x36_26_noParent(True(flags & EBoneTrackingFlags::NoParent)) , x36_26_noParent(True(flags & EBoneTrackingFlags::NoParent))
, x36_27_noParentOrigin(True(flags & EBoneTrackingFlags::NoParentOrigin)) , x36_27_noParentOrigin(True(flags & EBoneTrackingFlags::NoParentOrigin))
, x36_28_noHorizontalAim(True(flags & EBoneTrackingFlags::NoHorizontalAim)) , x36_28_noHorizontalAim(True(flags & EBoneTrackingFlags::NoHorizontalAim))

View File

@ -33,17 +33,12 @@ class CBoneTracking {
float x20_angSpeed; float x20_angSpeed;
std::optional<zeus::CVector3f> x24_targetPosition; std::optional<zeus::CVector3f> x24_targetPosition;
TUniqueId x34_target = kInvalidUniqueId; TUniqueId x34_target = kInvalidUniqueId;
union {
struct {
bool x36_24_active : 1; bool x36_24_active : 1;
bool x36_25_hasTrackedRotation : 1; bool x36_25_hasTrackedRotation : 1;
bool x36_26_noParent : 1; bool x36_26_noParent : 1;
bool x36_27_noParentOrigin : 1; bool x36_27_noParentOrigin : 1;
bool x36_28_noHorizontalAim : 1; bool x36_28_noHorizontalAim : 1;
bool x36_29_parentIk : 1; bool x36_29_parentIk : 1;
};
u32 _dummy = 0;
};
public: public:
CBoneTracking(const CAnimData& animData, std::string_view bone, CBoneTracking(const CAnimData& animData, std::string_view bone,

View File

@ -21,16 +21,10 @@ class CIkChain {
zeus::CQuaternion x24_holdRot; zeus::CQuaternion x24_holdRot;
zeus::CVector3f x34_holdPos; zeus::CVector3f x34_holdPos;
float x40_time = 0.f; float x40_time = 0.f;
union {
struct {
bool x44_24_activated : 1; bool x44_24_activated : 1;
};
u32 x44_dummy = 0;
};
public: public:
CIkChain() = default; CIkChain() : x44_24_activated(false) {}
bool GetActive() const { return x44_24_activated; } bool GetActive() const { return x44_24_activated; }
void Update(float); void Update(float);

View File

@ -25,14 +25,16 @@ CModelData::~CModelData() = default;
CModelData::CModelData() {} CModelData::CModelData() {}
CModelData CModelData::CModelDataNull() { return CModelData(); } CModelData CModelData::CModelDataNull() { return CModelData(); }
CModelData::CModelData(const CStaticRes& res, int instCount) : x0_scale(res.GetScale()), m_drawInstCount(instCount) { CModelData::CModelData(const CStaticRes& res, int instCount)
: x0_scale(res.GetScale()), x14_24_renderSorted(false), x14_25_sortThermal(false), m_drawInstCount(instCount) {
x1c_normalModel = g_SimplePool->GetObj({SBIG('CMDL'), res.GetId()}); x1c_normalModel = g_SimplePool->GetObj({SBIG('CMDL'), res.GetId()});
if (!x1c_normalModel) if (!x1c_normalModel)
Log.report(logvisor::Fatal, fmt("unable to find CMDL {}"), res.GetId()); Log.report(logvisor::Fatal, fmt("unable to find CMDL {}"), res.GetId());
m_normalModelInst = x1c_normalModel->MakeNewInstance(0, instCount); m_normalModelInst = x1c_normalModel->MakeNewInstance(0, instCount);
} }
CModelData::CModelData(const CAnimRes& res, int instCount) : x0_scale(res.GetScale()), m_drawInstCount(instCount) { CModelData::CModelData(const CAnimRes& res, int instCount)
: x0_scale(res.GetScale()), x14_24_renderSorted(false), x14_25_sortThermal(false), m_drawInstCount(instCount) {
TToken<CCharacterFactory> factory = g_CharFactoryBuilder->GetFactory(res); TToken<CCharacterFactory> factory = g_CharFactoryBuilder->GetFactory(res);
x10_animData = x10_animData =
factory->CreateCharacter(res.GetCharacterNodeId(), res.CanLoop(), factory, res.GetDefaultAnim(), instCount); factory->CreateCharacter(res.GetCharacterNodeId(), res.CanLoop(), factory, res.GetDefaultAnim(), instCount);

View File

@ -62,13 +62,8 @@ class CModelData {
zeus::CVector3f x0_scale; zeus::CVector3f x0_scale;
bool xc_ = false; bool xc_ = false;
std::unique_ptr<CAnimData> x10_animData; std::unique_ptr<CAnimData> x10_animData;
union {
struct {
bool x14_24_renderSorted : 1; bool x14_24_renderSorted : 1;
bool x14_25_sortThermal : 1; bool x14_25_sortThermal : 1;
};
u32 _flags = 0;
};
zeus::CColor x18_ambientColor; zeus::CColor x18_ambientColor;
TLockedToken<CModel> x1c_normalModel; TLockedToken<CModel> x1c_normalModel;

View File

@ -59,11 +59,15 @@ void CRagDoll::CRagDollPlaneConstraint::Update() {
} }
CRagDoll::CRagDoll(float normalGravity, float floatingGravity, float overTime, u32 flags) CRagDoll::CRagDoll(float normalGravity, float floatingGravity, float overTime, u32 flags)
: x44_normalGravity(normalGravity), x48_floatingGravity(floatingGravity), x50_overTimer(overTime) { : x44_normalGravity(normalGravity)
x68_27_continueSmallMovements = bool(flags & 0x1); , x48_floatingGravity(floatingGravity)
x68_28_noOverTimer = bool(flags & 0x2); , x50_overTimer(overTime)
x68_29_noAiCollision = bool(flags & 0x4); , x68_24_prevMovingSlowly(false)
} , x68_25_over(false)
, x68_26_primed(false)
, x68_27_continueSmallMovements(bool(flags & 0x1))
, x68_28_noOverTimer(bool(flags & 0x2))
, x68_29_noAiCollision(bool(flags & 0x4)) {}
void CRagDoll::AccumulateForces(float dt, float waterTop) { void CRagDoll::AccumulateForces(float dt, float waterTop) {
float fps = 1.f / dt; float fps = 1.f / dt;

View File

@ -94,17 +94,12 @@ protected:
float x54_impactVel = 0.f; float x54_impactVel = 0.f;
zeus::CVector3f x58_averageVel; zeus::CVector3f x58_averageVel;
float x64_angTimer = 0.f; float x64_angTimer = 0.f;
union {
struct {
bool x68_24_prevMovingSlowly : 1; bool x68_24_prevMovingSlowly : 1;
bool x68_25_over : 1; bool x68_25_over : 1;
bool x68_26_primed : 1; bool x68_26_primed : 1;
bool x68_27_continueSmallMovements : 1; bool x68_27_continueSmallMovements : 1;
bool x68_28_noOverTimer : 1; bool x68_28_noOverTimer : 1;
bool x68_29_noAiCollision : 1; bool x68_29_noAiCollision : 1;
};
u32 _dummy = 0;
};
void AccumulateForces(float dt, float waterTop); void AccumulateForces(float dt, float waterTop);
void SetNumParticles(int num) { x4_particles.reserve(num); } void SetNumParticles(int num) { x4_particles.reserve(num); }
void AddParticle(CSegId id, const zeus::CVector3f& prevPos, const zeus::CVector3f& curPos, float radius); void AddParticle(CSegId id, const zeus::CVector3f& prevPos, const zeus::CVector3f& curPos, float radius);

View File

@ -173,16 +173,12 @@ public:
class CAreaCollisionCache { class CAreaCollisionCache {
zeus::CAABox x0_aabb; zeus::CAABox x0_aabb;
rstl::reserved_vector<CMetroidAreaCollider::COctreeLeafCache, 3> x18_leafCaches; rstl::reserved_vector<CMetroidAreaCollider::COctreeLeafCache, 3> x18_leafCaches;
union {
struct {
bool x1b40_24_leafOverflow : 1; bool x1b40_24_leafOverflow : 1;
bool x1b40_25_cacheOverflow : 1; bool x1b40_25_cacheOverflow : 1;
};
u32 _dummy = 0;
};
public: public:
explicit CAreaCollisionCache(const zeus::CAABox& aabb) : x0_aabb(aabb) {} explicit CAreaCollisionCache(const zeus::CAABox& aabb)
: x0_aabb(aabb), x1b40_24_leafOverflow(false), x1b40_25_cacheOverflow(false) {}
void ClearCache(); void ClearCache();
const zeus::CAABox& GetCacheBounds() const { return x0_aabb; } const zeus::CAABox& GetCacheBounds() const { return x0_aabb; }
void SetCacheBounds(const zeus::CAABox& aabb) { x0_aabb = aabb; } void SetCacheBounds(const zeus::CAABox& aabb) { x0_aabb = aabb; }

View File

@ -681,7 +681,16 @@ void CBooRenderer::LoadBallFade() {
} }
CBooRenderer::CBooRenderer(IObjectStore& store, IFactory& resFac) CBooRenderer::CBooRenderer(IObjectStore& store, IFactory& resFac)
: x8_factory(resFac), xc_store(store), x2a8_thermalRand(20) { : 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) {
g_Renderer = this; g_Renderer = this;
xee_24_ = true; xee_24_ = true;

View File

@ -152,8 +152,6 @@ class CBooRenderer final : public IRenderer {
// std::unique_ptr<CTexture> x314_phazonSuitMask; // std::unique_ptr<CTexture> x314_phazonSuitMask;
CPhazonSuitFilter m_phazonSuitFilter; CPhazonSuitFilter m_phazonSuitFilter;
union {
struct {
bool x318_24_refectionDirty : 1; bool x318_24_refectionDirty : 1;
bool x318_25_drawWireframe : 1; bool x318_25_drawWireframe : 1;
bool x318_26_requestRGBA6 : 1; bool x318_26_requestRGBA6 : 1;
@ -163,9 +161,6 @@ class CBooRenderer final : public IRenderer {
bool x318_30_inAreaDraw : 1; bool x318_30_inAreaDraw : 1;
bool x318_31_persistRGBA6 : 1; bool x318_31_persistRGBA6 : 1;
bool m_thermalHotPass : 1; bool m_thermalHotPass : 1;
};
u16 dummy = 0;
};
void GenerateFogVolumeRampTex(boo::IGraphicsDataFactory::Context& ctx); void GenerateFogVolumeRampTex(boo::IGraphicsDataFactory::Context& ctx);
void GenerateSphereRampTex(boo::IGraphicsDataFactory::Context& ctx); void GenerateSphereRampTex(boo::IGraphicsDataFactory::Context& ctx);

View File

@ -140,10 +140,12 @@ u32 CMoviePlayer::THPAudioDecode(s16* buffer, const u8* audioFrame, bool stereo)
} }
CMoviePlayer::CMoviePlayer(const char* path, float preLoadSeconds, bool loop, bool deinterlace) CMoviePlayer::CMoviePlayer(const char* path, float preLoadSeconds, bool loop, bool deinterlace)
: CDvdFile(path), xec_preLoadSeconds(preLoadSeconds) { : CDvdFile(path)
xf4_24_loop = loop; , xec_preLoadSeconds(preLoadSeconds)
m_deinterlace = deinterlace; , xf4_24_loop(loop)
, xf4_25_hasAudio(false)
, xf4_26_fieldFlip(false)
, m_deinterlace(deinterlace) {
/* Read THP header information */ /* Read THP header information */
u8 buf[64]; u8 buf[64];
SyncRead(buf, 64); SyncRead(buf, 64);

View File

@ -99,20 +99,14 @@ private:
float xe8_curSeconds = 0.f; float xe8_curSeconds = 0.f;
float xec_preLoadSeconds; float xec_preLoadSeconds;
u32 xf0_preLoadFrames = 0; u32 xf0_preLoadFrames = 0;
u32 xf8_ = 0;
u32 xfc_fieldIndex = 0;
std::unique_ptr<uint8_t[]> m_yuvBuf;
union {
u32 m_dummy = 0;
struct {
bool xf4_24_loop : 1; bool xf4_24_loop : 1;
bool xf4_25_hasAudio : 1; bool xf4_25_hasAudio : 1;
bool xf4_26_fieldFlip : 1; bool xf4_26_fieldFlip : 1;
bool m_deinterlace : 1; bool m_deinterlace : 1;
}; u32 xf8_ = 0;
}; u32 xfc_fieldIndex = 0;
std::unique_ptr<uint8_t[]> m_yuvBuf;
specter::View::ViewBlock m_viewVertBlock; specter::View::ViewBlock m_viewVertBlock;
boo::ObjToken<boo::IGraphicsBufferD> m_blockBuf; boo::ObjToken<boo::IGraphicsBufferD> m_blockBuf;

View File

@ -5,6 +5,7 @@
namespace urde { namespace urde {
CErrorOutputWindow::CErrorOutputWindow(bool flag) : CIOWin("Error Output Window") { CErrorOutputWindow::CErrorOutputWindow(bool flag) : CIOWin("Error Output Window") {
x18_24_ = false;
x18_25_ = true; x18_25_ = true;
x18_26_ = true; x18_26_ = true;
x18_27_ = true; x18_27_ = true;

View File

@ -11,16 +11,11 @@ public:
private: private:
State x14_state = State::Zero; State x14_state = State::Zero;
union {
struct {
bool x18_24_; bool x18_24_;
bool x18_25_; bool x18_25_;
bool x18_26_; bool x18_26_;
bool x18_27_; bool x18_27_;
bool x18_28_; bool x18_28_;
};
u16 dummy = 0;
};
const wchar_t* x1c_msg; const wchar_t* x1c_msg;
public: public:

View File

@ -11,7 +11,10 @@ CGuiSliderGroup::CGuiSliderGroup(const CGuiWidgetParms& parms, float min, float
, xbc_maxVal(max) , xbc_maxVal(max)
, xc0_roundedCurVal(def) , xc0_roundedCurVal(def)
, xc4_curVal(def) , xc4_curVal(def)
, xc8_increment(inc) {} , xc8_increment(inc)
, xf4_24_inputPending(false)
, m_mouseInside(false)
, m_mouseDown(false) {}
void CGuiSliderGroup::SetSelectionChangedCallback(std::function<void(CGuiSliderGroup*, float)>&& func) { void CGuiSliderGroup::SetSelectionChangedCallback(std::function<void(CGuiSliderGroup*, float)>&& func) {
xd8_changeCallback = std::move(func); xd8_changeCallback = std::move(func);

View File

@ -22,14 +22,9 @@ private:
std::array<CGuiWidget*, 2> xcc_sliderRangeWidgets{}; std::array<CGuiWidget*, 2> xcc_sliderRangeWidgets{};
std::function<void(CGuiSliderGroup*, float)> xd8_changeCallback; std::function<void(CGuiSliderGroup*, float)> xd8_changeCallback;
EState xf0_state = EState::None; EState xf0_state = EState::None;
union {
struct {
bool xf4_24_inputPending : 1; bool xf4_24_inputPending : 1;
mutable bool m_mouseInside : 1; mutable bool m_mouseInside : 1;
bool m_mouseDown : 1; bool m_mouseDown : 1;
};
u32 _dummy = 0;
};
mutable float m_mouseT = 0.f; mutable float m_mouseT = 0.f;

View File

@ -27,12 +27,11 @@ CHudEnergyInterface::CHudEnergyInterface(CGuiFrame& selHud, float tankEnergy, in
: x0_hudType(hudType) : x0_hudType(hudType)
, xc_tankEnergy(tankEnergy) , xc_tankEnergy(tankEnergy)
, x10_totalEnergyTanks(totalEnergyTanks) , x10_totalEnergyTanks(totalEnergyTanks)
, x14_numTanksFilled(numTanksFilled) { , x14_numTanksFilled(numTanksFilled)
x1c_24_ = true; , x1c_24_(true)
x1c_25_ = true; , x1c_25_(true)
x1c_26_barDirty = true; , x1c_26_barDirty(true)
x1c_27_energyLow = energyLow; , x1c_27_energyLow(energyLow) {
x20_textpane_energydigits = static_cast<CGuiTextPane*>(selHud.FindWidget("textpane_energydigits")); x20_textpane_energydigits = static_cast<CGuiTextPane*>(selHud.FindWidget("textpane_energydigits"));
x24_meter_energytanks = static_cast<CAuiMeter*>(selHud.FindWidget("meter_energytanks")); x24_meter_energytanks = static_cast<CAuiMeter*>(selHud.FindWidget("meter_energytanks"));
x28_textpane_energywarning = static_cast<CGuiTextPane*>(selHud.FindWidget("textpane_energywarning")); x28_textpane_energywarning = static_cast<CGuiTextPane*>(selHud.FindWidget("textpane_energywarning"));

View File

@ -19,15 +19,10 @@ class CHudEnergyInterface {
int x10_totalEnergyTanks; int x10_totalEnergyTanks;
int x14_numTanksFilled; int x14_numTanksFilled;
float x18_cachedBarEnergy = 0.f; float x18_cachedBarEnergy = 0.f;
union {
struct {
bool x1c_24_ : 1; bool x1c_24_ : 1;
bool x1c_25_ : 1; bool x1c_25_ : 1;
bool x1c_26_barDirty : 1; bool x1c_26_barDirty : 1;
bool x1c_27_energyLow : 1; bool x1c_27_energyLow : 1;
};
u16 _dummy = 0;
};
CGuiTextPane* x20_textpane_energydigits; CGuiTextPane* x20_textpane_energydigits;
CAuiMeter* x24_meter_energytanks; CAuiMeter* x24_meter_energytanks;
CGuiTextPane* x28_textpane_energywarning; CGuiTextPane* x28_textpane_energywarning;

View File

@ -8,12 +8,12 @@ namespace urde {
CHudFreeLookInterface::CHudFreeLookInterface(CGuiFrame& selHud, EHudType hudType, bool inFreeLook, bool lookControlHeld, CHudFreeLookInterface::CHudFreeLookInterface(CGuiFrame& selHud, EHudType hudType, bool inFreeLook, bool lookControlHeld,
bool lockedOnObj) bool lockedOnObj)
: x4_hudType(hudType) { : x4_hudType(hudType)
x70_24_inFreeLook = inFreeLook; , x70_24_inFreeLook(inFreeLook)
x70_25_lookControlHeld = lookControlHeld; , x70_25_lookControlHeld(lookControlHeld)
x70_26_lockedOnObj = lockedOnObj; , x70_26_lockedOnObj(lockedOnObj)
x70_27_visibleDebug = true; , x70_27_visibleDebug(true)
x70_28_visibleGame = true; , x70_28_visibleGame(true) {
x6c_lockOnInterp = (lockedOnObj && hudType == EHudType::Scan) ? 0.f : 1.f; x6c_lockOnInterp = (lockedOnObj && hudType == EHudType::Scan) ? 0.f : 1.f;
x74_basewidget_freelookleft = selHud.FindWidget("basewidget_freelookleft"); x74_basewidget_freelookleft = selHud.FindWidget("basewidget_freelookleft");

View File

@ -24,16 +24,11 @@ class CHudFreeLookInterface : public IFreeLookInterface {
zeus::CTransform x38_freeLookRightXf; zeus::CTransform x38_freeLookRightXf;
float x68_freeLookInterp = 0.f; float x68_freeLookInterp = 0.f;
float x6c_lockOnInterp; float x6c_lockOnInterp;
union {
struct {
bool x70_24_inFreeLook : 1; bool x70_24_inFreeLook : 1;
bool x70_25_lookControlHeld : 1; bool x70_25_lookControlHeld : 1;
bool x70_26_lockedOnObj : 1; bool x70_26_lockedOnObj : 1;
bool x70_27_visibleDebug : 1; bool x70_27_visibleDebug : 1;
bool x70_28_visibleGame : 1; bool x70_28_visibleGame : 1;
};
u16 _dummy = 0;
};
CGuiWidget* x74_basewidget_freelookleft; CGuiWidget* x74_basewidget_freelookleft;
CGuiModel* x78_model_shieldleft; CGuiModel* x78_model_shieldleft;
CGuiModel* x7c_model_freelookleft; CGuiModel* x7c_model_freelookleft;

View File

@ -7,11 +7,12 @@
namespace urde { namespace urde {
CHudHelmetInterface::CHudHelmetInterface(CGuiFrame& helmetFrame) { CHudHelmetInterface::CHudHelmetInterface(CGuiFrame& helmetFrame)
x3c_24_helmetVisibleDebug = true; : x3c_24_helmetVisibleDebug(true)
x3c_25_helmetVisibleGame = true; , x3c_25_helmetVisibleGame(true)
x3c_26_glowVisibleDebug = true; , x3c_26_glowVisibleDebug(true)
x3c_27_glowVisibleGame = true; , x3c_27_glowVisibleGame(true)
, x3c_28_hudLagDirty(false) {
x40_camera = helmetFrame.GetFrameCamera(); x40_camera = helmetFrame.GetFrameCamera();
x44_BaseWidget_Pivot = helmetFrame.FindWidget("BaseWidget_Pivot"); x44_BaseWidget_Pivot = helmetFrame.FindWidget("BaseWidget_Pivot");
x48_BaseWidget_Helmet = helmetFrame.FindWidget("BaseWidget_Helmet"); x48_BaseWidget_Helmet = helmetFrame.FindWidget("BaseWidget_Helmet");

View File

@ -12,16 +12,11 @@ class CHudHelmetInterface {
zeus::CMatrix3f x0_hudLagRotation; zeus::CMatrix3f x0_hudLagRotation;
zeus::CVector3f x24_pivotPosition; zeus::CVector3f x24_pivotPosition;
zeus::CVector3f x30_hudLagPosition; zeus::CVector3f x30_hudLagPosition;
union {
struct {
bool x3c_24_helmetVisibleDebug : 1; bool x3c_24_helmetVisibleDebug : 1;
bool x3c_25_helmetVisibleGame : 1; bool x3c_25_helmetVisibleGame : 1;
bool x3c_26_glowVisibleDebug : 1; bool x3c_26_glowVisibleDebug : 1;
bool x3c_27_glowVisibleGame : 1; bool x3c_27_glowVisibleGame : 1;
bool x3c_28_hudLagDirty : 1; bool x3c_28_hudLagDirty : 1;
};
u16 _dummy = 0;
};
CGuiCamera* x40_camera; CGuiCamera* x40_camera;
CGuiWidget* x44_BaseWidget_Pivot; CGuiWidget* x44_BaseWidget_Pivot;
CGuiWidget* x48_BaseWidget_Helmet; CGuiWidget* x48_BaseWidget_Helmet;

View File

@ -26,11 +26,10 @@ CHudMissileInterface::CHudMissileInterface(CGuiFrame& selHud, int missileCapacit
: x0_hudType(hudType) : x0_hudType(hudType)
, x4_missileCapacity(missileCapacity) , x4_missileCapacity(missileCapacity)
, x8_numMissles(numMissiles) , x8_numMissles(numMissiles)
, x4c_chargeBeamFactor(chargeFactor) { , x4c_chargeBeamFactor(chargeFactor)
x58_24_missilesActive = missilesActive; , x58_24_missilesActive(missilesActive)
x58_25_visibleDebug = true; , x58_25_visibleDebug(true)
x58_26_visibleGame = true; , x58_26_visibleGame(true) {
x5c_basewidget_missileicon = selHud.FindWidget("basewidget_missileicon"); x5c_basewidget_missileicon = selHud.FindWidget("basewidget_missileicon");
x60_textpane_missiledigits = static_cast<CGuiTextPane*>(selHud.FindWidget("textpane_missiledigits")); x60_textpane_missiledigits = static_cast<CGuiTextPane*>(selHud.FindWidget("textpane_missiledigits"));
x64_energybart01_missilebar = static_cast<CAuiEnergyBarT01*>(selHud.FindWidget("energybart01_missilebar")); x64_energybart01_missilebar = static_cast<CAuiEnergyBarT01*>(selHud.FindWidget("energybart01_missilebar"));

View File

@ -26,16 +26,11 @@ class CHudMissileInterface {
float x4c_chargeBeamFactor; float x4c_chargeBeamFactor;
float x50_missileIconAltDeplete = 0.f; float x50_missileIconAltDeplete = 0.f;
float x54_missileIconIncrement = 0.f; float x54_missileIconIncrement = 0.f;
union {
struct {
bool x58_24_missilesActive : 1; bool x58_24_missilesActive : 1;
bool x58_25_visibleDebug : 1; bool x58_25_visibleDebug : 1;
bool x58_26_visibleGame : 1; bool x58_26_visibleGame : 1;
bool x58_27_hasArrows : 1; bool x58_27_hasArrows : 1;
bool x58_28_notXRay : 1; bool x58_28_notXRay : 1;
};
u16 _dummy = 0;
};
CGuiWidget* x5c_basewidget_missileicon; CGuiWidget* x5c_basewidget_missileicon;
CGuiTextPane* x60_textpane_missiledigits; CGuiTextPane* x60_textpane_missiledigits;
CAuiEnergyBarT01* x64_energybart01_missilebar; CAuiEnergyBarT01* x64_energybart01_missilebar;

View File

@ -32,15 +32,10 @@ struct SAdsrData {
float xc_decayDur = 0.f; float xc_decayDur = 0.f;
float x10_sustainGain = 0.f; float x10_sustainGain = 0.f;
float x14_releaseDur = 0.f; float x14_releaseDur = 0.f;
union {
struct {
bool x18_24_hasSustain : 1; bool x18_24_hasSustain : 1;
bool x18_25_autoRelease : 1; bool x18_25_autoRelease : 1;
};
u32 dummy = 0;
};
constexpr SAdsrData() noexcept { x18_24_hasSustain = false; x18_25_autoRelease = false; }; constexpr SAdsrData() noexcept : x18_24_hasSustain(false), x18_25_autoRelease(false) {}
constexpr SAdsrData(float attackGain, float autoReleaseDur, float attackDur, float decayDur, float sustainGain, constexpr SAdsrData(float attackGain, float autoReleaseDur, float attackDur, float decayDur, float sustainGain,
float releaseDur, bool hasSustain, bool autoRelease) noexcept float releaseDur, bool hasSustain, bool autoRelease) noexcept
: x0_attackGain(attackGain) : x0_attackGain(attackGain)
@ -48,10 +43,9 @@ struct SAdsrData {
, x8_attackDur(attackDur) , x8_attackDur(attackDur)
, xc_decayDur(decayDur) , xc_decayDur(decayDur)
, x10_sustainGain(sustainGain) , x10_sustainGain(sustainGain)
, x14_releaseDur(releaseDur) { , x14_releaseDur(releaseDur)
x18_24_hasSustain = hasSustain; , x18_24_hasSustain(hasSustain)
x18_25_autoRelease = autoRelease; , x18_25_autoRelease(autoRelease) {}
}
}; };
struct SAdsrDelta { struct SAdsrDelta {

View File

@ -1412,10 +1412,9 @@ void CFrontEndUI::SNesEmulatorFrame::Draw(CSaveGameScreen* saveUi) const {
} }
} }
CFrontEndUI::SOptionsFrontEndFrame::SOptionsFrontEndFrame() { CFrontEndUI::SOptionsFrontEndFrame::SOptionsFrontEndFrame() : x134_24_visible(true), x134_25_exitOptions(false) {
x4_frme = g_SimplePool->GetObj("FRME_OptionsFrontEnd"); x4_frme = g_SimplePool->GetObj("FRME_OptionsFrontEnd");
x10_pauseScreen = g_SimplePool->GetObj("STRG_PauseScreen"); x10_pauseScreen = g_SimplePool->GetObj("STRG_PauseScreen");
x134_24_visible = true;
} }
void CFrontEndUI::SOptionsFrontEndFrame::DoSliderChange(CGuiSliderGroup* caller, float value) { void CFrontEndUI::SOptionsFrontEndFrame::DoSliderChange(CGuiSliderGroup* caller, float value) {

View File

@ -279,13 +279,8 @@ public:
float x38_rowPitch = 0.f; float x38_rowPitch = 0.f;
CSfxHandle x3c_sliderSfx; CSfxHandle x3c_sliderSfx;
CRumbleGenerator x40_rumbleGen; CRumbleGenerator x40_rumbleGen;
union {
u8 _dummy = 0;
struct {
bool x134_24_visible : 1; bool x134_24_visible : 1;
bool x134_25_exitOptions : 1; bool x134_25_exitOptions : 1;
};
};
std::unique_ptr<CGameOptionsTouchBar> m_touchBar; std::unique_ptr<CGameOptionsTouchBar> m_touchBar;
bool m_touchBarInValue = false; bool m_touchBarInValue = false;

View File

@ -178,7 +178,11 @@ CInGameGuiManager::CInGameGuiManager(CStateManager& stateMgr, CArchitectureQueue
, x1c_rand(1234) , x1c_rand(1234)
, x20_faceplateDecor(stateMgr) , x20_faceplateDecor(stateMgr)
, x50_deathDot(g_SimplePool->GetObj("TXTR_DeathDot")) , x50_deathDot(g_SimplePool->GetObj("TXTR_DeathDot"))
, x5c_pauseScreenDGRPs(LockPauseScreenDependencies()) { , x5c_pauseScreenDGRPs(LockPauseScreenDependencies())
, x1f8_24_(false)
, x1f8_25_playerAlive(true)
, x1f8_26_deferTransition(false)
, x1f8_27_exitSaveUI(true) {
x1e0_helmetVisMode = g_tweakGui->GetHelmetVisMode(); x1e0_helmetVisMode = g_tweakGui->GetHelmetVisMode();
x1e4_enableTargetingManager = g_tweakGui->GetEnableTargetingManager(); x1e4_enableTargetingManager = g_tweakGui->GetEnableTargetingManager();
x1e8_enableAutoMapper = g_tweakGui->GetEnableAutoMapper(); x1e8_enableAutoMapper = g_tweakGui->GetEnableAutoMapper();
@ -187,9 +191,6 @@ CInGameGuiManager::CInGameGuiManager(CStateManager& stateMgr, CArchitectureQueue
x1f4_visorStaticAlpha = stateMgr.GetPlayer().GetVisorStaticAlpha(); x1f4_visorStaticAlpha = stateMgr.GetPlayer().GetVisorStaticAlpha();
x1f8_25_playerAlive = true;
x1f8_27_exitSaveUI = true;
xc8_inGameGuiDGRPs.reserve(InGameGuiDGRPs.size()); xc8_inGameGuiDGRPs.reserve(InGameGuiDGRPs.size());
for (const char* const dgrp : InGameGuiDGRPs) { for (const char* const dgrp : InGameGuiDGRPs) {
xc8_inGameGuiDGRPs.emplace_back(g_SimplePool->GetObj(dgrp)); xc8_inGameGuiDGRPs.emplace_back(g_SimplePool->GetObj(dgrp));

View File

@ -95,6 +95,10 @@ private:
EHudVisMode x1ec_hudVisMode; EHudVisMode x1ec_hudVisMode;
u32 x1f0_enablePlayerVisor; u32 x1f0_enablePlayerVisor;
float x1f4_visorStaticAlpha; float x1f4_visorStaticAlpha;
bool x1f8_24_ : 1;
bool x1f8_25_playerAlive : 1;
bool x1f8_26_deferTransition : 1;
bool x1f8_27_exitSaveUI : 1;
std::optional<CTexturedQuadFilter> m_deathRenderTexQuad; std::optional<CTexturedQuadFilter> m_deathRenderTexQuad;
std::optional<CTexturedQuadFilter> m_deathDotQuad; std::optional<CTexturedQuadFilter> m_deathDotQuad;
@ -102,16 +106,6 @@ private:
CColoredQuadFilter m_deathWhiteout{EFilterType::Blend}; CColoredQuadFilter m_deathWhiteout{EFilterType::Blend};
CColoredQuadFilter m_deathBlackout{EFilterType::Blend}; CColoredQuadFilter m_deathBlackout{EFilterType::Blend};
union {
struct {
bool x1f8_24_ : 1;
bool x1f8_25_playerAlive : 1;
bool x1f8_26_deferTransition : 1;
bool x1f8_27_exitSaveUI : 1;
};
u32 _dummy = 0;
};
static std::vector<TLockedToken<CDependencyGroup>> LockPauseScreenDependencies(); static std::vector<TLockedToken<CDependencyGroup>> LockPauseScreenDependencies();
bool CheckDGRPLoadComplete() const; bool CheckDGRPLoadComplete() const;
void BeginStateTransition(EInGameGuiState state, CStateManager& stateMgr); void BeginStateTransition(EInGameGuiState state, CStateManager& stateMgr);

View File

@ -14,7 +14,10 @@
namespace urde::MP1 { namespace urde::MP1 {
CLogBookScreen::CLogBookScreen(const CStateManager& mgr, CGuiFrame& frame, const CStringTable& pauseStrg) CLogBookScreen::CLogBookScreen(const CStateManager& mgr, CGuiFrame& frame, const CStringTable& pauseStrg)
: CPauseScreenBase(mgr, frame, pauseStrg, true) { : CPauseScreenBase(mgr, frame, pauseStrg, true)
, x260_24_loaded(false)
, x260_25_inTextScroll(false)
, x260_26_exitTextScroll(false) {
x19c_scanCompletes.resize(5); x19c_scanCompletes.resize(5);
x200_viewScans.resize(5); x200_viewScans.resize(5);
x258_artifactDoll = std::make_unique<CArtifactDoll>(); x258_artifactDoll = std::make_unique<CArtifactDoll>();
@ -177,7 +180,6 @@ bool CLogBookScreen::IsScanCategoryReady(CSaveWorld::EScanCategory category) con
}); });
} }
void CLogBookScreen::UpdateBodyText() { void CLogBookScreen::UpdateBodyText() {
if (x10_mode != EMode::TextScroll) { if (x10_mode != EMode::TextScroll) {
x174_textpane_body->TextSupport().SetText(u""); x174_textpane_body->TextSupport().SetText(u"");

View File

@ -13,7 +13,7 @@ namespace urde {
class CPlayerState; class CPlayerState;
class CScannableObjectInfo; class CScannableObjectInfo;
class CStringTable; class CStringTable;
} } // namespace urde
namespace urde::MP1 { namespace urde::MP1 {
class CArtifactDoll; class CArtifactDoll;
@ -25,18 +25,14 @@ class CLogBookScreen : public CPauseScreenBase {
x200_viewScans; x200_viewScans;
float x254_viewInterp = 0.f; float x254_viewInterp = 0.f;
std::unique_ptr<CArtifactDoll> x258_artifactDoll; std::unique_ptr<CArtifactDoll> x258_artifactDoll;
enum class ELeavePauseState {
enum class ELeavePauseState { InPause = 0, LeavingPause = 1, LeftPause = 2 }; InPause = 0,
LeavingPause = 1,
ELeavePauseState x25c_leavePauseState = ELeavePauseState::InPause; LeftPause = 2
union { } x25c_leavePauseState = ELeavePauseState::InPause;
struct {
bool x260_24_loaded : 1; bool x260_24_loaded : 1;
bool x260_25_inTextScroll : 1; bool x260_25_inTextScroll : 1;
bool x260_26_exitTextScroll : 1; bool x260_26_exitTextScroll : 1;
};
s32 _dummy = 0;
};
void InitializeLogBook(); void InitializeLogBook();
void UpdateRightTitles(); void UpdateRightTitles();

View File

@ -14,13 +14,16 @@ namespace urde::MP1 {
CMFGame::CMFGame(const std::weak_ptr<CStateManager>& stateMgr, const std::weak_ptr<CInGameGuiManager>& guiMgr, CMFGame::CMFGame(const std::weak_ptr<CStateManager>& stateMgr, const std::weak_ptr<CInGameGuiManager>& guiMgr,
const CArchitectureQueue&) const CArchitectureQueue&)
: CMFGameBase("CMFGame"), x14_stateManager(stateMgr.lock()), x18_guiManager(guiMgr.lock()) { : CMFGameBase("CMFGame")
x2a_25_samusAlive = true; , x14_stateManager(stateMgr.lock())
, x18_guiManager(guiMgr.lock())
, x2a_24_initialized(false)
, x2a_25_samusAlive(true) {
static_cast<CMain&>(*g_Main).SetMFGameBuilt(true); static_cast<CMain&>(*g_Main).SetMFGameBuilt(true);
} }
CMFGame::~CMFGame() { CMFGame::~CMFGame() {
CMain& main = static_cast<CMain&>(*g_Main); auto& main = static_cast<CMain&>(*g_Main);
main.SetMFGameBuilt(false); main.SetMFGameBuilt(false);
main.SetScreenFading(false); main.SetScreenFading(false);
CDecalManager::Reinitialize(); CDecalManager::Reinitialize();
@ -253,8 +256,9 @@ void CMFGame::EnterMapScreen() {
x14_stateManager->SetInMapScreen(true); x14_stateManager->SetInMapScreen(true);
} }
CMFGameLoader::CMFGameLoader() : CMFGameLoaderBase("CMFGameLoader") { CMFGameLoader::CMFGameLoader()
CMain* m = static_cast<CMain*>(g_Main); : CMFGameLoaderBase("CMFGameLoader"), x2c_24_initialized(false), x2c_25_transitionFinished(false) {
auto* m = static_cast<CMain*>(g_Main);
switch (m->GetFlowState()) { switch (m->GetFlowState()) {
case EFlowState::Default: case EFlowState::Default:
case EFlowState::StateSetter: { case EFlowState::StateSetter: {

View File

@ -23,13 +23,8 @@ class CMFGame : public CMFGameBase {
float x20_cineSkipTime; float x20_cineSkipTime;
u32 x24_ = 0; u32 x24_ = 0;
TUniqueId x28_skippedCineCam = kInvalidUniqueId; TUniqueId x28_skippedCineCam = kInvalidUniqueId;
union {
struct {
bool x2a_24_initialized : 1; bool x2a_24_initialized : 1;
bool x2a_25_samusAlive : 1; bool x2a_25_samusAlive : 1;
};
u8 _dummy = 0;
};
CColoredQuadFilter m_fadeToBlack{EFilterType::Multiply}; CColoredQuadFilter m_fadeToBlack{EFilterType::Multiply};
@ -57,14 +52,8 @@ class CMFGameLoader : public CMFGameLoaderBase {
std::shared_ptr<CStateManager> x14_stateMgr; std::shared_ptr<CStateManager> x14_stateMgr;
std::shared_ptr<CInGameGuiManager> x18_guiMgr; std::shared_ptr<CInGameGuiManager> x18_guiMgr;
std::vector<CToken> x1c_loadList; std::vector<CToken> x1c_loadList;
union {
struct {
bool x2c_24_initialized : 1; bool x2c_24_initialized : 1;
bool x2c_25_transitionFinished : 1; bool x2c_25_transitionFinished : 1;
};
u8 _dummy = 0;
};
void MakeLoadDependencyList(); void MakeLoadDependencyList();

View File

@ -18,9 +18,22 @@ namespace urde::MP1 {
CPauseScreenBase::CPauseScreenBase(const CStateManager& mgr, CGuiFrame& frame, const CStringTable& pauseStrg, CPauseScreenBase::CPauseScreenBase(const CStateManager& mgr, CGuiFrame& frame, const CStringTable& pauseStrg,
bool isLogBook) bool isLogBook)
: x4_mgr(mgr), x8_frame(frame), xc_pauseStrg(pauseStrg) { : x4_mgr(mgr)
m_isLogBook = isLogBook; , x8_frame(frame)
m_playRightTableSfx = true; , xc_pauseStrg(pauseStrg)
, x198_24_ready(false)
, x198_25_handledInput(false)
, x198_26_exitPauseScreen(false)
, x198_27_canDraw(false)
, x198_28_pulseTextArrowTop(false)
, x198_29_pulseTextArrowBottom(false)
, m_isLogBook(isLogBook)
, m_bodyUpClicked(false)
, m_bodyDownClicked(false)
, m_bodyClicked(false)
, m_leftClicked(false)
, m_rightClicked(false)
, m_playRightTableSfx(true) {
InitializeFrameGlue(); InitializeFrameGlue();
} }

View File

@ -74,8 +74,6 @@ protected:
CGuiSliderGroup* x18c_slidergroup_slider = nullptr; CGuiSliderGroup* x18c_slidergroup_slider = nullptr;
CGuiTableGroup* x190_tablegroup_double = nullptr; CGuiTableGroup* x190_tablegroup_double = nullptr;
CGuiTableGroup* x194_tablegroup_triple = nullptr; CGuiTableGroup* x194_tablegroup_triple = nullptr;
union {
struct {
bool x198_24_ready : 1; bool x198_24_ready : 1;
bool x198_25_handledInput : 1; bool x198_25_handledInput : 1;
bool x198_26_exitPauseScreen : 1; bool x198_26_exitPauseScreen : 1;
@ -89,9 +87,7 @@ protected:
bool m_leftClicked : 1; bool m_leftClicked : 1;
bool m_rightClicked : 1; bool m_rightClicked : 1;
bool m_playRightTableSfx : 1; bool m_playRightTableSfx : 1;
};
u32 _dummy = 0;
};
void InitializeFrameGlue(); void InitializeFrameGlue();
void ChangeMode(EMode mode, bool playSfx = true); void ChangeMode(EMode mode, bool playSfx = true);
void UpdateSideTable(CGuiTableGroup* table); void UpdateSideTable(CGuiTableGroup* table);

View File

@ -6,9 +6,8 @@
namespace urde::MP1 { namespace urde::MP1 {
CPauseScreenBlur::CPauseScreenBlur() : x4_mapLightQuarter(g_SimplePool->GetObj("TXTR_MapLightQuarter")) { CPauseScreenBlur::CPauseScreenBlur()
x50_25_gameDraw = true; : x4_mapLightQuarter(g_SimplePool->GetObj("TXTR_MapLightQuarter")), x50_24_blurring(false), x50_25_gameDraw(true) {}
}
void CPauseScreenBlur::OnNewInGameGuiState(EInGameGuiState state, CStateManager& stateMgr) { void CPauseScreenBlur::OnNewInGameGuiState(EInGameGuiState state, CStateManager& stateMgr) {
switch (state) { switch (state) {

View File

@ -20,16 +20,12 @@ class CPauseScreenBlur {
EState x14_nextState = EState::InGame; EState x14_nextState = EState::InGame;
float x18_blurAmt = 0.f; float x18_blurAmt = 0.f;
CCameraBlurPass x1c_camBlur; CCameraBlurPass x1c_camBlur;
bool x50_24_blurring : 1;
bool x50_25_gameDraw : 1;
CTexturedQuadFilter m_quarterFilter{EFilterType::Multiply, x4_mapLightQuarter}; CTexturedQuadFilter m_quarterFilter{EFilterType::Multiply, x4_mapLightQuarter};
CScanLinesFilterEven m_linesFilter{EFilterType::Multiply}; CScanLinesFilterEven m_linesFilter{EFilterType::Multiply};
union {
struct {
bool x50_24_blurring : 1;
bool x50_25_gameDraw : 1;
};
u32 _dummy = 0;
};
void OnBlurComplete(bool); void OnBlurComplete(bool);
void SetState(EState state); void SetState(EState state);

View File

@ -8,7 +8,13 @@ const char* kMovies[] = {"Video/wingame.thp", "Video/wingame_best.thp", "
bool CPlayMovie::IsResultsScreen(EWhichMovie which) { return int(which) <= 2; } bool CPlayMovie::IsResultsScreen(EWhichMovie which) { return int(which) <= 2; }
CPlayMovie::CPlayMovie(EWhichMovie which) : CPlayMovieBase("CPlayMovie", kMovies[int(which)]), x18_which(which) { CPlayMovie::CPlayMovie(EWhichMovie which)
: CPlayMovieBase("CPlayMovie", kMovies[int(which)])
, x18_which(which)
, x78_24_(false)
, x78_25_(false)
, x78_26_resultsScreen(false)
, x78_27_(false) {
(void)x18_which; (void)x18_which;
} }

View File

@ -20,15 +20,11 @@ public:
private: private:
EWhichMovie x18_which; EWhichMovie x18_which;
union {
struct {
bool x78_24_ : 1; bool x78_24_ : 1;
bool x78_25_ : 1; bool x78_25_ : 1;
bool x78_26_resultsScreen : 1; bool x78_26_resultsScreen : 1;
bool x78_27_ : 1; bool x78_27_ : 1;
};
u16 _dummy = 0;
};
static bool IsResultsScreen(EWhichMovie which); static bool IsResultsScreen(EWhichMovie which);
public: public:

View File

@ -98,7 +98,15 @@ CSamusDoll::CSamusDoll(const CDependencyGroup& suitDgrp, const CDependencyGroup&
bool hasGrappleBeam) bool hasGrappleBeam)
: x10_ballXf(zeus::CTransform::Translate(0.f, 0.f, 0.625f * g_tweakPlayer->GetPlayerBallHalfExtent())) : x10_ballXf(zeus::CTransform::Translate(0.f, 0.f, 0.625f * g_tweakPlayer->GetPlayerBallHalfExtent()))
, x44_suit(suit) , x44_suit(suit)
, x48_beam(beam) { , x48_beam(beam)
, x270_24_hasSpiderBall(hasSpiderBall)
, x270_25_hasGrappleBeam(hasGrappleBeam)
, x270_26_pulseSuit(false)
, x270_27_pulseBeam(false)
, x270_28_pulseGrapple(false)
, x270_29_pulseBoots(false)
, x270_30_pulseVisor(false)
, x270_31_loaded(false) {
x70_fixedRot.rotateZ(M_PIF); x70_fixedRot.rotateZ(M_PIF);
x90_userInterpRot = xb0_userRot = x70_fixedRot; x90_userInterpRot = xb0_userRot = x70_fixedRot;
x1d4_spiderBallGlass = g_SimplePool->GetObj(SpiderBallGlassModels[size_t(suit)].first); x1d4_spiderBallGlass = g_SimplePool->GetObj(SpiderBallGlassModels[size_t(suit)].first);
@ -115,8 +123,6 @@ CSamusDoll::CSamusDoll(const CDependencyGroup& suitDgrp, const CDependencyGroup&
x230_ballTransitionFlash = g_SimplePool->GetObj("MorphBallTransitionFlash"); x230_ballTransitionFlash = g_SimplePool->GetObj("MorphBallTransitionFlash");
x23c_lights.push_back(CLight::BuildDirectional(zeus::skForward, zeus::skWhite)); x23c_lights.push_back(CLight::BuildDirectional(zeus::skForward, zeus::skWhite));
x24c_actorLights = std::make_unique<CActorLights>(8, zeus::skZero3f, 4, 4, false, false, false, 0.1f); x24c_actorLights = std::make_unique<CActorLights>(8, zeus::skZero3f, 4, 4, false, false, false, 0.1f);
x270_24_hasSpiderBall = hasSpiderBall;
x270_25_hasGrappleBeam = hasGrappleBeam;
x22c_ballInnerGlowGen->SetGlobalScale(zeus::CVector3f(0.625f)); x22c_ballInnerGlowGen->SetGlobalScale(zeus::CVector3f(0.625f));
x0_depToks.reserve(suitDgrp.GetObjectTagVector().size() + ballDgrp.GetObjectTagVector().size()); x0_depToks.reserve(suitDgrp.GetObjectTagVector().size() + ballDgrp.GetObjectTagVector().size());
for (const SObjectTag& tag : suitDgrp.GetObjectTagVector()) { for (const SObjectTag& tag : suitDgrp.GetObjectTagVector()) {

View File

@ -71,8 +71,6 @@ class CSamusDoll {
CSfxHandle x264_offsetSfx; CSfxHandle x264_offsetSfx;
CSfxHandle x268_rotateSfx; CSfxHandle x268_rotateSfx;
CSfxHandle x26c_zoomSfx; CSfxHandle x26c_zoomSfx;
union {
struct {
bool x270_24_hasSpiderBall : 1; bool x270_24_hasSpiderBall : 1;
bool x270_25_hasGrappleBeam : 1; bool x270_25_hasGrappleBeam : 1;
bool x270_26_pulseSuit : 1; bool x270_26_pulseSuit : 1;
@ -81,9 +79,6 @@ class CSamusDoll {
bool x270_29_pulseBoots : 1; bool x270_29_pulseBoots : 1;
bool x270_30_pulseVisor : 1; bool x270_30_pulseVisor : 1;
bool x270_31_loaded : 1; bool x270_31_loaded : 1;
};
u32 _dummy = 0;
};
static constexpr zeus::CVector3f skInitialOffset{0.0f, 0.0f, 0.8f}; static constexpr zeus::CVector3f skInitialOffset{0.0f, 0.0f, 0.8f};
static CModelData BuildSuitModelData1(CPlayerState::EPlayerSuit suit); static CModelData BuildSuitModelData1(CPlayerState::EPlayerSuit suit);

View File

@ -23,9 +23,11 @@ CSamusHud::CSamusHud(CStateManager& stateMgr)
: x8_targetingMgr(stateMgr) : x8_targetingMgr(stateMgr)
, x258_frmeHelmet(g_SimplePool->GetObj("FRME_Helmet")) , x258_frmeHelmet(g_SimplePool->GetObj("FRME_Helmet"))
, x268_frmeBaseHud(g_SimplePool->GetObj("FRME_BaseHud")) , x268_frmeBaseHud(g_SimplePool->GetObj("FRME_BaseHud"))
, x2e0_24_inFreeLook(false)
, x2e0_25_lookControlHeld(false)
, x2e0_26_latestFirstPerson(true)
, x2e0_27_energyLow(stateMgr.GetPlayer().IsEnergyLow(stateMgr))
, m_energyDrainFilter(g_tweakGui->GetEnergyDrainFilterAdditive() ? EFilterType::Add : EFilterType::Blend) { , m_energyDrainFilter(g_tweakGui->GetEnergyDrainFilterAdditive() ? EFilterType::Add : EFilterType::Blend) {
x2e0_26_latestFirstPerson = true;
x2e0_27_energyLow = stateMgr.GetPlayer().IsEnergyLow(stateMgr);
x33c_lights = std::make_unique<CActorLights>(8, zeus::skZero3f, 4, 1, true, 0, 0, 0.1f); x33c_lights = std::make_unique<CActorLights>(8, zeus::skZero3f, 4, 1, true, 0, 0, 0.1f);
x340_hudLights.resize(3, SCachedHudLight(zeus::skZero3f, zeus::skWhite, 0.f, 0.f, 0.f, 0.f)); x340_hudLights.resize(3, SCachedHudLight(zeus::skZero3f, zeus::skWhite, 0.f, 0.f, 0.f, 0.f));
x46c_.resize(3); x46c_.resize(3);

View File

@ -95,17 +95,10 @@ class CSamusHud {
u32 x2d4_totalEnergyTanks = 0; u32 x2d4_totalEnergyTanks = 0;
u32 x2d8_missileAmount = 0; u32 x2d8_missileAmount = 0;
u32 x2dc_missileCapacity = 0; u32 x2dc_missileCapacity = 0;
union {
struct {
bool x2e0_24_inFreeLook : 1; bool x2e0_24_inFreeLook : 1;
bool x2e0_25_lookControlHeld : 1; bool x2e0_25_lookControlHeld : 1;
bool x2e0_26_latestFirstPerson : 1; bool x2e0_26_latestFirstPerson : 1;
bool x2e0_27_energyLow : 1; bool x2e0_27_energyLow : 1;
};
u16 _dummy = 0;
};
u32 x2e4_ = 0; u32 x2e4_ = 0;
u32 x2e8_ = 0; u32 x2e8_ = 0;
CPlayerGun::EMissleMode x2ec_missileMode = CPlayerGun::EMissleMode::Inactive; CPlayerGun::EMissleMode x2ec_missileMode = CPlayerGun::EMissleMode::Inactive;

View File

@ -6,12 +6,20 @@
namespace urde { namespace urde {
CSlideShow::CSlideShow() : CIOWin("SlideShow"), x5c_slideA(*this), x90_slideB(*this) { CSlideShow::CSlideShow()
x130_ = g_tweakSlideShow->GetX54(); : CIOWin("SlideShow")
x134_24_ = true; , x5c_slideA(*this)
x134_30_ = true; , x90_slideB(*this)
x135_24_ = true; , x130_(g_tweakSlideShow->GetX54())
, x134_24_(true)
, x134_25_(false)
, x134_26_(false)
, x134_27_(false)
, x134_28_disableInput(false)
, x134_29_(false)
, x134_30_(true)
, x134_31_(false)
, x135_24_(true) {
const SObjectTag* font = g_ResFactory->GetResourceIdByName(g_tweakSlideShow->GetFont()); const SObjectTag* font = g_ResFactory->GetResourceIdByName(g_tweakSlideShow->GetFont());
if (font) { if (font) {
CGuiTextProperties propsA(false, true, EJustification::Center, EVerticalJustification::Bottom); CGuiTextProperties propsA(false, true, EJustification::Center, EVerticalJustification::Bottom);

View File

@ -87,9 +87,6 @@ private:
float x12c_ = 32.f; float x12c_ = 32.f;
*/ */
float x130_; float x130_;
union {
struct {
bool x134_24_ : 1; bool x134_24_ : 1;
bool x134_25_ : 1; bool x134_25_ : 1;
bool x134_26_ : 1; bool x134_26_ : 1;
@ -99,9 +96,6 @@ private:
bool x134_30_ : 1; bool x134_30_ : 1;
bool x134_31_ : 1; bool x134_31_ : 1;
bool x135_24_ : 1; bool x135_24_ : 1;
};
u32 dummy = 0;
};
bool LoadTXTRDep(std::string_view name); bool LoadTXTRDep(std::string_view name);
static bool AreAllDepsLoaded(const std::vector<TLockedToken<CDependencyGroup>>& deps); static bool AreAllDepsLoaded(const std::vector<TLockedToken<CDependencyGroup>>& deps);

View File

@ -240,7 +240,17 @@ void CGameArchitectureSupport::specialKeyUp(boo::ESpecialKey key, boo::EModifier
CMain::CMain(IFactory* resFactory, CSimplePool* resStore, boo::IGraphicsDataFactory* gfxFactory, CMain::CMain(IFactory* resFactory, CSimplePool* resStore, boo::IGraphicsDataFactory* gfxFactory,
boo::IGraphicsCommandQueue* cmdQ, const boo::ObjToken<boo::ITextureR>& spareTex) boo::IGraphicsCommandQueue* cmdQ, const boo::ObjToken<boo::ITextureR>& spareTex)
: m_booSetter(gfxFactory, cmdQ, spareTex), x128_globalObjects(resFactory, resStore) { : m_booSetter(gfxFactory, cmdQ, spareTex)
, x128_globalObjects(resFactory, resStore)
, x160_24_finished(false)
, x160_25_mfGameBuilt(false)
, x160_26_screenFading(false)
, x160_27_(false)
, x160_28_manageCard(false)
, x160_29_(false)
, x160_30_(false)
, x160_31_cardBusy(false)
, x161_24_gameFrameDrawn(false) {
xe4_gameplayResult = EGameplayResult::Playing; xe4_gameplayResult = EGameplayResult::Playing;
g_Main = this; g_Main = this;
} }

View File

@ -227,8 +227,6 @@ private:
u32 x130_[10] = {1000000}; u32 x130_[10] = {1000000};
union {
struct {
bool x160_24_finished : 1; bool x160_24_finished : 1;
bool x160_25_mfGameBuilt : 1; bool x160_25_mfGameBuilt : 1;
bool x160_26_screenFading : 1; bool x160_26_screenFading : 1;
@ -238,9 +236,6 @@ private:
bool x160_30_ : 1; bool x160_30_ : 1;
bool x160_31_cardBusy : 1; bool x160_31_cardBusy : 1;
bool x161_24_gameFrameDrawn : 1; bool x161_24_gameFrameDrawn : 1;
};
u16 _dummy = 0;
};
std::unique_ptr<CGameArchitectureSupport> x164_archSupport; std::unique_ptr<CGameArchitectureSupport> x164_archSupport;

View File

@ -69,7 +69,21 @@ CBabygoth::CBabygoth(TUniqueId uid, std::string_view name, const CEntityInfo& in
g_SimplePool->GetObj({SBIG('WPSC'), babyData.x44_fireBreathWeapon}) g_SimplePool->GetObj({SBIG('WPSC'), babyData.x44_fireBreathWeapon})
: g_SimplePool->GetObj("FlameThrower"sv)) : g_SimplePool->GetObj("FlameThrower"sv))
, x98c_dVuln(pInfo.GetDamageVulnerability()) , x98c_dVuln(pInfo.GetDamageVulnerability())
, xa00_shellHitPoints(babyData.GetShellHitPoints()) { , xa00_shellHitPoints(babyData.GetShellHitPoints())
, xa48_24_isAlert(false)
, xa48_25_(false)
, xa48_26_inProjectileAttack(false)
, xa48_27_(false)
, xa48_28_pendingAttackContactDamage(false)
, xa48_29_hasBeenEnraged(false)
, xa48_30_heardPlayerFire(false)
, xa48_31_approachNeedsPathSearch(true)
, xa49_24_gettingUp(false)
, xa49_25_shouldStepBackwards(false)
, xa49_26_readyForTeam(false)
, xa49_27_locomotionValid(false)
, xa49_28_onApproachPath(false)
, xa49_29_objectSpaceCollision(false) {
TLockedToken<CModel> model = g_SimplePool->GetObj({SBIG('CMDL'), babyData.x138_noShellModel}); TLockedToken<CModel> model = g_SimplePool->GetObj({SBIG('CMDL'), babyData.x138_noShellModel});
TLockedToken<CSkinRules> skin = g_SimplePool->GetObj({SBIG('CSKR'), babyData.x13c_noShellSkin}); TLockedToken<CSkinRules> skin = g_SimplePool->GetObj({SBIG('CSKR'), babyData.x13c_noShellSkin});
xa08_noShellModel = xa08_noShellModel =
@ -80,7 +94,6 @@ CBabygoth::CBabygoth(TUniqueId uid, std::string_view name, const CEntityInfo& in
xa2c_destroyShellParticle = g_SimplePool->GetObj({SBIG('PART'), babyData.x154_destroyShellParticle}); xa2c_destroyShellParticle = g_SimplePool->GetObj({SBIG('PART'), babyData.x154_destroyShellParticle});
if (x570_babyData.x148_intermediateCrackParticle.IsValid()) if (x570_babyData.x148_intermediateCrackParticle.IsValid())
xa38_intermediateCrackParticle = g_SimplePool->GetObj({SBIG('PART'), babyData.x148_intermediateCrackParticle}); xa38_intermediateCrackParticle = g_SimplePool->GetObj({SBIG('PART'), babyData.x148_intermediateCrackParticle});
xa48_31_approachNeedsPathSearch = true;
x958_iceProjectile.Token().Lock(); x958_iceProjectile.Token().Lock();
UpdateTouchBounds(); UpdateTouchBounds();
x460_knockBackController.SetEnableFreeze(false); x460_knockBackController.SetEnableFreeze(false);

View File

@ -100,8 +100,6 @@ private:
TToken<CGenDescription> xa20_crackTwoParticle; TToken<CGenDescription> xa20_crackTwoParticle;
TToken<CGenDescription> xa2c_destroyShellParticle; TToken<CGenDescription> xa2c_destroyShellParticle;
TLockedToken<CGenDescription> xa38_intermediateCrackParticle; // Used to be an optional, not necessary in URDE TLockedToken<CGenDescription> xa38_intermediateCrackParticle; // Used to be an optional, not necessary in URDE
union {
struct {
bool xa48_24_isAlert : 1; bool xa48_24_isAlert : 1;
bool xa48_25_ : 1; bool xa48_25_ : 1;
bool xa48_26_inProjectileAttack : 1; bool xa48_26_inProjectileAttack : 1;
@ -116,9 +114,6 @@ private:
bool xa49_27_locomotionValid : 1; bool xa49_27_locomotionValid : 1;
bool xa49_28_onApproachPath : 1; bool xa49_28_onApproachPath : 1;
bool xa49_29_objectSpaceCollision : 1; bool xa49_29_objectSpaceCollision : 1;
};
u32 _dummy = 0;
};
void AddSphereCollisionList(const SSphereJointInfo*, s32, std::vector<CJointCollisionDescription>&); void AddSphereCollisionList(const SSphereJointInfo*, s32, std::vector<CJointCollisionDescription>&);

View File

@ -18,22 +18,23 @@ CBeetle::CBeetle(TUniqueId uid, std::string_view name, const CEntityInfo& info,
CModelData&& mData, const CPatternedInfo& pInfo, CPatterned::EFlavorType flavor, CModelData&& mData, const CPatternedInfo& pInfo, CPatterned::EFlavorType flavor,
CBeetle::EEntranceType entranceType, const CDamageInfo& touchDamage, CBeetle::EEntranceType entranceType, const CDamageInfo& touchDamage,
const CDamageVulnerability& platingVuln, const zeus::CVector3f& tailAimReference, const CDamageVulnerability& platingVuln, const zeus::CVector3f& tailAimReference,
float initialAttackDelay, float retreatTime, float f3, float initialAttackDelay, float retreatTime, float f3, const CDamageVulnerability& tailVuln,
const CDamageVulnerability& tailVuln, const CActorParameters& aParams, const CActorParameters& aParams, const std::optional<CStaticRes>& tailModel)
const std::optional<CStaticRes>& tailModel)
: CPatterned(ECharacter::Beetle, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Ground, : CPatterned(ECharacter::Beetle, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Ground,
EColliderType::One, EBodyType::BiPedal, aParams, EKnockBackVariant(flavor)) EColliderType::One, EBodyType::BiPedal, aParams, EKnockBackVariant(flavor))
, x56c_entranceType(entranceType) , x56c_entranceType(entranceType)
, x574_tailAimReference(tailAimReference) , x574_tailAimReference(tailAimReference)
, x580_f3(f3) , x580_f3(f3)
, x584_touchDamage(touchDamage) , x584_touchDamage(touchDamage)
, x5ac_tailModel(tailModel ? std::optional<CModelData>(CModelData(*tailModel)) : , x5ac_tailModel(tailModel ? std::optional<CModelData>(CModelData(*tailModel)) : std::nullopt)
std::optional<CModelData>())
, x5fc_pathFindSearch(nullptr, 1, pInfo.GetPathfindingIndex(), 1.f, 1.f) , x5fc_pathFindSearch(nullptr, 1, pInfo.GetPathfindingIndex(), 1.f, 1.f)
, x744_platingVuln(platingVuln) , x744_platingVuln(platingVuln)
, x7ac_tailVuln(tailVuln) , x7ac_tailVuln(tailVuln)
, x814_attackDelayTimer(initialAttackDelay) , x814_attackDelayTimer(initialAttackDelay)
, x834_retreatTime(retreatTime) { , x834_retreatTime(retreatTime)
, x838_24_hitSomething(false)
, x838_25_burrowing(false)
, x838_26_canSkid(false) {
x5a0_headbuttDist = GetAnimationDistance(CPASAnimParmData(7, CPASAnimParm::FromEnum(0), CPASAnimParm::FromEnum(1))); x5a0_headbuttDist = GetAnimationDistance(CPASAnimParmData(7, CPASAnimParm::FromEnum(0), CPASAnimParm::FromEnum(1)));
x5a4_jumpBackwardDist = x5a4_jumpBackwardDist =
x64_modelData->GetScale().y() * x64_modelData->GetScale().y() *

View File

@ -38,14 +38,9 @@ private:
zeus::CVector3f x824_predictPos; zeus::CVector3f x824_predictPos;
float x830_intoGroundFactor = 1.f; float x830_intoGroundFactor = 1.f;
float x834_retreatTime; float x834_retreatTime;
union {
struct {
bool x838_24_hitSomething : 1; bool x838_24_hitSomething : 1;
bool x838_25_burrowing : 1; bool x838_25_burrowing : 1;
bool x838_26_canSkid : 1; bool x838_26_canSkid : 1;
};
u32 _dummy3 = 0;
};
void SquadAdd(CStateManager& mgr); void SquadAdd(CStateManager& mgr);
void SquadRemove(CStateManager& mgr); void SquadRemove(CStateManager& mgr);

View File

@ -23,6 +23,7 @@ CMetroid::CMetroid(TUniqueId uid, std::string_view name, EFlavorType flavor, con
const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo, const zeus::CTransform& xf, CModelData&& mData, const CPatternedInfo& pInfo,
const CActorParameters& aParms, const CMetroidData& metroidData, TUniqueId) const CActorParameters& aParms, const CMetroidData& metroidData, TUniqueId)
: CPatterned(ECharacter::Metroid, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer, : CPatterned(ECharacter::Metroid, uid, name, flavor, info, xf, std::move(mData), pInfo, EMovementType::Flyer,
EColliderType::One, EBodyType::Flyer, aParms, EKnockBackVariant::Medium) {} EColliderType::One, EBodyType::Flyer, aParms, EKnockBackVariant::Medium)
, x9bf_29_(false) {}
} // namespace urde::MP1 } // namespace urde::MP1

View File

@ -30,12 +30,7 @@ public:
}; };
class CMetroid : public CPatterned { class CMetroid : public CPatterned {
union {
struct {
bool x9bf_29_ : 1; bool x9bf_29_ : 1;
};
u32 _dummy = 0;
};
public: public:
DEFINE_PATTERNED(Metroid) DEFINE_PATTERNED(Metroid)

View File

@ -56,7 +56,15 @@ CMetroidBeta::CMetroidBeta(TUniqueId uid, std::string_view name, const CEntityIn
, x824_(std::make_unique<CParticleSwoosh>(x7f0_, 0)) , x824_(std::make_unique<CParticleSwoosh>(x7f0_, 0))
, x828_(std::make_unique<CElementGen>(x7fc_)) , x828_(std::make_unique<CElementGen>(x7fc_))
, x82c_(std::make_unique<CElementGen>(x808_)) , x82c_(std::make_unique<CElementGen>(x808_))
, x830_(std::make_unique<CElementGen>(x814_)) { , x830_(std::make_unique<CElementGen>(x814_))
, x840_24_(false)
, x840_25_(false)
, x840_26_(false)
, x840_27_(false)
, x840_28_(false)
, x840_29_(false)
, x840_30_(false)
, x840_31_(false) {
x820_->SetParticleEmission(false); x820_->SetParticleEmission(false);
x828_->SetParticleEmission(false); x828_->SetParticleEmission(false);
x82c_->SetParticleEmission(false); x82c_->SetParticleEmission(false);

View File

@ -75,8 +75,6 @@ class CMetroidBeta : public CPatterned {
float x834_ = 0.f; float x834_ = 0.f;
CRandom16 x838_ = CRandom16(1469); CRandom16 x838_ = CRandom16(1469);
float x83c_; float x83c_;
union {
struct {
bool x840_24_ : 1; bool x840_24_ : 1;
bool x840_25_ : 1; bool x840_25_ : 1;
bool x840_26_ : 1; bool x840_26_ : 1;
@ -85,9 +83,6 @@ class CMetroidBeta : public CPatterned {
bool x840_29_ : 1; bool x840_29_ : 1;
bool x840_30_ : 1; bool x840_30_ : 1;
bool x840_31_ : 1; bool x840_31_ : 1;
};
u32 _dummy = 0;
};
void CreateCollisionActorManager(CStateManager& mgr); void CreateCollisionActorManager(CStateManager& mgr);
void AddSphereJoints(SSphereJointInfo* sphereJoints, s32 count, std::vector<CJointCollisionDescription>& joints); void AddSphereJoints(SSphereJointInfo* sphereJoints, s32 count, std::vector<CJointCollisionDescription>& joints);

View File

@ -58,10 +58,19 @@ CParasite::CParasite(TUniqueId uid, std::string_view name, EFlavorType flavor, c
, x714_iceZoomerJointHP(iceZoomerJointHP) , x714_iceZoomerJointHP(iceZoomerJointHP)
, x73c_haltSfx(CSfxManager::TranslateSFXID(haltSfx)) , x73c_haltSfx(CSfxManager::TranslateSFXID(haltSfx))
, x73e_getUpSfx(CSfxManager::TranslateSFXID(getUpSfx)) , x73e_getUpSfx(CSfxManager::TranslateSFXID(getUpSfx))
, x740_crouchSfx(CSfxManager::TranslateSFXID(crouchSfx)) { , x740_crouchSfx(CSfxManager::TranslateSFXID(crouchSfx))
x742_28_onGround = true; , x742_24_receivedTelegraph(false)
x742_30_attackOver = true; , x742_25_jumpVelDirty(false)
, x742_26_(false)
, x742_27_landed(false)
, x742_28_onGround(true)
, x742_29_(false)
, x742_30_attackOver(true)
, x742_31_(false)
, x743_24_halted(false)
, x743_25_vulnerable(false)
, x743_26_oculusShotAt(false)
, x743_27_inJump(false) {
switch (x5d0_walkerType) { switch (x5d0_walkerType) {
case EWalkerType::Geemer: case EWalkerType::Geemer:
x460_knockBackController.SetEnableFreeze(false); x460_knockBackController.SetEnableFreeze(false);

View File

@ -70,8 +70,6 @@ class CParasite : public CWallWalker {
u16 x73c_haltSfx; u16 x73c_haltSfx;
u16 x73e_getUpSfx; u16 x73e_getUpSfx;
u16 x740_crouchSfx; u16 x740_crouchSfx;
union {
struct {
bool x742_24_receivedTelegraph : 1; bool x742_24_receivedTelegraph : 1;
bool x742_25_jumpVelDirty : 1; bool x742_25_jumpVelDirty : 1;
bool x742_26_ : 1; bool x742_26_ : 1;
@ -84,9 +82,7 @@ class CParasite : public CWallWalker {
bool x743_25_vulnerable : 1; bool x743_25_vulnerable : 1;
bool x743_26_oculusShotAt : 1; bool x743_26_oculusShotAt : 1;
bool x743_27_inJump : 1; bool x743_27_inJump : 1;
};
u16 _dummy = 0;
};
bool CloseToWall(const CStateManager& mgr) const; bool CloseToWall(const CStateManager& mgr) const;
void FaceTarget(const zeus::CVector3f& target); void FaceTarget(const zeus::CVector3f& target);
TUniqueId RecursiveFindClosestWayPoint(CStateManager& mgr, TUniqueId id, float& dist); TUniqueId RecursiveFindClosestWayPoint(CStateManager& mgr, TUniqueId id, float& dist);

View File

@ -418,6 +418,7 @@ CSpacePirate::CSpacePirate(TUniqueId uid, std::string_view name, const CEntityIn
x637_24_enablePatrol = false; x637_24_enablePatrol = false;
x637_25_enableAim = false; x637_25_enableAim = false;
x637_26_hearPlayerFire = false; x637_26_hearPlayerFire = false;
x637_27_inProjectilePath = false;
x637_28_noPlayerLos = false; x637_28_noPlayerLos = false;
x637_29_inWallHang = false; x637_29_inWallHang = false;
x637_30_jumpVelSet = false; x637_30_jumpVelSet = false;
@ -438,6 +439,7 @@ CSpacePirate::CSpacePirate(TUniqueId uid, std::string_view name, const CEntityIn
x639_29_enableBreakDodge = false; x639_29_enableBreakDodge = false;
x639_30_closeMelee = false; x639_30_closeMelee = false;
x639_31_sentAttackMsg = false; x639_31_sentAttackMsg = false;
x63a_24_normalDodge = false;
x758_headSeg = x64_modelData->GetAnimationData()->GetLocatorSegId("Head_1"sv); x758_headSeg = x64_modelData->GetAnimationData()->GetLocatorSegId("Head_1"sv);
x7b6_gunSeg = x64_modelData->GetAnimationData()->GetLocatorSegId("R_gun_LCTR"sv); x7b6_gunSeg = x64_modelData->GetAnimationData()->GetLocatorSegId("R_gun_LCTR"sv);
@ -2080,7 +2082,7 @@ void CSpacePirate::Cover(CStateManager& mgr, EStateMsg msg, float dt) {
case EStateMsg::Activate: case EStateMsg::Activate:
if (x450_bodyController->GetCurrentStateId() != pas::EAnimationState::Cover) { if (x450_bodyController->GetCurrentStateId() != pas::EAnimationState::Cover) {
if (CScriptCoverPoint* cp = GetCoverPoint(mgr, x640_coverPoint)) { if (CScriptCoverPoint* cp = GetCoverPoint(mgr, x640_coverPoint)) {
x79c_coverDir = (cp->GetAttackDirection() & 0x2) ? pas::ECoverDirection::Left : pas::ECoverDirection::Right; x79c_coverDir = cp->GetAttackDirection();
x32c_animState = EAnimState::Ready; x32c_animState = EAnimState::Ready;
x2e0_destPos = cp->GetTranslation(); x2e0_destPos = cp->GetTranslation();
TryCommand(mgr, pas::EAnimationState::Cover, &CPatterned::TryCover, int(x79c_coverDir)); TryCommand(mgr, pas::EAnimationState::Cover, &CPatterned::TryCover, int(x79c_coverDir));

View File

@ -97,8 +97,7 @@ private:
}; };
CSpacePirateData x568_pirateData; CSpacePirateData x568_pirateData;
union {
struct {
bool x634_24_pendingAmbush : 1; bool x634_24_pendingAmbush : 1;
bool x634_25_ceilingAmbush : 1; bool x634_25_ceilingAmbush : 1;
bool x634_26_nonAggressive : 1; bool x634_26_nonAggressive : 1;
@ -148,10 +147,6 @@ private:
bool x639_30_closeMelee : 1; bool x639_30_closeMelee : 1;
bool x639_31_sentAttackMsg : 1; bool x639_31_sentAttackMsg : 1;
bool x63a_24_normalDodge : 1; bool x63a_24_normalDodge : 1;
};
u64 _dummy = 0;
};
s32 x63c_frenzyFrames = 0; s32 x63c_frenzyFrames = 0;
TUniqueId x640_coverPoint = kInvalidUniqueId; TUniqueId x640_coverPoint = kInvalidUniqueId;

View File

@ -24,9 +24,15 @@ CWarWasp::CWarWasp(TUniqueId uid, std::string_view name, const CEntityInfo& info
, x590_pfSearch(nullptr, 0x3, pInfo.GetPathfindingIndex(), 1.f, 1.f) , x590_pfSearch(nullptr, 0x3, pInfo.GetPathfindingIndex(), 1.f, 1.f)
, x684_(dInfo1) , x684_(dInfo1)
, x6d4_projectileInfo(projectileWeapon, projectileDamage) , x6d4_projectileInfo(projectileWeapon, projectileDamage)
, x72c_projectileVisorSfx(CSfxManager::TranslateSFXID(projecileVisorSfx)) { , x72c_projectileVisorSfx(CSfxManager::TranslateSFXID(projecileVisorSfx))
x72e_24_jumpBackRepeat = true; , x72e_24_jumpBackRepeat(true)
x72e_26_initiallyInactive = !pInfo.GetActive(); , x72e_25_canApplyDamage(false)
, x72e_26_initiallyInactive(!pInfo.GetActive())
, x72e_27_teamMatesMelee(false)
, x72e_28_inProjectileAttack(false)
, x72e_29_pathObstructed(false)
, x72e_30_isRetreating(false)
, x72e_31_heardNoise(false) {
x6d4_projectileInfo.Token().Lock(); x6d4_projectileInfo.Token().Lock();
UpdateTouchBounds(); UpdateTouchBounds();
SetCoefficientOfRestitutionModifier(0.1f); SetCoefficientOfRestitutionModifier(0.1f);

View File

@ -33,8 +33,6 @@ class CWarWasp : public CPatterned {
float x718_circleBurstOffTotemAngle = zeus::degToRad(90.f); float x718_circleBurstOffTotemAngle = zeus::degToRad(90.f);
TLockedToken<CGenDescription> x71c_projectileVisorParticle; // Used to be optional TLockedToken<CGenDescription> x71c_projectileVisorParticle; // Used to be optional
u16 x72c_projectileVisorSfx; u16 x72c_projectileVisorSfx;
union {
struct {
bool x72e_24_jumpBackRepeat : 1; bool x72e_24_jumpBackRepeat : 1;
bool x72e_25_canApplyDamage : 1; bool x72e_25_canApplyDamage : 1;
bool x72e_26_initiallyInactive : 1; bool x72e_26_initiallyInactive : 1;
@ -43,9 +41,7 @@ class CWarWasp : public CPatterned {
bool x72e_29_pathObstructed : 1; bool x72e_29_pathObstructed : 1;
bool x72e_30_isRetreating : 1; bool x72e_30_isRetreating : 1;
bool x72e_31_heardNoise : 1; bool x72e_31_heardNoise : 1;
};
u32 _dummy = 0;
};
void SwarmAdd(CStateManager& mgr); void SwarmAdd(CStateManager& mgr);
void SwarmRemove(CStateManager& mgr); void SwarmRemove(CStateManager& mgr);
void ApplyDamage(CStateManager& mgr); void ApplyDamage(CStateManager& mgr);

View File

@ -9,7 +9,7 @@ CRandom16 CDecal::sDecalRandom;
bool CDecal::sMoveRedToAlphaBuffer = false; bool CDecal::sMoveRedToAlphaBuffer = false;
CDecal::CDecal(const TToken<CDecalDescription>& desc, const zeus::CTransform& xf) CDecal::CDecal(const TToken<CDecalDescription>& desc, const zeus::CTransform& xf)
: x0_description(desc), xc_transform(xf) { : x0_description(desc), xc_transform(xf), x5c_29_modelInvalid(false) {
CGlobalRandom gr(sDecalRandom); CGlobalRandom gr(sDecalRandom);
CDecalDescription& desco = *x0_description; CDecalDescription& desco = *x0_description;

View File

@ -13,17 +13,12 @@
namespace urde { namespace urde {
struct SQuadDescr; struct SQuadDescr;
struct CQuadDecal { struct CQuadDecal {
union {
struct {
bool x0_24_invalid : 1; bool x0_24_invalid : 1;
};
u32 _dummy = 0;
};
s32 x4_lifetime = 0; s32 x4_lifetime = 0;
float x8_rotation = 0.f; float x8_rotation = 0.f;
const SQuadDescr* m_desc = nullptr; const SQuadDescr* m_desc = nullptr;
CQuadDecal() = default; CQuadDecal() : x0_24_invalid(true) {}
CQuadDecal(s32 i, float f) : x4_lifetime(i), x8_rotation(f) { x0_24_invalid = true; } CQuadDecal(s32 i, float f) : x0_24_invalid(true), x4_lifetime(i), x8_rotation(f) {}
boo::ObjToken<boo::IGraphicsBufferD> m_instBuf; boo::ObjToken<boo::IGraphicsBufferD> m_instBuf;
boo::ObjToken<boo::IGraphicsBufferD> m_uniformBuf; boo::ObjToken<boo::IGraphicsBufferD> m_uniformBuf;
@ -41,14 +36,9 @@ class CDecal {
std::array<CQuadDecal, 2> x3c_decalQuads; std::array<CQuadDecal, 2> x3c_decalQuads;
s32 x54_modelLifetime = 0; s32 x54_modelLifetime = 0;
s32 x58_frameIdx = 0; s32 x58_frameIdx = 0;
union {
struct {
bool x5c_31_quad1Invalid : 1; bool x5c_31_quad1Invalid : 1;
bool x5c_30_quad2Invalid : 1; bool x5c_30_quad2Invalid : 1;
bool x5c_29_modelInvalid : 1; bool x5c_29_modelInvalid : 1;
};
u32 x5c_dummy = 0;
};
zeus::CVector3f x60_rotation; zeus::CVector3f x60_rotation;
bool InitQuad(CQuadDecal& quad, const SQuadDescr& desc); bool InitQuad(CQuadDecal& quad, const SQuadDescr& desc);

View File

@ -23,6 +23,8 @@ struct SQuadDescr {
class CDecalDescription { class CDecalDescription {
public: public:
CDecalDescription() : x5c_24_DMAB(false), x5c_25_DMOO(false) {}
SQuadDescr x0_Quads[2]; SQuadDescr x0_Quads[2];
SParticleModel x38_DMDL; SParticleModel x38_DMDL;
std::unique_ptr<CIntElement> x48_DLFT; std::unique_ptr<CIntElement> x48_DLFT;
@ -30,13 +32,8 @@ public:
std::unique_ptr<CVectorElement> x50_DMRT; std::unique_ptr<CVectorElement> x50_DMRT;
std::unique_ptr<CVectorElement> x54_DMSC; std::unique_ptr<CVectorElement> x54_DMSC;
std::unique_ptr<CColorElement> x58_DMCL; std::unique_ptr<CColorElement> x58_DMCL;
union {
struct {
bool x5c_24_DMAB : 1; bool x5c_24_DMAB : 1;
bool x5c_25_DMOO : 1; bool x5c_25_DMOO : 1;
}; };
u32 dummy = 0;
};
};
} // namespace urde } // namespace urde

View File

@ -54,12 +54,25 @@ void CElementGen::Initialize() {
void CElementGen::Shutdown() { CElementGenShaders::Shutdown(); } void CElementGen::Shutdown() { CElementGenShaders::Shutdown(); }
CElementGen::CElementGen(TToken<CGenDescription> gen, EModelOrientationType orientType, EOptionalSystemFlags flags) CElementGen::CElementGen(TToken<CGenDescription> gen, EModelOrientationType orientType, EOptionalSystemFlags flags)
: x1c_genDesc(std::move(gen)), x2c_orientType(orientType), x27c_randState(x94_randomSeed) { : x1c_genDesc(std::move(gen))
, x2c_orientType(orientType)
, x26c_24_translationDirty(false)
, x26c_25_LIT_(false)
, x26c_26_AAPH(false)
, x26c_27_ZBUF(false)
, x26c_28_zTest(false)
, x26c_29_ORNT(false)
, x26c_30_MBLR(false)
, x26c_31_LINE(false)
, x26d_24_FXLL(false)
, x26d_25_warmedUp(false)
, x26d_26_modelsUseLights(false)
, x26d_27_enableOPTS(True(flags & EOptionalSystemFlags::Two))
, x26d_28_enableADV(false)
, x27c_randState(x94_randomSeed) {
CGenDescription* desc = x1c_genDesc.GetObj(); CGenDescription* desc = x1c_genDesc.GetObj();
x28_loadedGenDesc = desc; x28_loadedGenDesc = desc;
x26d_27_enableOPTS = True(flags & EOptionalSystemFlags::Two);
if (desc->x54_x40_TEXR) if (desc->x54_x40_TEXR)
desc->x54_x40_TEXR->GetValueTexture(0).GetObj(); desc->x54_x40_TEXR->GetValueTexture(0).GetObj();
if (desc->x58_x44_TIND) if (desc->x58_x44_TIND)

View File

@ -87,9 +87,6 @@ private:
u32 x260_cumulativeParticles = 0; u32 x260_cumulativeParticles = 0;
u32 x264_recursiveParticleCount = 0; u32 x264_recursiveParticleCount = 0;
int x268_PSLT; int x268_PSLT;
union {
struct {
bool x26c_24_translationDirty : 1; bool x26c_24_translationDirty : 1;
bool x26c_25_LIT_ : 1; bool x26c_25_LIT_ : 1;
bool x26c_26_AAPH : 1; bool x26c_26_AAPH : 1;
@ -103,10 +100,6 @@ private:
bool x26d_26_modelsUseLights : 1; bool x26d_26_modelsUseLights : 1;
bool x26d_27_enableOPTS : 1; bool x26d_27_enableOPTS : 1;
bool x26d_28_enableADV : 1; bool x26d_28_enableADV : 1;
};
u32 _dummy = 0;
};
int x270_MBSP = 0; int x270_MBSP = 0;
int m_maxMBSP = 0; int m_maxMBSP = 0;
ERglLightBits x274_backupLightActive = ERglLightBits::None; ERglLightBits x274_backupLightActive = ERglLightBits::None;

View File

@ -39,8 +39,6 @@ public:
// std::unique_ptr<CVectorElement> x38_ILOC; // std::unique_ptr<CVectorElement> x38_ILOC;
// std::unique_ptr<CVectorElement> x3c_IVEC; // std::unique_ptr<CVectorElement> x3c_IVEC;
std::unique_ptr<CEmitterElement> x40_x2c_EMTR; std::unique_ptr<CEmitterElement> x40_x2c_EMTR;
union {
struct {
bool x44_28_x30_28_SORT : 1; bool x44_28_x30_28_SORT : 1;
bool x44_30_x31_24_MBLR : 1; bool x44_30_x31_24_MBLR : 1;
bool x44_24_x30_24_LINE : 1; bool x44_24_x30_24_LINE : 1;
@ -60,9 +58,6 @@ public:
/* 0-00 additions */ /* 0-00 additions */
bool x30_30_ORNT : 1; bool x30_30_ORNT : 1;
bool x30_31_RSOP : 1; bool x30_31_RSOP : 1;
};
u32 dummy1 = 0;
};
std::unique_ptr<CIntElement> x48_x34_MBSP; std::unique_ptr<CIntElement> x48_x34_MBSP;
std::unique_ptr<CRealElement> x4c_x38_SIZE; std::unique_ptr<CRealElement> x4c_x38_SIZE;
std::unique_ptr<CRealElement> x50_x3c_ROTA; std::unique_ptr<CRealElement> x50_x3c_ROTA;
@ -112,7 +107,25 @@ public:
/* Custom additions */ /* Custom additions */
std::unique_ptr<CColorElement> m_bevelGradient; /* FourCC BGCL */ std::unique_ptr<CColorElement> m_bevelGradient; /* FourCC BGCL */
CGenDescription() { x45_25_x31_27_PMOO = true; } CGenDescription()
: x44_28_x30_28_SORT(false)
, x44_30_x31_24_MBLR(false)
, x44_24_x30_24_LINE(false)
, x44_29_x30_29_LIT_(false)
, x44_26_x30_26_AAPH(false)
, x44_27_x30_27_ZBUF(false)
, x44_25_x30_25_FXLL(false)
, x44_31_x31_25_PMAB(false)
, x45_29_x31_31_VMD4(false)
, x45_28_x31_30_VMD3(false)
, x45_27_x31_29_VMD2(false)
, x45_26_x31_28_VMD1(false)
, x45_31_x32_25_OPTS(false)
, x45_24_x31_26_PMUS(false)
, x45_25_x31_27_PMOO(true)
, x45_30_x32_24_CIND(false)
, x30_30_ORNT(false)
, x30_31_RSOP(false) {}
}; };
} // namespace urde } // namespace urde

View File

@ -19,11 +19,16 @@ namespace urde {
u16 CParticleElectric::g_GlobalSeed = 99; u16 CParticleElectric::g_GlobalSeed = 99;
CParticleElectric::CParticleElectric(const TToken<CElectricDescription>& token) CParticleElectric::CParticleElectric(const TToken<CElectricDescription>& token)
: x1c_elecDesc(token), x14c_randState(g_GlobalSeed++) { : x1c_elecDesc(token)
, x14c_randState(g_GlobalSeed++)
, x450_24_emitting(true)
, x450_25_haveGPSM(false)
, x450_26_haveEPSM(false)
, x450_27_haveSSWH(false)
, x450_28_haveLWD(false)
, x450_29_transformDirty(true) {
x1bc_allocated.resize(32); x1bc_allocated.resize(32);
x450_24_emitting = true;
x450_29_transformDirty = true;
CElectricDescription* desc = x1c_elecDesc.GetObj(); CElectricDescription* desc = x1c_elecDesc.GetObj();
if (CIntElement* sseg = desc->x10_SSEG.get()) if (CIntElement* sseg = desc->x10_SSEG.get())

View File

@ -85,21 +85,15 @@ private:
std::vector<zeus::CVector3f> x420_calculatedVerts; std::vector<zeus::CVector3f> x420_calculatedVerts;
std::vector<float> x430_fractalMags; std::vector<float> x430_fractalMags;
std::vector<zeus::CVector3f> x440_fractalOffsets; std::vector<zeus::CVector3f> x440_fractalOffsets;
size_t m_nextLineRenderer = 0;
std::vector<std::unique_ptr<CLineRenderer>> m_lineRenderers;
union {
struct {
bool x450_24_emitting : 1; bool x450_24_emitting : 1;
bool x450_25_haveGPSM : 1; bool x450_25_haveGPSM : 1;
bool x450_26_haveEPSM : 1; bool x450_26_haveEPSM : 1;
bool x450_27_haveSSWH : 1; bool x450_27_haveSSWH : 1;
bool x450_28_haveLWD : 1; bool x450_28_haveLWD : 1;
bool x450_29_transformDirty : 1; bool x450_29_transformDirty : 1;
};
u32 dummy = 0; size_t m_nextLineRenderer = 0;
}; std::vector<std::unique_ptr<CLineRenderer>> m_lineRenderers;
void SetupLineGXMaterial(); void SetupLineGXMaterial();
void DrawLineStrip(const std::vector<zeus::CVector3f>& verts, float width, const zeus::CColor& color); void DrawLineStrip(const std::vector<zeus::CVector3f>& verts, float width, const zeus::CColor& color);

View File

@ -16,8 +16,16 @@ CParticleSwoosh::CParticleSwoosh(const TToken<CSwooshDescription>& desc, int len
, x1c0_rand(x1c_desc->x45_26_CRND ? std::chrono::duration_cast<std::chrono::microseconds>( , x1c0_rand(x1c_desc->x45_26_CRND ? std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::steady_clock::now().time_since_epoch()) std::chrono::steady_clock::now().time_since_epoch())
.count() .count()
: 99) { : 99)
x1d0_24_emitting = true; , x1d0_24_emitting(true)
, x1d0_25_AALP(false)
, x1d0_26_forceOneUpdate(false)
, x1d0_27_renderGaps(false)
, x1d0_28_LLRD(false)
, x1d0_29_VLS1(false)
, x1d0_30_VLS2(false)
, x1d0_31_constantTex(false)
, x1d1_24_constantUv(false) {
++g_ParticleSystemAliveCount; ++g_ParticleSystemAliveCount;
if (leng > 0) if (leng > 0)

View File

@ -83,9 +83,6 @@ class CParticleSwoosh : public CParticleGen {
float x1c4_ = 0.f; float x1c4_ = 0.f;
float x1c8_ = 0.f; float x1c8_ = 0.f;
float x1cc_TSPN; float x1cc_TSPN;
union {
struct {
bool x1d0_24_emitting : 1; bool x1d0_24_emitting : 1;
bool x1d0_25_AALP : 1; bool x1d0_25_AALP : 1;
bool x1d0_26_forceOneUpdate : 1; bool x1d0_26_forceOneUpdate : 1;
@ -95,9 +92,6 @@ class CParticleSwoosh : public CParticleGen {
bool x1d0_30_VLS2 : 1; bool x1d0_30_VLS2 : 1;
bool x1d0_31_constantTex : 1; bool x1d0_31_constantTex : 1;
bool x1d1_24_constantUv : 1; bool x1d1_24_constantUv : 1;
};
u32 _dummy = 0;
};
SUVElementSet x1d4_uvs = {}; SUVElementSet x1d4_uvs = {};
CTexture* x1e4_tex = nullptr; CTexture* x1e4_tex = nullptr;

View File

@ -31,8 +31,6 @@ public:
std::unique_ptr<CIntElement> x38_SPLN; std::unique_ptr<CIntElement> x38_SPLN;
std::unique_ptr<CUVElement> x3c_TEXR; std::unique_ptr<CUVElement> x3c_TEXR;
std::unique_ptr<CIntElement> x40_TSPN; std::unique_ptr<CIntElement> x40_TSPN;
union {
struct {
bool x44_24_LLRD : 1; bool x44_24_LLRD : 1;
bool x44_25_CROS : 1; bool x44_25_CROS : 1;
bool x44_26_VLS1 : 1; bool x44_26_VLS1 : 1;
@ -44,10 +42,18 @@ public:
bool x45_24_ZBUF : 1; bool x45_24_ZBUF : 1;
bool x45_25_ORNT : 1; bool x45_25_ORNT : 1;
bool x45_26_CRND : 1; bool x45_26_CRND : 1;
};
u32 dummy = 0;
};
CSwooshDescription() { x44_25_CROS = true; } CSwooshDescription()
: x44_24_LLRD(false)
, x44_25_CROS(true)
, x44_26_VLS1(false)
, x44_27_VLS2(false)
, x44_28_SROT(false)
, x44_29_WIRE(false)
, x44_30_TEXW(false)
, x44_31_AALP(false)
, x45_24_ZBUF(false)
, x45_25_ORNT(false)
, x45_26_CRND(false) {}
}; };
} // namespace urde } // namespace urde

View File

@ -9,7 +9,8 @@
#include <zeus/Math.hpp> #include <zeus/Math.hpp>
namespace urde { namespace urde {
CBurstFire::CBurstFire(const SBurst* const* burstDefs, s32 firstBurstCount) : x10_firstBurstCounter(firstBurstCount) { CBurstFire::CBurstFire(const SBurst* const* burstDefs, s32 firstBurstCount)
: x10_firstBurstCounter(firstBurstCount), x14_24_shouldFire(false), x14_25_avoidAccuracy(false) {
while (*burstDefs) { while (*burstDefs) {
x1c_burstDefs.push_back(*burstDefs); x1c_burstDefs.push_back(*burstDefs);
++burstDefs; ++burstDefs;

View File

@ -23,13 +23,8 @@ class CBurstFire {
float x8_timeToNextShot = 0.f; float x8_timeToNextShot = 0.f;
s32 xc_firstBurstIdx = 0; s32 xc_firstBurstIdx = 0;
s32 x10_firstBurstCounter; s32 x10_firstBurstCounter;
union {
struct {
bool x14_24_shouldFire : 1; bool x14_24_shouldFire : 1;
bool x14_25_avoidAccuracy : 1; bool x14_25_avoidAccuracy : 1;
};
u32 _dummy = 0;
};
const SBurst* x18_curBursts = nullptr; const SBurst* x18_curBursts = nullptr;
rstl::reserved_vector<const SBurst*, 16> x1c_burstDefs; rstl::reserved_vector<const SBurst*, 16> x1c_burstDefs;

View File

@ -20,13 +20,17 @@ CEnergyProjectile::CEnergyProjectile(bool active, const TToken<CWeaponDescriptio
const zeus::CTransform& xf, EMaterialTypes excludeMat, const CDamageInfo& damage, const zeus::CTransform& xf, EMaterialTypes excludeMat, const CDamageInfo& damage,
TUniqueId uid, TAreaId aid, TUniqueId owner, TUniqueId homingTarget, TUniqueId uid, TAreaId aid, TUniqueId owner, TUniqueId homingTarget,
EProjectileAttrib attribs, bool underwater, const zeus::CVector3f& scale, EProjectileAttrib attribs, bool underwater, const zeus::CVector3f& scale,
const std::optional<TLockedToken<CGenDescription>>& visorParticle, const std::optional<TLockedToken<CGenDescription>>& visorParticle, u16 visorSfx,
u16 visorSfx, bool sendCollideMsg) bool sendCollideMsg)
: CGameProjectile(active, desc, "GameProjectile", type, xf, excludeMat, damage, uid, aid, owner, homingTarget, attribs, : CGameProjectile(active, desc, "GameProjectile", type, xf, excludeMat, damage, uid, aid, owner, homingTarget, attribs,
underwater, scale, visorParticle, visorSfx, sendCollideMsg) underwater, scale, visorParticle, visorSfx, sendCollideMsg)
, x2ec_dir(xf.basis[1]) , x2ec_dir(xf.frontVector())
, x2f8_mag(x2ec_dir.magnitude()) , x2f8_mag(x2ec_dir.magnitude())
, x2fc_camShake(CCameraShakeData::BuildProjectileCameraShake(0.5f, 0.75f)) { , x2fc_camShake(CCameraShakeData::BuildProjectileCameraShake(0.5f, 0.75f))
, x3d0_24_dead(false)
, x3d0_25_(false)
, x3d0_26_(false)
, x3d0_27_camShakeDirty(false) {
xe6_27_thermalVisorFlags = 2; xe6_27_thermalVisorFlags = 2;
} }

View File

@ -10,15 +10,10 @@ class CEnergyProjectile : public CGameProjectile {
zeus::CVector3f x2ec_dir; zeus::CVector3f x2ec_dir;
float x2f8_mag; float x2f8_mag;
CCameraShakeData x2fc_camShake; CCameraShakeData x2fc_camShake;
union {
struct {
bool x3d0_24_dead : 1; bool x3d0_24_dead : 1;
bool x3d0_25_ : 1; bool x3d0_25_ : 1;
bool x3d0_26_ : 1; bool x3d0_26_ : 1;
bool x3d0_27_camShakeDirty : 1; bool x3d0_27_camShakeDirty : 1;
};
u32 _dummy = 0;
};
float x3d4_curTime = 0.f; float x3d4_curTime = 0.f;
void StopProjectile(CStateManager& mgr); void StopProjectile(CStateManager& mgr);

View File

@ -33,10 +33,8 @@ CFlameThrower::CFlameThrower(const TToken<CWeaponDescription>& wDesc, std::strin
, x3fc_playerIceTxtr(playerIceTxtr) , x3fc_playerIceTxtr(playerIceTxtr)
, x400_24_active(false) , x400_24_active(false)
, x400_25_particlesActive(false) , x400_25_particlesActive(false)
, x400_26_(!(flameInfo.GetAttributes() & 1)) , x400_26_((flameInfo.GetAttributes() & 1) == 0)
, x400_27_coneCollision((flameInfo.GetAttributes() & 0x2) != 0) { , x400_27_coneCollision((flameInfo.GetAttributes() & 0x2) != 0) {}
}
void CFlameThrower::Accept(IVisitor& visitor) { visitor.Visit(this); } void CFlameThrower::Accept(IVisitor& visitor) { visitor.Visit(this); }

View File

@ -31,16 +31,10 @@ private:
CAssetId x3f4_playerSteamTxtr; CAssetId x3f4_playerSteamTxtr;
s16 x3f8_playerHitSfx; s16 x3f8_playerHitSfx;
CAssetId x3fc_playerIceTxtr; CAssetId x3fc_playerIceTxtr;
union {
struct {
bool x400_24_active : 1; bool x400_24_active : 1;
bool x400_25_particlesActive : 1; bool x400_25_particlesActive : 1;
bool x400_26_ : 1; bool x400_26_ : 1;
bool x400_27_coneCollision : 1; /* Z-sort and finer collision detection */ bool x400_27_coneCollision : 1; /* Z-sort and finer collision detection */
};
u32 _dummy = 0;
};
void CreateFlameParticles(CStateManager&); void CreateFlameParticles(CStateManager&);
void SetFlameLightActive(CStateManager&, bool); void SetFlameLightActive(CStateManager&, bool);

View File

@ -11,16 +11,12 @@ class CGSComboFire {
s32 x4_loopState = -1; // In, loop, out s32 x4_loopState = -1; // In, loop, out
s32 x8_cueAnimId = -1; s32 x8_cueAnimId = -1;
s32 xc_gunId = -1; s32 xc_gunId = -1;
union {
struct {
bool x10_24_over : 1; bool x10_24_over : 1;
bool x10_25_idle : 1; bool x10_25_idle : 1;
};
u8 _dummy = 0;
};
public: public:
CGSComboFire() : x10_24_over(false), x10_25_idle(false) {}
bool IsComboOver() const { return x10_24_over; } bool IsComboOver() const { return x10_24_over; }
s32 GetLoopState() const { return x4_loopState; } s32 GetLoopState() const { return x4_loopState; }
void SetLoopState(s32 l) { x4_loopState = l; } void SetLoopState(s32 l) { x4_loopState = l; }

View File

@ -1,5 +1,7 @@
#include "Runtime/Weapon/CGameProjectile.hpp" #include "Runtime/Weapon/CGameProjectile.hpp"
#include <utility>
#include "Runtime/CStateManager.hpp" #include "Runtime/CStateManager.hpp"
#include "Runtime/Collision/CCollisionActor.hpp" #include "Runtime/Collision/CCollisionActor.hpp"
#include "Runtime/Collision/CInternalRayCastStructure.hpp" #include "Runtime/Collision/CInternalRayCastStructure.hpp"
@ -19,15 +21,15 @@ CGameProjectile::CGameProjectile(bool active, const TToken<CWeaponDescription>&
const CDamageInfo& dInfo, TUniqueId uid, TAreaId aid, TUniqueId owner, const CDamageInfo& dInfo, TUniqueId uid, TAreaId aid, TUniqueId owner,
TUniqueId homingTarget, EProjectileAttrib attribs, bool underwater, TUniqueId homingTarget, EProjectileAttrib attribs, bool underwater,
const zeus::CVector3f& scale, const zeus::CVector3f& scale,
const std::optional<TLockedToken<CGenDescription>>& visorParticle, std::optional<TLockedToken<CGenDescription>> visorParticle, u16 visorSfx,
u16 visorSfx, bool sendCollideMsg) bool sendCollideMsg)
: CWeapon(uid, aid, active, owner, wType, name, xf, : CWeapon(uid, aid, active, owner, wType, name, xf,
CMaterialFilter::MakeIncludeExclude( CMaterialFilter::MakeIncludeExclude(
{EMaterialTypes::Solid, EMaterialTypes::NonSolidDamageable}, {EMaterialTypes::Solid, EMaterialTypes::NonSolidDamageable},
{EMaterialTypes::Projectile, EMaterialTypes::ProjectilePassthrough, excludeMat}), {EMaterialTypes::Projectile, EMaterialTypes::ProjectilePassthrough, excludeMat}),
CMaterialList(EMaterialTypes::Projectile), dInfo, attribs | GetBeamAttribType(wType), CMaterialList(EMaterialTypes::Projectile), dInfo, attribs | GetBeamAttribType(wType),
CModelData::CModelDataNull()) CModelData::CModelDataNull())
, x158_visorParticle(visorParticle) , x158_visorParticle(std::move(visorParticle))
, x168_visorSfx(visorSfx) , x168_visorSfx(visorSfx)
, x170_projectile(wDesc, xf.origin, xf.basis, scale, , x170_projectile(wDesc, xf.origin, xf.basis, scale,
(attribs & EProjectileAttrib::ParticleOPTS) == EProjectileAttrib::ParticleOPTS) (attribs & EProjectileAttrib::ParticleOPTS) == EProjectileAttrib::ParticleOPTS)
@ -35,13 +37,12 @@ CGameProjectile::CGameProjectile(bool active, const TToken<CWeaponDescription>&
, x2a4_projExtent((xe8_projectileAttribs & EProjectileAttrib::BigProjectile) == EProjectileAttrib::BigProjectile ? 0.25f , x2a4_projExtent((xe8_projectileAttribs & EProjectileAttrib::BigProjectile) == EProjectileAttrib::BigProjectile ? 0.25f
: 0.1f) : 0.1f)
, x2c0_homingTargetId(homingTarget) , x2c0_homingTargetId(homingTarget)
, x2cc_wpscId(wDesc.GetObjectTag()->id) { , x2cc_wpscId(wDesc.GetObjectTag()->id)
x2e4_24_active = true; , x2e4_24_active(true)
x2e4_25_startedUnderwater = underwater; , x2e4_25_startedUnderwater(underwater)
x2e4_26_waterUpdate = underwater; , x2e4_26_waterUpdate(underwater)
x2e4_27_inWater = underwater; , x2e4_27_inWater(underwater)
x2e4_28_sendProjectileCollideMsg = sendCollideMsg; , x2e4_28_sendProjectileCollideMsg(sendCollideMsg) {}
}
void CGameProjectile::Accept(urde::IVisitor& visitor) { visitor.Visit(this); } void CGameProjectile::Accept(urde::IVisitor& visitor) { visitor.Visit(this); }

Some files were not shown because too many files have changed in this diff Show More