Working CScriptGunTurret

This commit is contained in:
Jack Andersen 2019-02-17 19:47:46 -10:00
parent 6441bcc3a2
commit 48eaa2545b
63 changed files with 1340 additions and 761 deletions

View File

@ -12,6 +12,25 @@
<option name="SPACE_AFTER_REFERENCE_IN_DECLARATION" value="true" />
</Objective-C>
<Objective-C-extensions>
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cpp" header="hpp" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />

View File

@ -130,7 +130,7 @@ else()
message(STATUS "Building with x87 Vector ISA")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -fno-exceptions -fno-rtti -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -Werror=implicit-fallthrough -fno-exceptions -fno-rtti -Werror")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations")

View File

@ -11,6 +11,7 @@ size_t ComputeBitstreamSize(size_t keyFrameCount, const std::vector<Channel>& ch
switch (chan.type) {
case Channel::Type::Rotation:
bitsPerKeyFrame += 1;
[[fallthrough]];
case Channel::Type::Translation:
case Channel::Type::Scale:
bitsPerKeyFrame += chan.q[0];

View File

@ -652,6 +652,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
lastDlSec = s + reader.readUint32Big() + 1;
break;
}
[[fallthrough]];
}
default: {
if (!visitedDLOffsets) {
@ -786,6 +787,7 @@ atUint32 ReadGeomSectionsToBlender(hecl::blender::PyOutStream& os, athena::io::I
visitedDLOffsets = true;
break;
}
[[fallthrough]];
}
default: {
if (!visitedDLOffsets) {

View File

@ -32,6 +32,7 @@ void DPSM<IDType>::_read(athena::io::YAMLDocReader& r) {
case SBIG('1TEX'):
case SBIG('1ADD'):
loadFirstDesc = true;
[[fallthrough]];
case SBIG('2SZE'):
case SBIG('2LFT'):
case SBIG('2ROT'):
@ -250,6 +251,7 @@ void DPSM<IDType>::_read(athena::io::IStreamReader& r) {
case SBIG('1TEX'):
case SBIG('1ADD'):
loadFirstDesc = true;
[[fallthrough]];
case SBIG('2SZE'):
case SBIG('2LFT'):
case SBIG('2ROT'):

View File

@ -373,6 +373,7 @@ bool FRME::Extract(const SpecBase& dataSpec, PAKEntryReadStream& rs, const hecl:
case LITEInfo::ELightType::Spot:
case LITEInfo::ELightType::Directional:
os << "angle = Quaternion((1.0, 0.0, 0.0), math.radians(90.0))\n";
[[fallthrough]];
default: {
zeus::simd_floats colorF(w.header.color.simd);
os.format(

View File

@ -13,105 +13,105 @@ struct GunTurret : IScriptObject {
Value<atVec3f> location;
Value<atVec3f> orientation;
Value<atVec3f> scale;
Value<atVec3f> unknown2;
Value<atVec3f> scanOffset;
Value<atVec3f> collisionExtent;
Value<atVec3f> collisionOffset;
AnimationParameters animationParameters;
ActorParameters actorParameters;
HealthInfo healthInfo;
DamageVulnerability damageVulnerabilty;
Value<float> unknown3;
Value<float> unknown4;
Value<float> unknown5;
Value<float> unknown6;
Value<float> unknown7;
Value<float> unknown8;
Value<float> unknown9;
Value<float> unknown10;
Value<float> unknown11;
Value<float> unknown12;
Value<float> unknown13;
Value<float> unknown14;
Value<float> unknown15;
Value<float> unknown16;
Value<bool> unknown17;
UniqueID32 unknown18;
DamageInfo damageInfo;
UniqueID32 particle1;
UniqueID32 particle2;
UniqueID32 particle3;
UniqueID32 particle4;
UniqueID32 particle5;
UniqueID32 particle6;
UniqueID32 particle7;
Value<atUint32> unknown19;
Value<atUint32> unknown20;
Value<atUint32> unknown21;
Value<atUint32> unknown22;
Value<atUint32> unknown23;
Value<atUint32> unknown24;
UniqueID32 model;
Value<float> unknown25;
Value<atUint32> unknown26;
Value<atUint32> unknown27;
Value<atUint32> unknown28;
Value<float> unknown29;
Value<bool> unknown30;
Value<float> intoDeactivateDelay;
Value<float> reloadTime;
Value<float> reloadTimeVariance;
Value<float> panStartTime;
Value<float> panHoldTime;
Value<float> totalPanSearchTime;
Value<float> leftMaxAngle;
Value<float> rightMaxAngle;
Value<float> downMaxAngle;
Value<float> turnSpeed;
Value<float> detectionRange;
Value<float> detectionZRange;
Value<float> freezeDuration;
Value<float> freezeVariance;
Value<bool> freezeTimeout;
UniqueID32 projectileRes;
DamageInfo projectileDamage;
UniqueID32 idleLightRes;
UniqueID32 deactivateLightRes;
UniqueID32 targettingLightRes;
UniqueID32 frozenEffectRes;
UniqueID32 chargingEffectRes;
UniqueID32 panningEffectRes;
UniqueID32 visorEffectRes;
Value<atUint32> trackingSoundId;
Value<atUint32> lockOnSoundId;
Value<atUint32> unfreezeSoundId;
Value<atUint32> stopClankSoundId;
Value<atUint32> chargingSoundId;
Value<atUint32> visorSoundId;
UniqueID32 extensionModelResId;
Value<float> extensionDropDownDist;
Value<atUint32> numInitialShots;
Value<atUint32> initialShotTableIndex;
Value<atUint32> numSubsequentShots;
Value<float> frenzyDuration;
Value<bool> scriptedStartOnly;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, animationParameters);
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
if (unknown18) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(unknown18);
ent->name = name + "_unknown18";
if (projectileRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(projectileRes);
ent->name = name + "_projectileRes";
}
if (model) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(model);
ent->name = name + "_model";
if (idleLightRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(idleLightRes);
ent->name = name + "_idleLightRes";
}
if (particle1) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle1);
ent->name = name + "_part1";
if (deactivateLightRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(deactivateLightRes);
ent->name = name + "_deactivateLightRes";
}
if (particle2) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle2);
ent->name = name + "_part2";
if (targettingLightRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(targettingLightRes);
ent->name = name + "_targettingLightRes";
}
if (particle3) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle3);
ent->name = name + "_part3";
if (frozenEffectRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(frozenEffectRes);
ent->name = name + "_frozenEffectRes";
}
if (particle4) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle4);
ent->name = name + "_part4";
if (chargingEffectRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(chargingEffectRes);
ent->name = name + "_chargingEffectRes";
}
if (particle5) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle5);
ent->name = name + "_part5";
if (panningEffectRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(panningEffectRes);
ent->name = name + "_panningEffectRes";
}
if (particle6) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle6);
ent->name = name + "_part6";
if (visorEffectRes) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(visorEffectRes);
ent->name = name + "_visorEffectRes";
}
if (particle7) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle7);
ent->name = name + "_part7";
if (extensionModelResId) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(extensionModelResId);
ent->name = name + "_extensionModelResId";
}
animationParameters.nameANCS(pakRouter, name + "_animp");
actorParameters.nameIDs(pakRouter, name + "_actp");
}
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const {
g_curSpec->flattenDependencies(unknown18, pathsOut);
g_curSpec->flattenDependencies(model, pathsOut);
g_curSpec->flattenDependencies(particle1, pathsOut);
g_curSpec->flattenDependencies(particle2, pathsOut);
g_curSpec->flattenDependencies(particle3, pathsOut);
g_curSpec->flattenDependencies(particle4, pathsOut);
g_curSpec->flattenDependencies(particle5, pathsOut);
g_curSpec->flattenDependencies(particle6, pathsOut);
g_curSpec->flattenDependencies(particle7, pathsOut);
g_curSpec->flattenDependencies(projectileRes, pathsOut);
g_curSpec->flattenDependencies(idleLightRes, pathsOut);
g_curSpec->flattenDependencies(deactivateLightRes, pathsOut);
g_curSpec->flattenDependencies(targettingLightRes, pathsOut);
g_curSpec->flattenDependencies(frozenEffectRes, pathsOut);
g_curSpec->flattenDependencies(chargingEffectRes, pathsOut);
g_curSpec->flattenDependencies(panningEffectRes, pathsOut);
g_curSpec->flattenDependencies(visorEffectRes, pathsOut);
g_curSpec->flattenDependencies(extensionModelResId, pathsOut);
animationParameters.depANCS(pathsOut);
actorParameters.depIDs(pathsOut, lazyOut);
}

View File

@ -5,6 +5,7 @@
#include "Parameters.hpp"
namespace DataSpec::DNAMP1 {
struct Pickup : IScriptObject {
AT_DECL_DNA_YAML
AT_DECL_DNAV
@ -17,23 +18,23 @@ struct Pickup : IScriptObject {
Value<atUint32> pickupType;
Value<atUint32> capacity;
Value<atUint32> amount;
Value<float> dropRate;
Value<float> lifetime;
Value<float> spawnDelay;
Value<float> possibility;
Value<float> lifeTime;
Value<float> fadeInTime;
UniqueID32 model;
AnimationParameters animationParameters;
ActorParameters actorParameters;
Value<bool> active;
Value<float> unknown1;
UniqueID32 particle;
Value<float> startDelay;
UniqueID32 pickupParticle;
void addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const {
actorParameters.addCMDLRigPairs(pakRouter, charAssoc, animationParameters);
}
void nameIDs(PAKRouter<PAKBridge>& pakRouter) const {
if (particle) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(particle);
if (pickupParticle) {
PAK::Entry* ent = (PAK::Entry*)pakRouter.lookupEntry(pickupParticle);
ent->name = name + "_part";
}
if (model) {
@ -45,7 +46,7 @@ struct Pickup : IScriptObject {
}
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut, std::vector<hecl::ProjectPath>& lazyOut) const {
g_curSpec->flattenDependencies(particle, pathsOut);
g_curSpec->flattenDependencies(pickupParticle, pathsOut);
g_curSpec->flattenDependencies(model, pathsOut);
animationParameters.depANCS(pathsOut);
actorParameters.depIDs(pathsOut, lazyOut);
@ -53,4 +54,5 @@ struct Pickup : IScriptObject {
void gatherScans(std::vector<Scan>& scansOut) const { actorParameters.scanIDs(scansOut); }
};
} // namespace DataSpec::DNAMP1

View File

@ -124,12 +124,14 @@ bool CAutoMapper::CheckLoadComplete() {
if (!x3c_hintBeacon.IsLoaded())
return false;
x4_loadPhase = ELoadPhase::LoadUniverse;
[[fallthrough]];
case ELoadPhase::LoadUniverse:
if (!x8_mapu.IsLoaded())
return false;
x14_dummyWorlds.resize(x8_mapu->GetNumMapWorldDatas());
SetCurWorldAssetId(x24_world->IGetWorldAssetId());
x4_loadPhase = ELoadPhase::Done;
[[fallthrough]];
case ELoadPhase::Done:
return true;
default:

View File

@ -85,6 +85,7 @@ std::pair<zeus::CColor, zeus::CColor> CMappableObject::GetDoorColors(int curArea
case EMappableObjectType::PlasmaDoorFloor:
case EMappableObjectType::PlasmaDoorFloor2:
colorIdx = 4;
break;
default:
break;
}

View File

@ -639,6 +639,7 @@ void CHintOptions::Update(float dt, const CStateManager& stateMgr) {
case EHintState::Displaying:
if (x10_nextHintIdx == -1)
x10_nextHintIdx = idx;
break;
default:
break;
}

View File

@ -73,6 +73,7 @@ bool CIOWinManager::DistributeOneMessage(const CArchitectureMessage& msg, CArchi
case CIOWin::EMessageReturn::RemoveIOWinAndExit:
case CIOWin::EMessageReturn::RemoveIOWin:
RemoveIOWin(iow);
break;
default:
break;
}

View File

@ -322,7 +322,7 @@ void CPlayerState::IncrPickup(EItemType type, u32 amount) {
}
case EItemType::HealthRefill:
xc_health.SetHP(std::min(amount + xc_health.GetHP(), CalculateHealth()));
[[fallthrough]];
break;
default:
break;
}

View File

@ -1691,6 +1691,7 @@ void CStateManager::SetGameState(EGameState state) {
if (!x88c_rumbleManager->IsDisabled())
x88c_rumbleManager->SetDisabled(true);
x850_world->SetLoadPauseState(true);
break;
default:
break;
}

View File

@ -249,6 +249,7 @@ void CBallCamera::SetState(EBallCameraState state, CStateManager& mgr) {
SetFovInterpolation(mgr.GetCameraManager()->GetFirstPersonCamera()->GetFov(), CCameraManager::ThirdPersonFOV(), 1.f,
0.f);
x36c_splineState = ESplineState::Invalid;
[[fallthrough]];
}
case EBallCameraState::Default:
case EBallCameraState::Chase:
@ -1804,6 +1805,7 @@ void CBallCamera::Think(float dt, CStateManager& mgr) {
colAct->SetActive(false);
return;
}
[[fallthrough]];
case CPlayer::EPlayerCameraState::Ball:
case CPlayer::EPlayerCameraState::Transitioning:
case CPlayer::EPlayerCameraState::Two: {

View File

@ -50,6 +50,7 @@ void CAdditiveAnimPlayback::Update(float dt) {
if (std::fabs(x10_curWeight) < 0.00001f)
x1c_phase = EAdditivePlaybackPhase::FadedOut;
break;
}
default:
break;
@ -64,6 +65,7 @@ void CAdditiveAnimPlayback::FadeOut() {
break;
case EAdditivePlaybackPhase::FadingIn:
x18_weightTimer = x18_weightTimer / x0_info.GetFadeInDuration() * x0_info.GetFadeOutDuration();
break;
default:
break;
}

View File

@ -36,6 +36,7 @@ CAnimFormatUnion::~CAnimFormatUnion() {
case EAnimFormat::BitstreamCompressed:
case EAnimFormat::BitstreamCompressed24:
reinterpret_cast<CFBStreamedCompression*>(x4_storage)->~CFBStreamedCompression();
break;
default:
break;
}

View File

@ -27,6 +27,7 @@ public:
void Update(float dt, CStateManager& mgr, CCollisionActorManager::EUpdateOptions opts);
void Destroy(CStateManager& mgr) const;
void SetActive(CStateManager& mgr, bool active);
bool GetActive() const { return x12_active; }
void AddMaterial(CStateManager& mgr, const CMaterialList& list);
void SetMovable(CStateManager& mgr, bool movable);

View File

@ -799,6 +799,7 @@ void CBooRenderer::DrawUnsortedGeometry(int areaIdx, int mask, int targetMask, b
model->x40_25_modelVisible = false;
continue;
}
break;
}
default:
break;

View File

@ -161,11 +161,13 @@ void CGuiWidget::RecalcWidgetColor(ETraversalMode mode) {
CGuiWidget* nextSib = static_cast<CGuiWidget*>(GetNextSibling());
if (nextSib)
nextSib->RecalcWidgetColor(ETraversalMode::ChildrenAndSiblings);
[[fallthrough]];
}
case ETraversalMode::Children: {
CGuiWidget* child = static_cast<CGuiWidget*>(GetChildObject());
if (child)
child->RecalcWidgetColor(ETraversalMode::ChildrenAndSiblings);
break;
}
default:
break;

View File

@ -153,6 +153,7 @@ void CHudMissileInterface::Update(float dt, const CStateManager& mgr) {
break;
case EInventoryStatus::Depleted:
string = g_MainStringTable->GetString(13); // Depleted
break;
default:
break;
}

View File

@ -1816,6 +1816,7 @@ void CFrontEndUI::StartStateTransition(EScreen screen) {
CSfxManager::SfxStart(SFXfnt_fromfusion_L, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
CSfxManager::SfxStart(SFXfnt_fromfusion_R, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
}
break;
default:
break;
}
@ -1829,6 +1830,7 @@ void CFrontEndUI::StartStateTransition(EScreen screen) {
case EScreen::AttractMovie:
StartAttractMovie();
SetFadeBlackWithMovie();
break;
default:
break;
}
@ -2202,6 +2204,7 @@ CIOWin::EMessageReturn CFrontEndUI::Update(float dt, CArchitectureQueue& queue)
/* No memory card available, fallback to non-save UI */
xe0_frontendCardFrme.reset();
xdc_saveUI.reset();
break;
default:
break;
}
@ -2218,6 +2221,7 @@ CIOWin::EMessageReturn CFrontEndUI::Update(float dt, CArchitectureQueue& queue)
FinishedLoadingDepsGroup();
x20_depsGroup.Unlock();
x14_phase = EPhase::LoadDeps;
[[fallthrough]];
case EPhase::LoadDeps:
/* Poll loading DGRP resources */
@ -2233,6 +2237,7 @@ CIOWin::EMessageReturn CFrontEndUI::Update(float dt, CArchitectureQueue& queue)
}
if (x14_phase == EPhase::LoadDeps)
return EMessageReturn::Exit;
[[fallthrough]];
case EPhase::LoadFrames:
/* Poll loading music and FRME resources */
@ -2242,6 +2247,7 @@ CIOWin::EMessageReturn CFrontEndUI::Update(float dt, CArchitectureQueue& queue)
xf4_curAudio = xd4_audio1.get();
xf4_curAudio->StartMixing();
x14_phase = EPhase::LoadMovies;
[[fallthrough]];
case EPhase::LoadMovies: {
/* Poll loading movies */
@ -2263,8 +2269,10 @@ CIOWin::EMessageReturn CFrontEndUI::Update(float dt, CArchitectureQueue& queue)
x14_phase = EPhase::DisplayFrontEnd;
m_touchBar->SetPhase(CFrontEndUITouchBar::EPhase::PressStart);
StartStateTransition(EScreen::Title);
} else
} else {
return EMessageReturn::Exit;
}
[[fallthrough]];
}
case EPhase::DisplayFrontEnd:

View File

@ -127,6 +127,7 @@ void CGBASupport::Update(float dt) {
case EPhase::StartProbeTimeout:
x38_timeout = 4.f;
x34_phase = EPhase::PollProbe;
[[fallthrough]];
case EPhase::PollProbe:
/* SIProbe poll normally occurs here with 4 second timeout */
@ -136,6 +137,7 @@ void CGBASupport::Update(float dt) {
}
x40_siChan = g_JbusEndpoint->getChan();
x34_phase = EPhase::StartJoyBusBoot;
[[fallthrough]];
case EPhase::StartJoyBusBoot:
x34_phase = EPhase::PollJoyBusBoot;

View File

@ -143,6 +143,7 @@ void CInGameGuiManager::DoStateTransition(CStateManager& stateMgr) {
CDependencyGroup* suitGrp = x5c_pauseScreenDGRPs[suitResIdx].GetObj();
x48_pauseScreen = std::make_unique<CPauseScreen>(screen, *suitGrp, *suitGrp);
}
[[fallthrough]];
case EInGameGuiState::MapScreen:
case EInGameGuiState::PauseSaveGame:
@ -201,6 +202,7 @@ bool CInGameGuiManager::CheckLoadComplete(CStateManager& stateMgr) {
}
x0_iggmPreLoad.Unlock();
x18_loadPhase = ELoadPhase::PreLoadDeps;
[[fallthrough]];
}
case ELoadPhase::PreLoadDeps: {
for (CToken& tok : x8_preLoadDeps)
@ -212,6 +214,7 @@ bool CInGameGuiManager::CheckLoadComplete(CStateManager& stateMgr) {
x38_autoMapper = std::make_unique<CAutoMapper>(stateMgr);
x3c_pauseScreenBlur = std::make_unique<CPauseScreenBlur>();
x40_samusReflection = std::make_unique<CSamusFaceReflection>(stateMgr);
[[fallthrough]];
}
case ELoadPhase::LoadDeps: {
if (!x38_autoMapper->CheckLoadComplete())
@ -241,6 +244,7 @@ bool CInGameGuiManager::CheckLoadComplete(CStateManager& stateMgr) {
BeginStateTransition(EInGameGuiState::InGame, stateMgr);
x18_loadPhase = ELoadPhase::Done;
[[fallthrough]];
}
case ELoadPhase::Done: {
x34_samusHud->Touch();

View File

@ -50,6 +50,7 @@ CIOWin::EMessageReturn CMFGame::OnMessage(const CArchitectureMessage& msg, CArch
x28_skippedCineCam = kInvalidUniqueId;
break;
}
[[fallthrough]];
}
case EGameFlowState::InGame: {
x14_stateManager->SetActiveRandomToDefault();
@ -101,6 +102,7 @@ CIOWin::EMessageReturn CMFGame::OnMessage(const CArchitectureMessage& msg, CArch
x14_stateManager->Update(dt);
x14_stateManager->ClearActiveRandom();
}
break;
}
default:
break;
@ -261,6 +263,7 @@ CMFGameLoader::CMFGameLoader() : CMFGameLoaderBase("CMFGameLoader") {
16.f, 1.f);
}
}
break;
}
default:
break;
@ -346,6 +349,7 @@ CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg,
std::make_shared<CMFGame>(x14_stateMgr, x18_guiMgr, queue)));
return EMessageReturn::RemoveIOWinAndExit;
}
break;
}
default:
break;

View File

@ -31,6 +31,7 @@ void CMainFlow::AdvanceGameState(CArchitectureQueue& queue) {
MP1::CMain* main = static_cast<MP1::CMain*>(g_Main);
if (main->GetFlowState() != EFlowState::None && main->GetFlowState() != EFlowState::StateSetter)
main->SetX30(true);
[[fallthrough]];
}
case EClientFlowStates::Unspecified:
SetGameState(EClientFlowStates::PreFrontEnd, queue);

View File

@ -709,6 +709,7 @@ void CMemoryCardDriver::HandleCardError(ECardResult result, EState state) {
case ECardResult::IOERROR:
x10_state = state;
x14_error = EError::CardIOError;
[[fallthrough]];
case ECardResult::ENCODING:
x10_state = state;
x14_error = EError::CardWrongCharacterSet;

View File

@ -267,6 +267,7 @@ void CSamusHud::InitializeFrameGlueMutable(const CStateManager& mgr) {
}
case EHudState::None:
UninitializeFrameGlueMutable();
break;
default:
break;
}
@ -1137,10 +1138,13 @@ void CSamusHud::Update(float dt, const CStateManager& mgr, CInGameGuiManager::EH
break;
case CInGameGuiManager::EHelmetVisMode::GlowHelmetDeco:
glowVisible = true;
[[fallthrough]];
case CInGameGuiManager::EHelmetVisMode::HelmetDeco:
helmetVisible = true;
[[fallthrough]];
case CInGameGuiManager::EHelmetVisMode::Deco:
decoVisible = true;
break;
default:
break;
}
@ -1492,6 +1496,7 @@ void CSamusHud::UpdateStateTransition(float dt, const CStateManager& mgr) {
}
if (x2c4_activeTransState != ETransitionState::Loading)
return;
[[fallthrough]];
case ETransitionState::Loading:
if (x278_selectedHud) {
if (!x278_selectedHud.IsLoaded() || !x278_selectedHud->GetIsFinishedLoading())
@ -1513,6 +1518,7 @@ void CSamusHud::UpdateStateTransition(float dt, const CStateManager& mgr) {
x2c8_transT = std::min(1.f, 5.f * dt + x2c8_transT);
if (x2c8_transT == 1.f)
x2c4_activeTransState = ETransitionState::NotTransitioning;
break;
default:
break;
}
@ -1524,17 +1530,20 @@ bool CSamusHud::CheckLoadComplete(CStateManager& stateMgr) {
if (!x8_targetingMgr.CheckLoadComplete())
return false;
x4_loadPhase = ELoadPhase::One;
[[fallthrough]];
case ELoadPhase::One:
UpdateStateTransition(1.f, stateMgr);
if (x2bc_nextState != x2c0_setState)
return false;
x4_loadPhase = ELoadPhase::Two;
[[fallthrough]];
case ELoadPhase::Two:
if (!x264_loadedFrmeHelmet->GetIsFinishedLoading())
return false;
if (!x274_loadedFrmeBaseHud->GetIsFinishedLoading())
return false;
x4_loadPhase = ELoadPhase::Three;
[[fallthrough]];
case ELoadPhase::Three:
return true;
default:

View File

@ -509,6 +509,7 @@ void CSaveGameScreen::DoAdvance(CGuiTableGroup* caller) {
sfx = x8c_navBackSfx;
}
}
break;
default:
break;

View File

@ -85,6 +85,7 @@ CIOWin::EMessageReturn CSlideShow::OnMessage(const CArchitectureMessage& msg, CA
// return EMessageReturn::Exit;
//}
x14_phase = Phase::One;
[[fallthrough]];
}
case Phase::One: {
if (x18_galleryTXTRDeps.empty()) {
@ -100,12 +101,13 @@ CIOWin::EMessageReturn CSlideShow::OnMessage(const CArchitectureMessage& msg, CA
return EMessageReturn::Exit;
x14_phase = Phase::Three;
[[fallthrough]];
}
case Phase::Two:
case Phase::Three: {
}
case Phase::Three:
case Phase::Four:
case Phase::Five:
break;
default:
break;
}

View File

@ -526,6 +526,7 @@ void CBeetle::Deactivate(CStateManager& mgr, EStateMsg msg, float dt) {
default:
break;
}
break;
default:
break;
}

View File

@ -34,6 +34,7 @@ void CMagdolite::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CState
//x584_boneTracker.SetActive(false);
CreateShadow(false);
/* TODO Finish */
break;
default:
break;
}

View File

@ -63,6 +63,7 @@ CParasite::CParasite(TUniqueId uid, std::string_view name, EFlavorType flavor, c
switch (x5d0_walkerType) {
case EWalkerType::Geemer:
x460_knockBackController.SetEnableFreeze(false);
[[fallthrough]];
case EWalkerType::Oculus:
x460_knockBackController.SetAutoResetImpulse(false);
break;
@ -72,6 +73,7 @@ CParasite::CParasite(TUniqueId uid, std::string_view name, EFlavorType flavor, c
x624_extraModel =
CToken(TObjOwnerDerivedFromIObj<CSkinnedModel>::GetNewDerivedObject(std::make_unique<CSkinnedModel>(
model, skin, x64_modelData->AnimationData()->GetModelData()->GetLayoutInfo(), 1, 1)));
break;
}
default:
break;

View File

@ -43,6 +43,7 @@ bool CDecalDataFactory::CreateDPSM(CDecalDescription* desc, CInputStream& in, CS
case SBIG('1TEX'):
case SBIG('1ADD'):
loadFirstDesc = true;
[[fallthrough]];
case SBIG('2LFT'):
case SBIG('2SZE'):
case SBIG('2ROT'):

View File

@ -710,6 +710,7 @@ void CElementGen::UpdateLightParameters() {
if (CRealElement* lsla = desc->x11c_x108_LSLA.get())
lsla->GetValue(x74_curFrame, x334_LSLA);
}
[[fallthrough]];
}
case LightType::Directional: {
if (x308_lightType != LightType::Custom) {

View File

@ -131,8 +131,10 @@ void CGunController::ReturnToDefault(CStateManager& mgr, float dt, bool setState
switch (x50_gunState) {
case EGunState::Strike:
x50_gunState = EGunState::FreeLook;
[[fallthrough]];
case EGunState::Idle:
x4_freeLook.SetIdle(false);
[[fallthrough]];
case EGunState::FreeLook:
if (setState)
break;

View File

@ -77,6 +77,7 @@ void CIceBeam::EnableSecondaryFx(ESecondaryFxType type) {
case ESecondaryFxType::None:
if (x1cc_enabledSecondaryEffect == ESecondaryFxType::None)
break;
[[fallthrough]];
default:
switch (type) {
case ESecondaryFxType::None:

View File

@ -94,6 +94,7 @@ void CPlasmaBeam::EnableSecondaryFx(ESecondaryFxType type) {
case ESecondaryFxType::Charge:
x228_chargeFx = std::make_unique<CElementGen>(x21c_plasma2nd1);
x228_chargeFx->SetGlobalScale(x4_scale);
break;
default:
break;
}

View File

@ -612,6 +612,7 @@ void CPlayerGun::ProcessInput(const CFinalInput& input, CStateManager& mgr) {
case CPlayer::EPlayerMorphBallState::Unmorphed:
if ((x2f8_stateFlags & 0x10) != 0x10)
HandleWeaponChange(input, mgr);
[[fallthrough]];
case CPlayer::EPlayerMorphBallState::Morphed:
x2f4_fireButtonStates = ControlMapper::GetDigitalInput(ControlMapper::ECommands::FireOrBomb, input) ? 1 : 0;
x2f4_fireButtonStates |=
@ -1038,6 +1039,7 @@ void CPlayerGun::EnableChargeFx(EChargeState state, CStateManager& mgr) {
case CPlayerState::EBeamId::Plasma:
case CPlayerState::EBeamId::Power:
x832_25_chargeEffectVisible = true;
break;
default:
break;
}

View File

@ -46,6 +46,7 @@ void CPowerBeam::UpdateGunFx(bool shotSmoke, float dt, const CStateManager& mgr,
x234_shotSmokeGen->SetParticleEmission(false);
x240_smokeState = ESmokeState::Done;
}
[[fallthrough]];
case ESmokeState::Done:
if (x234_shotSmokeGen) {
zeus::CTransform locator = x10_solidModelData->GetScaledLocatorTransform("LBEAM");

View File

@ -21,7 +21,7 @@ public:
zeus::CVector3f PredictInterceptPos(const zeus::CVector3f& gunPos, const zeus::CVector3f& aimPos,
const CPlayer& player, bool gravity, float dt);
CDamageInfo GetDamage() const { return xc_damageInfo; }
const CDamageInfo& GetDamage() const { return xc_damageInfo; }
TToken<CWeaponDescription>& Token() { return x0_weaponDescription; }
};
} // namespace urde

View File

@ -88,6 +88,7 @@ void CWaveBeam::EnableSecondaryFx(ESecondaryFxType type) {
case ESecondaryFxType::CancelCharge:
if (x1cc_enabledSecondaryEffect == ESecondaryFxType::None)
break;
[[fallthrough]];
default:
if (x1cc_enabledSecondaryEffect != ESecondaryFxType::ToCombo) {
auto& fx = type == ESecondaryFxType::Charge ? x228_wave2nd1 : x234_wave2nd2;
@ -111,6 +112,7 @@ void CWaveBeam::EnableSecondaryFx(ESecondaryFxType type) {
x254_chargeFx->SetGlobalScale(x4_scale);
x24c_effectTimer = 0.f;
x258_25_effectTimerActive = true;
break;
default:
break;
}

View File

@ -296,6 +296,7 @@ void CMorphBall::UpdateMorphBallSounds(float dt) {
CSfxManager::UpdateEmitter(x1e2c_rollSfxHandle, x0_player.GetTranslation(), zeus::CVector3f::skZero, maxVol);
break;
}
[[fallthrough]];
}
default:
if (x1e2c_rollSfxHandle) {

View File

@ -487,6 +487,7 @@ void CPatterned::KnockBack(const zeus::CVector3f& backVec, CStateManager& mgr, c
break;
case EKnockBackAnimationFollowUp::LaggedBurnDeath:
x401_29_laggedBurnDeath = true;
[[fallthrough]];
case EKnockBackAnimationFollowUp::BurnDeath:
Burn(x460_knockBackController.GetActiveParms().x8_followupDuration, -1.f);
Death(mgr, zeus::CVector3f::skZero, EScriptObjectState::DeathRattle);
@ -518,6 +519,7 @@ void CPatterned::KnockBack(const zeus::CVector3f& backVec, CStateManager& mgr, c
MassiveFrozenDeath(mgr);
else if (x450_bodyController->IsFrozen())
x450_bodyController->FrozenBreakout();
break;
default:
break;
}
@ -1639,6 +1641,7 @@ void CPatterned::ThinkAboutMove(float dt) {
case EMoveState::Zero:
if (!x328_26_solidCollision)
break;
[[fallthrough]];
case EMoveState::One:
doMove = false;
if (mag > 0.85f) {
@ -1650,6 +1653,7 @@ void CPatterned::ThinkAboutMove(float dt) {
break;
case EMoveState::Two:
x3f8_moveState = EMoveState::Three;
[[fallthrough]];
case EMoveState::Three:
doMove = true;
if (!x328_26_solidCollision) {

View File

@ -508,6 +508,7 @@ void CPlayer::Update(float dt, CStateManager& mgr) {
case EPlayerMorphBallState::Morphing:
case EPlayerMorphBallState::Unmorphing:
x7f4_gunWorldXf = x34_transform * x64_modelData->GetScaledLocatorTransform("GUN_LCTR");
break;
case EPlayerMorphBallState::Morphed:
break;
}
@ -838,6 +839,7 @@ void CPlayer::TakeDamage(bool significant, const zeus::CVector3f& location, floa
break;
case EWeaponType::Lava:
damageLoopSfx = SFXpds_lava_damage_lp;
[[fallthrough]];
case EWeaponType::Heat:
damageSamusVoiceSfx = SFXsam_vox_damage_heat;
break;
@ -4382,6 +4384,7 @@ void CPlayer::UpdateOrbitOrientation(CStateManager& mgr) {
case EPlayerOrbitState::OrbitPoint:
if (x3dc_inFreeLook)
return;
[[fallthrough]];
case EPlayerOrbitState::OrbitObject:
case EPlayerOrbitState::OrbitCarcass:
case EPlayerOrbitState::ForcedOrbitObject: {
@ -5382,6 +5385,7 @@ void CPlayer::UpdateCinematicState(CStateManager& mgr) {
ForceGunOrientation(x34_transform, mgr);
DrawGun(mgr);
}
break;
default:
break;
}
@ -5405,6 +5409,7 @@ void CPlayer::UpdateCinematicState(CStateManager& mgr) {
ActivateMorphBallCamera(mgr);
mgr.GetCameraManager()->SetupBallCamera(mgr);
mgr.GetCameraManager()->GetBallCamera()->Reset(CreateTransformFromMovementDirection(), mgr);
break;
default:
break;
}

File diff suppressed because it is too large Load Diff

View File

@ -11,59 +11,86 @@
namespace urde {
class CCollisionActorManager;
class CScriptGunTurretData {
friend class CScriptGunTurret;
float x0_;
float x4_;
float x8_;
float xc_;
float x10_;
float x14_;
float x18_ = 30.f;
float x1c_;
float x20_;
float x24_;
float x28_;
float x2c_;
float x30_;
float x34_;
float x38_;
bool x3c_;
float x0_intoDeactivateDelay;
float x4_intoActivateDelay;
float x8_reloadTime;
float xc_reloadTimeVariance;
float x10_panStartTime;
float x14_panHoldTime;
float x18_totalPanSearchTime = 30.f;
float x1c_leftMaxAngle;
float x20_rightMaxAngle;
float x24_downMaxAngle;
float x28_turnSpeed;
float x2c_detectionRange;
float x30_detectionZRange;
float x34_freezeDuration;
float x38_freezeVariance;
bool x3c_freezeTimeout;
CAssetId x40_projectileRes;
CDamageInfo x44_projectileDamage;
CAssetId x60_;
CAssetId x64_;
CAssetId x68_;
CAssetId x6c_;
CAssetId x70_;
CAssetId x74_;
CAssetId x78_;
u16 x7c_;
u16 x7e_;
u16 x80_unfreezeSound;
u16 x82_;
u16 x84_;
u16 x86_;
CAssetId x88_;
float x8c_;
u32 x90_;
u32 x94_;
u32 x98_;
float x9c_;
bool xa0_;
CAssetId x60_idleLightRes;
CAssetId x64_deactivateLightRes;
CAssetId x68_targettingLightRes;
CAssetId x6c_frozenEffectRes;
CAssetId x70_chargingEffectRes;
CAssetId x74_panningEffectRes;
CAssetId x78_visorEffectRes;
u16 x7c_trackingSoundId;
u16 x7e_lockOnSoundId;
u16 x80_unfreezeSoundId;
u16 x82_stopClankSoundId;
u16 x84_chargingSoundId;
u16 x86_visorSoundId;
CAssetId x88_extensionModelResId;
float x8c_extensionDropDownDist;
u32 x90_numInitialShots;
u32 x94_initialShotTableIndex;
u32 x98_numSubsequentShots;
float x9c_frenzyDuration;
bool xa0_scriptedStartOnly;
static constexpr s32 skMinProperties = 43;
public:
CScriptGunTurretData(CInputStream&, s32);
CAssetId GetPanningEffectRes() const;
CAssetId GetChargingEffectRes() const;
CAssetId GetFrozenEffectRes() const;
CAssetId GetTargettingLightRes() const;
CAssetId GetDeactivateLightRes() const;
CAssetId GetIdleLightRes() const;
CAssetId GetPanningEffectRes() const { return x74_panningEffectRes; }
CAssetId GetChargingEffectRes() const { return x70_chargingEffectRes; }
CAssetId GetFrozenEffectRes() const { return x6c_frozenEffectRes; }
CAssetId GetTargettingLightRes() const { return x68_targettingLightRes; }
CAssetId GetDeactivateLightRes() const { return x64_deactivateLightRes; }
CAssetId GetIdleLightRes() const { return x60_idleLightRes; }
CAssetId GetVisorEffectRes() const { return x78_visorEffectRes; }
const CDamageInfo& GetProjectileDamage() const { return x44_projectileDamage; }
CAssetId GetProjectileRes() const { return x40_projectileRes; }
u16 GetUnFreezeSoundId() const;
float GetIntoDeactivateDelay() const;
u16 GetUnFreezeSoundId() const { return x80_unfreezeSoundId; }
float GetIntoDeactivateDelay() const { return x0_intoDeactivateDelay; }
CAssetId GetExtensionModelResId() const { return x88_extensionModelResId; }
float GetFreezeVariance() const { return x38_freezeVariance; }
float GetFreezeDuration() const { return x34_freezeDuration; }
bool GetFreezeTimeout() const { return x3c_freezeTimeout; }
float GetIntoActivateDelay() const { return x4_intoActivateDelay; }
u16 GetLockOnSoundId() const { return x7e_lockOnSoundId; }
float GetPanStartTime() const { return x10_panStartTime; }
float GetPanHoldTime() const { return x14_panHoldTime; }
float GetTotalPanSearchTime() const { return x18_totalPanSearchTime; }
float GetTurnSpeed() const { return x28_turnSpeed; }
float GetReloadTimeVariance() const { return xc_reloadTimeVariance; }
float GetReloadTime() const { return x8_reloadTime; }
u16 GetChargingSoundId() const { return x84_chargingSoundId; }
float GetDownMaxAngle() const { return x24_downMaxAngle; }
float GetExtensionDropDownDist() const { return x8c_extensionDropDownDist; }
float GetLeftMaxAngle() const { return x1c_leftMaxAngle; }
float GetRightMaxAngle() const { return x20_rightMaxAngle; }
float GetDetectionRange() const { return x2c_detectionRange; }
float GetDetectionZRange() const { return x30_detectionZRange; }
u32 GetNumSubsequentShots() const { return x98_numSubsequentShots; }
u32 GetInitialShotTableIndex() const { return x94_initialShotTableIndex; }
u32 GetNumInitialShots() const { return x90_numInitialShots; }
u16 GetTrackingSoundId() const { return x7c_trackingSoundId; }
u16 GetStopClankSoundId() const { return x82_stopClankSoundId; }