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; }
u16 GetVisorSoundId() const { return x86_visorSoundId; }
bool GetScriptedStartOnly() const { return xa0_scriptedStartOnly; }
float GetFrenzyDuration() const { return x9c_frenzyDuration; }
static s32 GetMinProperties() { return skMinProperties; }
};
@ -79,72 +106,114 @@ class CScriptGunTurret : public CPhysicsActor {
public:
enum class ETurretComponent { Base, Gun };
enum class ETurretState {
Invalid = -1,
Destroyed,
Deactive,
DeactiveFromReady,
Deactivating,
DeactivatingFromReady,
Inactive,
Ready,
PanningA,
PanningB,
Targeting,
Firing,
ExitTargeting,
Frenzy
};
private:
ETurretComponent x258_type;
TUniqueId x25c_gunId = kInvalidUniqueId;
float x260_ = 0.f;
float x260_lastGunHP = 0.f;
CHealthInfo x264_healthInfo;
CDamageVulnerability x26c_damageVuln;
CScriptGunTurretData x2d4_data;
TUniqueId x378_ = kInvalidUniqueId;
CProjectileInfo x37c_projectileInfo;
CBurstFire x3a4_burstFire;
zeus::CVector3f x404_;
TToken<CGenDescription> x410_;
TToken<CGenDescription> x41c_;
TToken<CGenDescription> x428_;
TToken<CGenDescription> x434_;
TToken<CGenDescription> x440_;
TToken<CGenDescription> x44c_;
TLockedToken<CGenDescription> x458_;
std::unique_ptr<CElementGen> x468_;
std::unique_ptr<CElementGen> x470_;
std::unique_ptr<CElementGen> x478_;
std::unique_ptr<CElementGen> x480_;
std::unique_ptr<CElementGen> x488_;
std::unique_ptr<CElementGen> x490_;
zeus::CVector3f x404_targetPosition;
TToken<CGenDescription> x410_idleLightDesc;
TToken<CGenDescription> x41c_deactivateLightDesc;
TToken<CGenDescription> x428_targettingLightDesc;
TToken<CGenDescription> x434_frozenEffectDesc;
TToken<CGenDescription> x440_chargingEffectDesc;
TToken<CGenDescription> x44c_panningEffectDesc;
TLockedToken<CGenDescription> x458_visorEffectDesc;
std::unique_ptr<CElementGen> x468_idleLight;
std::unique_ptr<CElementGen> x470_deactivateLight;
std::unique_ptr<CElementGen> x478_targettingLight;
std::unique_ptr<CElementGen> x480_frozenEffect;
std::unique_ptr<CElementGen> x488_chargingEffect;
std::unique_ptr<CElementGen> x490_panningEffect;
TUniqueId x498_lightId = kInvalidUniqueId;
std::unique_ptr<CCollisionActorManager> x49c_collisionManager;
TUniqueId x4a0_ = kInvalidUniqueId;
rstl::optional<CModelData> x4a4_;
float x4f4_ = 0.f;
float x4f8_ = 0.f;
zeus::CVector3f x4fc_;
TUniqueId x4a0_collisionActor = kInvalidUniqueId;
rstl::optional<CModelData> x4a4_extensionModel;
float x4f4_extensionRange = 0.f;
float x4f8_extensionT = 0.f;
zeus::CVector3f x4fc_extensionOffset;
u8 x508_gunSDKSeg = 0xFF;
CSfxHandle x50c_;
float x510_ = 0.f;
zeus::CVector3f x514_;
s32 x520_ = -1;
float x524_ = 0.f;
float x528_ = 0.f;
float x52c_ = 0.f;
float x530_ = 0.f;
float x534_ = 0.f;
float x538_ = 0.f;
float x53c_ = 0.f;
s32 x540_ = -1;
zeus::CVector3f x544_;
zeus::CVector3f x550_;
s32 x55c_ = -1;
CSfxHandle x50c_targetingEmitter;
float x510_timeSinceLastTargetSfx = 0.f;
zeus::CVector3f x514_lastFrontVector;
ETurretState x520_state = ETurretState::Invalid;
float x524_curStateTime = 0.f;
float x528_curInactiveTime = 0.f;
float x52c_curActiveTime = 0.f;
float x530_curPanTime = 0.f;
float x534_fireCycleRemTime = 0.f;
float x538_halfFireCycleDur = 0.f;
float x53c_freezeRemTime = 0.f;
s32 x540_turretAnim = -1;
zeus::CVector3f x544_originalFrontVec;
zeus::CVector3f x550_originalRightVec;
s32 x55c_additiveChargeAnim = -1;
union {
struct {
bool x560_24_ : 1;
bool x560_25_ : 1;
bool x560_26_ : 1;
bool x560_27_ : 1;
bool x560_28_ : 1;
bool x560_29_ : 1;
bool x560_30_ : 1;
bool x560_31_ : 1;
bool x560_24_dead : 1;
bool x560_25_frozen : 1;
bool x560_26_firedWithSetBurst : 1;
bool x560_27_burstSet : 1;
bool x560_28_hasBeenActivated : 1;
bool x560_29_scriptedStart : 1;
bool x560_30_needsStopClankSound : 1;
bool x560_31_frenzyReverse : 1;
};
u32 _dummy = 0;
};
private:
void SetupCollisionManager(CStateManager&);
void SetTurretState(ETurretState, CStateManager&);
void ProcessCurrentState(EStateMsg, CStateManager&, float);
void LaunchProjectile(CStateManager&);
void PlayAdditiveFlinchAnimation(CStateManager&);
void ProcessGunStateMachine(float, CStateManager&);
void UpdateTurretAnimation();
void UpdateGunCollisionManager(float, CStateManager&);
void UpdateFrozenState(float, CStateManager&);
void UpdateGunParticles(float, CStateManager&);
void ProcessDeactivatingState(EStateMsg, CStateManager&);
void ProcessInactiveState(EStateMsg, CStateManager&, float);
void ProcessReadyState(EStateMsg, CStateManager&, float);
void ProcessPanningState(EStateMsg, CStateManager&, float);
void ProcessTargettingState(EStateMsg, CStateManager&, float);
void ProcessExitTargettingState(EStateMsg, CStateManager&);
void ProcessFrenzyState(EStateMsg, CStateManager&, float);
bool IsPlayerInFiringRange(CStateManager&) const;
bool LineOfSightTest(CStateManager&) const;
bool InDetectionRange(CStateManager&) const;
bool PlayerInsideTurretSphere(CStateManager&) const;
void UpdateGunOrientation(float, CStateManager&);
zeus::CVector3f UpdateExtensionModelState(float);
void UpdateHealthInfo(CStateManager&);
void UpdateTargettingSound(float);
void PlayAdditiveChargingAnimation(CStateManager&);
void UpdateTargettingMode(float, CStateManager&);
void UpdateBurstType(CStateManager&);
bool ShouldFire(CStateManager&) const;
bool IsInsignificantRotation(float) const;
public:
CScriptGunTurret(TUniqueId uid, std::string_view name, ETurretComponent comp, const CEntityInfo& info,
@ -156,7 +225,7 @@ public:
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
void Think(float, CStateManager&);
void Touch(CActor&, CStateManager&);
void AddToRenderer(const zeus::CFrustum&, const CStateManager&);
void AddToRenderer(const zeus::CFrustum&, const CStateManager&) const;
void Render(const CStateManager&) const;
rstl::optional<zeus::CAABox> GetTouchBounds() const;
zeus::CVector3f GetOrbitPosition(const CStateManager&) const;
@ -164,31 +233,5 @@ public:
CHealthInfo* HealthInfo(CStateManager&) { return &x264_healthInfo; }
const CDamageVulnerability* GetDamageVulnerability() const { return &x26c_damageVuln; }
void sub80219b18(s32, CStateManager&);
void sub8021998c(s32, CStateManager&, float);
void sub80217408(CStateManager&);
void sub802172b8(CStateManager&);
void sub80219a00(float, CStateManager&);
void sub802189c8();
void UpdateGunCollisionManager(float, CStateManager&);
void GetUnFreezeSoundId(float, CStateManager&);
void UpdateGunParticles(float, CStateManager&);
void sub80219938(s32, CStateManager&);
void sub802196c4(s32, CStateManager&, float);
void sub802195bc(s32, CStateManager&, float);
void sub8021942c(s32, CStateManager&, float);
void sub80218f50(s32, CStateManager&, float);
void sub80218e34(s32, CStateManager&);
void sub80218bb4(s32, CStateManager&, float);
bool sub80217ad8(CStateManager&);
bool sub802179a4(CStateManager&);
void sub80217f5c(float, CStateManager&);
zeus::CVector3f sub80217e34(float);
void sub80216288(float);
void sub80217124(CStateManager&);
void sub80218830(float, CStateManager&);
void sub80216594(CStateManager&);
bool sub80217950(CStateManager&);
bool sub80217c24(float);
};
} // namespace urde

View File

@ -15,27 +15,27 @@
namespace urde {
CScriptPickup::CScriptPickup(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
CModelData&& mData, const CActorParameters& aParams, const zeus::CAABox& aabb,
CPlayerState::EItemType itemType, s32 amount, s32 capacity, CAssetId explosionEffect,
float possibility, float f2, float f3, float f4, bool active)
CPlayerState::EItemType itemType, s32 amount, s32 capacity, CAssetId pickupEffect,
float possibility, float lifeTime, float fadeInTime, float startDelay, bool active)
: CPhysicsActor(uid, active, name, info, xf, std::move(mData), CMaterialList(), aabb, SMoverData(1.f), aParams, 0.3f,
0.1f)
, x258_itemType(itemType)
, x25c_amount(amount)
, x260_capacity(capacity)
, x264_possibility(possibility)
, x268_(f3)
, x26c_(f2)
, x278_(f4)
, x28c_24_(false)
, x28c_25_(false)
, x28c_26_(false) {
if (explosionEffect.IsValid())
x27c_explosionDesc = g_SimplePool->GetObj({SBIG('PART'), explosionEffect});
, x268_fadeInTime(fadeInTime)
, x26c_lifeTime(lifeTime)
, x278_delayTimer(startDelay)
, x28c_24_generated(false)
, x28c_25_inTractor(false)
, x28c_26_enableTractorTest(false) {
if (pickupEffect.IsValid())
x27c_pickupParticleDesc = g_SimplePool->GetObj({SBIG('PART'), pickupEffect});
if (x64_modelData && x64_modelData->AnimationData())
x64_modelData->AnimationData()->SetAnimation(CAnimPlaybackParms(0, -1, 1.f, true), false);
if (x278_ != 0.f) {
if (x278_delayTimer != 0.f) {
xb4_drawFlags = CModelFlags(5, 0, 3, zeus::CColor(1.f, 1.f, 1.f, 0.f));
xb4_drawFlags.x2_flags &= 0xFFFC;
xb4_drawFlags.x2_flags |= 1;
@ -48,93 +48,90 @@ void CScriptPickup::Think(float dt, CStateManager& mgr) {
if (!GetActive())
return;
if (x278_ >= 0.f) {
if (x278_delayTimer >= 0.f) {
CPhysicsActor::Stop();
x278_ -= dt;
x278_delayTimer -= dt;
return;
}
x270_ += dt;
if (x28c_25_ && (x270_ - x26c_) < 2.f)
x270_ = zeus::max(2.f * dt - x270_, (2.f - x26c_) - FLT_EPSILON);
x270_curTime += dt;
if (x28c_25_inTractor && (x26c_lifeTime - x270_curTime) < 2.f)
x270_curTime = zeus::max(x270_curTime - 2.f * dt, x26c_lifeTime - 2.f - FLT_EPSILON);
CModelFlags drawFlags{0, 0, 3, zeus::CColor(1.f, 1.f, 1.f, 1.f)};
if (x268_ != 0.f) {
if (x270_ < x268_) {
drawFlags = CModelFlags(5, 0, 3, zeus::CColor(1.f, 1.f, x270_ / x268_));
if (x268_fadeInTime != 0.f) {
if (x270_curTime < x268_fadeInTime) {
drawFlags = CModelFlags(5, 0, 3, zeus::CColor(1.f, x270_curTime / x268_fadeInTime));
drawFlags.x2_flags &= 0xFFFC;
drawFlags.x2_flags |= 1;
} else
x268_ = 0.f;
} else if (x26c_ != 0.f) {
} else {
x268_fadeInTime = 0.f;
}
} else if (x26c_lifeTime != 0.f) {
float alpha = 1.f;
if (x26c_ < 2.f)
alpha = 1.f - (x26c_ / x270_);
else if ((x270_ - x26c_) < 2.f)
alpha = (x270_ - x26c_) * 0.5f;
if (x26c_lifeTime < 2.f)
alpha = 1.f - (x26c_lifeTime / x270_curTime);
else if ((x26c_lifeTime - x270_curTime) < 2.f)
alpha = (x26c_lifeTime - x270_curTime) * 0.5f;
drawFlags = CModelFlags(5, 0, 3, zeus::CColor(1.f, 1.f, 1.f, alpha));
drawFlags = CModelFlags(5, 0, 3, zeus::CColor(1.f, alpha));
drawFlags.x2_flags &= 0xFFFC;
drawFlags.x2_flags |= 1;
}
xb4_drawFlags = drawFlags;
if (x64_modelData) {
if (x64_modelData->HasAnimData()) {
SAdvancementDeltas deltas = UpdateAnimation(dt, mgr, true);
MoveToOR(deltas.x0_posDelta, dt);
RotateToOR(deltas.xc_rotDelta, dt);
if (x64_modelData && x64_modelData->HasAnimData()) {
SAdvancementDeltas deltas = UpdateAnimation(dt, mgr, true);
MoveToOR(deltas.x0_posDelta, dt);
RotateToOR(deltas.xc_rotDelta, dt);
}
if (x28c_25_inTractor) {
zeus::CVector3f posDelta = mgr.GetPlayer().GetTranslation() + (2.f * zeus::CVector3f::skUp) - GetTranslation();
x274_tractorTime += dt;
posDelta = (20.f * (0.5f * zeus::min(2.f, x274_tractorTime))) * posDelta.normalized();
if (x28c_26_enableTractorTest && (mgr.GetPlayer().GetPlayerGun()->IsCharging() ?
mgr.GetPlayer().GetPlayerGun()->GetChargeBeamFactor() : 0.f) < CPlayerGun::skTractorBeamFactor) {
x28c_26_enableTractorTest = false;
x28c_25_inTractor = false;
posDelta.zeroOut();
}
SetVelocityOR(posDelta);
} else if (x28c_24_generated) {
float chargeFactor =
mgr.GetPlayer().GetPlayerGun()->IsCharging() ? mgr.GetPlayer().GetPlayerGun()->GetChargeBeamFactor() : 0.f;
if (x28c_25_) {
zeus::CVector3f posVec = GetTranslation() - mgr.GetPlayer().GetTranslation() + (2.f * zeus::CVector3f::skUp);
posVec = (20.f * (0.5f * zeus::max(2.f, x274_ + dt))) * posVec.normalized();
float chargeFactor = 0.f;
if (x28c_26_ && mgr.GetPlayer().GetPlayerGun()->IsCharging())
chargeFactor = mgr.GetPlayer().GetPlayerGun()->GetChargeBeamFactor();
if (chargeFactor < CPlayerGun::skTractorBeamFactor) {
x28c_26_ = false;
x28c_25_ = false;
posVec.zeroOut();
}
SetVelocityOR(posVec);
} else if (x28c_24_) {
float chargeFactor =
mgr.GetPlayer().GetPlayerGun()->IsCharging() ? mgr.GetPlayer().GetPlayerGun()->GetChargeBeamFactor() : 0.f;
if (chargeFactor > CPlayerGun::skTractorBeamFactor) {
zeus::CVector3f posVec =
(GetTranslation() - mgr.GetCameraManager()->GetFirstPersonCamera()->GetTranslation()).normalized();
float relFov = zeus::CRelAngle(zeus::degToRad(g_tweakGame->GetFirstPersonFOV())).asRel();
if (mgr.GetCameraManager()->GetFirstPersonCamera()->GetTransform().upVector().dot(posVec) > std::cos(relFov) &&
posVec.magSquared() < (30.f * 30.f)) {
x28c_25_ = true;
x28c_26_ = true;
x274_ = 0.f;
}
if (chargeFactor > CPlayerGun::skTractorBeamFactor) {
zeus::CVector3f posDelta = GetTranslation() - mgr.GetCameraManager()->GetFirstPersonCamera()->GetTranslation();
float relFov = zeus::CRelAngle(zeus::degToRad(g_tweakGame->GetFirstPersonFOV())).asRel();
if (mgr.GetCameraManager()->GetFirstPersonCamera()->GetTransform().
frontVector().dot(posDelta.normalized()) > std::cos(relFov) &&
posDelta.magSquared() < (30.f * 30.f)) {
x28c_25_inTractor = true;
x28c_26_enableTractorTest = true;
x274_tractorTime = 0.f;
}
}
}
if (x26c_ != 0.f && x270_ > x26c_)
if (x26c_lifeTime != 0.f && x270_curTime > x26c_lifeTime)
mgr.FreeScriptObject(GetUniqueId());
}
void CScriptPickup::Touch(CActor& act, CStateManager& mgr) {
if (GetActive() && x278_ < 0.f && TCastToPtr<CPlayer>(act)) {
if (GetActive() && x278_delayTimer < 0.f && TCastToPtr<CPlayer>(act)) {
if (x258_itemType >= CPlayerState::EItemType::Truth && x258_itemType <= CPlayerState::EItemType::Newborn) {
CAssetId id = MP1::CArtifactDoll::GetArtifactHeadScanFromItemType(x258_itemType);
if (id.IsValid())
mgr.GetPlayerState()->SetScanTime(id, 0.5f);
}
if (x27c_explosionDesc) {
if (x27c_pickupParticleDesc) {
if (mgr.GetPlayerState()->GetActiveVisor(mgr) != CPlayerState::EPlayerVisor::Thermal) {
mgr.AddObject(new CExplosion(x27c_explosionDesc, mgr.AllocateUniqueId(), true,
mgr.AddObject(new CExplosion(x27c_pickupParticleDesc, mgr.AllocateUniqueId(), true,
CEntityInfo(GetAreaIdAlways(), CEntity::NullConnectionList, kInvalidEditorId),
"Explosion - Pickup Effect", x34_transform, 0, zeus::CVector3f::skOne,
zeus::CColor::skWhite));

View File

@ -6,30 +6,32 @@
namespace urde {
class CScriptPickup : public CPhysicsActor {
CPlayerState::EItemType x258_itemType;
u32 x25c_amount;
u32 x260_capacity;
s32 x25c_amount;
s32 x260_capacity;
float x264_possibility;
float x268_;
float x26c_;
float x270_ = 0.f;
float x274_;
float x278_;
TLockedToken<CGenDescription> x27c_explosionDesc;
float x268_fadeInTime;
float x26c_lifeTime;
float x270_curTime = 0.f;
float x274_tractorTime;
float x278_delayTimer;
TLockedToken<CGenDescription> x27c_pickupParticleDesc;
u8 x28c_24_ : 1;
u8 x28c_25_ : 1;
u8 x28c_26_ : 1;
bool x28c_24_generated : 1;
bool x28c_25_inTractor : 1;
bool x28c_26_enableTractorTest : 1;
public:
CScriptPickup(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
const CActorParameters&, const zeus::CAABox&, CPlayerState::EItemType, s32, s32, CAssetId, float, float,
float, float, bool);
CScriptPickup(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
CModelData&& mData, const CActorParameters& aParams, const zeus::CAABox& aabb,
CPlayerState::EItemType itemType, s32 amount, s32 capacity, CAssetId pickupEffect,
float possibility, float lifeTime, float fadeInTime, float startDelay, bool active);
void Accept(IVisitor& visitor);
void Think(float, CStateManager&);
void Touch(CActor&, CStateManager&);
rstl::optional<zeus::CAABox> GetTouchBounds() const { return CPhysicsActor::GetBoundingBox(); }
float GetPossibility() const { return x264_possibility; }
CPlayerState::EItemType GetItem() { return x258_itemType; }
CPlayerState::EItemType GetItem() const { return x258_itemType; }
void SetGenerated() { x28c_24_generated = true; }
};
} // namespace urde

View File

@ -1,29 +1,159 @@
#include "CScriptPickupGenerator.hpp"
#include "TCastTo.hpp"
#include "CStateManager.hpp"
#include "CScriptPickup.hpp"
#include "CWallCrawlerSwarm.hpp"
namespace urde {
CScriptPickupGenerator::CScriptPickupGenerator(TUniqueId uid, std::string_view name, const CEntityInfo& info,
const zeus::CVector3f& pos, float frequency, bool active)
: CEntity(uid, info, active, name), x34_position(pos), x40_frequency(frequency) {}
: CEntity(uid, info, active, name), x34_position(pos), x40_frequency(frequency) {
ResetDelayTimer();
}
void CScriptPickupGenerator::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptPickupGenerator::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr) {
if (msg == EScriptObjectMessage::SetToZero && x30_24_active && x44_ != 100.f) {
x44_ -= 1.f;
if (x44_ < 0.000009f)
sub8015E220();
else {
void CScriptPickupGenerator::ResetDelayTimer() {
if (x40_frequency > 0.f)
x44_delayTimer += 100.f / x40_frequency;
else
x44_delayTimer = FLT_MAX;
}
void CScriptPickupGenerator::GetGeneratorIds(CStateManager& mgr, TUniqueId sender,
std::vector<TUniqueId>& idsOut) const {
idsOut.reserve(std::max(size_t(1), GetConnectionList().size()));
for (const auto& conn : GetConnectionList()) {
if (conn.x0_state == EScriptObjectState::Zero && conn.x4_msg == EScriptObjectMessage::Follow) {
TUniqueId id = mgr.GetIdForScript(conn.x8_objId);
if (id != kInvalidUniqueId) {
if (const CEntity* ent = mgr.GetObjectById(id)) {
if (ent->GetActive())
idsOut.push_back(id);
}
}
}
}
if (idsOut.empty())
idsOut.push_back(sender);
}
float CScriptPickupGenerator::GetPickupTemplates(CStateManager& mgr,
std::vector<std::pair<float, TEditorId>>& idsOut) const {
float totalPossibility = 0.f;
CPlayerState& pState = *mgr.GetPlayerState();
idsOut.reserve(GetConnectionList().size());
for (const auto& conn : GetConnectionList()) {
if (conn.x0_state == EScriptObjectState::Zero && conn.x4_msg == EScriptObjectMessage::Activate) {
TUniqueId id = mgr.GetIdForScript(conn.x8_objId);
if (id != kInvalidUniqueId) {
if (TCastToConstPtr<CScriptPickup> pickup = mgr.GetObjectById(id)) {
CPlayerState::EItemType item = pickup->GetItem();
float possibility = pickup->GetPossibility();
float multiplier = 1.f;
bool doAlways = false;
bool doThirtyPerc = false;
switch (item) {
case CPlayerState::EItemType::Missiles:
if (pState.HasPowerUp(CPlayerState::EItemType::Missiles)) {
if (pState.GetItemAmount(CPlayerState::EItemType::Missiles) <
pState.GetItemCapacity(CPlayerState::EItemType::Missiles))
doAlways = true;
else
doThirtyPerc = true;
}
break;
case CPlayerState::EItemType::PowerBombs:
if (pState.HasPowerUp(CPlayerState::EItemType::PowerBombs)) {
if (pState.GetItemAmount(CPlayerState::EItemType::PowerBombs) <
pState.GetItemCapacity(CPlayerState::EItemType::PowerBombs)) {
doAlways = true;
if (pState.GetItemAmount(CPlayerState::EItemType::PowerBombs) < 2 &&
possibility >= 10.f && possibility < 25.f)
multiplier = 2.f;
} else {
doThirtyPerc = true;
}
}
break;
case CPlayerState::EItemType::HealthRefill:
if (pState.GetHealthInfo().GetHP() < pState.CalculateHealth())
doAlways = true;
else
doThirtyPerc = true;
break;
default:
doAlways = true;
break;
}
bool thirtyPercTest = mgr.GetActiveRandom()->Float() < 0.3f;
if ((doAlways || (doThirtyPerc && thirtyPercTest)) && possibility > 0.f) {
totalPossibility += possibility * multiplier;
idsOut.push_back(std::make_pair(possibility, conn.x8_objId));
}
}
}
}
}
return totalPossibility;
}
void CScriptPickupGenerator::GeneratePickup(CStateManager& mgr, TEditorId templateId, TUniqueId generatorId) const {
CEntity* pickupTempl = mgr.ObjectById(mgr.GetIdForScript(templateId));
CEntity* generator = mgr.ObjectById(generatorId);
if (pickupTempl && generator) {
bool oldGeneratingObject = mgr.GetIsGeneratingObject();
mgr.SetIsGeneratingObject(true);
auto p = mgr.GenerateObject(templateId);
mgr.SetIsGeneratingObject(oldGeneratingObject);
if (p.second != kInvalidUniqueId) {
CEntity* newObj = mgr.ObjectById(p.second);
CActor* newAct = TCastToPtr<CActor>(newObj).GetPtr();
CScriptPickup* newPickup = TCastToPtr<CScriptPickup>(newObj).GetPtr();
CActor* generatorAct = TCastToPtr<CActor>(generator).GetPtr();
CWallCrawlerSwarm* swarmAct = TCastToPtr<CWallCrawlerSwarm>(generator).GetPtr();
if (newAct && swarmAct)
newAct->SetTranslation(swarmAct->GetLastKilledOffset() + x34_position);
else if (newAct && generatorAct)
newAct->SetTranslation(generatorAct->GetTranslation() + x34_position);
if (newPickup)
newPickup->SetGenerated();
mgr.SendScriptMsg(newObj, GetUniqueId(), EScriptObjectMessage::Activate);
}
}
}
void CScriptPickupGenerator::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& stateMgr) {
if (msg == EScriptObjectMessage::SetToZero && x30_24_active && x40_frequency != 100.f) {
x44_delayTimer -= 1.f;
if (x44_delayTimer < 0.000009f) {
ResetDelayTimer();
} else {
std::vector<TUniqueId> generatorIds;
GetGeneratorIds(stateMgr, sender, generatorIds);
std::vector<std::pair<float, TEditorId>> pickupTemplates;
float totalProb = GetPickupTemplates(stateMgr, pickupTemplates);
if (!pickupTemplates.empty()) {
float r = stateMgr.GetActiveRandom()->Range(0.f, totalProb);
float f2 = 0.f;
size_t count = 0;
for (const auto id : pickupTemplates) {
if (r >= f2 && r <= f2 + id.first)
break;
f2 += id.first;
++count;
}
if (count != pickupTemplates.size()) {
TEditorId templateId = pickupTemplates[count].second;
GeneratePickup(stateMgr, templateId,
generatorIds[stateMgr.GetActiveRandom()->Float() * generatorIds.size() * 0.99f]);
}
}
}
}
CEntity::AcceptScriptMsg(msg, objId, stateMgr);
CEntity::AcceptScriptMsg(msg, sender, stateMgr);
}
void CScriptPickupGenerator::sub8015E220() {
if (x40_frequency > 0.f)
x44_ = (100.f / x40_frequency) + 100.f;
else
x44_ = std::numeric_limits<float>::max();
}
} // namespace urde

View File

@ -7,13 +7,16 @@ namespace urde {
class CScriptPickupGenerator : public CEntity {
zeus::CVector3f x34_position;
float x40_frequency;
float x44_ = 0.f;
void sub8015E220();
float x44_delayTimer = 0.f;
void ResetDelayTimer();
void GetGeneratorIds(CStateManager& mgr, TUniqueId sender, std::vector<TUniqueId>& idsOut) const;
float GetPickupTemplates(CStateManager& mgr, std::vector<std::pair<float, TEditorId>>& idsOut) const;
void GeneratePickup(CStateManager& mgr, TEditorId templateId, TUniqueId generatorId) const;
public:
CScriptPickupGenerator(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CVector3f&, float, bool);
void Accept(IVisitor& visitor);
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr);
void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId sender, CStateManager& stateMgr);
};
} // namespace urde

View File

@ -314,6 +314,7 @@ void CScriptPlayerActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid
}
if (!(x350_flags & 0x4))
break;
[[fallthrough]];
case EScriptObjectMessage::Reset:
if (GetActive() || msg == EScriptObjectMessage::Reset) {
x30c_setBeamId = CPlayerState::EBeamId::Invalid;

View File

@ -431,6 +431,7 @@ void CScriptSpecialFunction::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
case ESpecialFunction::Ending: {
if (msg == EScriptObjectMessage::Action && GetSpecialEnding(mgr) == u32(xfc_))
SendScriptMsgs(EScriptObjectState::Zero, mgr, EScriptObjectMessage::None);
break;
}
default:
break;

View File

@ -94,6 +94,7 @@ void CScriptVisorGoo::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId,
xe8_particleDesc.Lock();
if (x100_electricId.IsValid())
xf0_electricDesc.Lock();
break;
default:
break;
}

View File

@ -57,7 +57,7 @@ public:
u32, const CActorParameters&);
void Accept(IVisitor& visitor);
zeus::CVector3f GetLastKilledOffset() const { return x130_lastKilledOffset; }
const zeus::CVector3f& GetLastKilledOffset() const { return x130_lastKilledOffset; }
void ApplyRadiusDamage(const zeus::CVector3f& pos, const CDamageInfo& info, CStateManager& stateMgr) {}
const std::vector<CBoid>& GetBoids() const { return x108_boids; }
int GetCurrentLockOnId() const { return x42c_lockOnId; }

View File

@ -147,6 +147,7 @@ bool CDummyWorld::ICheckWorldComplete() {
x8_phase = Phase::Done;
return false;
}
[[fallthrough]];
}
case Phase::LoadingMap: {
if (!x2c_mapWorld.IsLoaded() || !x2c_mapWorld.GetObj())
@ -154,12 +155,14 @@ bool CDummyWorld::ICheckWorldComplete() {
x2c_mapWorld->SetWhichMapAreasLoaded(*this, 0, 9999);
x8_phase = Phase::LoadingMapAreas;
[[fallthrough]];
}
case Phase::LoadingMapAreas: {
if (x2c_mapWorld->IsMapAreasStreaming())
return false;
x8_phase = Phase::Done;
[[fallthrough]];
}
case Phase::Done:
return true;
@ -336,6 +339,7 @@ bool CWorld::CheckWorldComplete(CStateManager* mgr, TAreaId id, CAssetId mreaId)
CWorldLayers::ReadWorldLayers(r, version, x8_mlvlId);
x4_phase = Phase::LoadingMap;
[[fallthrough]];
}
case Phase::LoadingMap: {
if (!x28_mapWorld.IsLoaded() || !x28_mapWorld.GetObj())
@ -347,12 +351,14 @@ bool CWorld::CheckWorldComplete(CStateManager* mgr, TAreaId id, CAssetId mreaId)
x28_mapWorld->SetWhichMapAreasLoaded(*this, x68_curAreaId, 3);
x4_phase = Phase::LoadingMapAreas;
[[fallthrough]];
}
case Phase::LoadingMapAreas: {
if (x28_mapWorld->IsMapAreasStreaming())
return false;
x4_phase = Phase::LoadingSkyBox;
[[fallthrough]];
}
case Phase::LoadingSkyBox: {
x70_26_skyboxActive = true;
@ -375,6 +381,7 @@ bool CWorld::CheckWorldComplete(CStateManager* mgr, TAreaId id, CAssetId mreaId)
group.x1c_groupData.Lock();
x4_phase = Phase::LoadingSoundGroups;
[[fallthrough]];
}
case Phase::LoadingSoundGroups: {
bool allLoaded = true;
@ -392,6 +399,7 @@ bool CWorld::CheckWorldComplete(CStateManager* mgr, TAreaId id, CAssetId mreaId)
LoadSoundGroups();
x4_phase = Phase::Done;
[[fallthrough]];
}
case Phase::Done:
return true;

View File

@ -900,18 +900,18 @@ CEntity* ScriptLoader::LoadPickup(CStateManager& mgr, CInputStream& in, int prop
SScaledActorHead head = LoadScaledActorHead(in, mgr);
zeus::CVector3f extent = zeus::CVector3f::ReadBig(in);
zeus::CVector3f offset = zeus::CVector3f::ReadBig(in);
CPlayerState::EItemType w1 = CPlayerState::EItemType(in.readUint32Big());
u32 w2 = in.readUint32Big();
u32 w3 = in.readUint32Big();
float f1 = in.readFloatBig();
float f2 = in.readFloatBig();
float f3 = in.readFloatBig();
CPlayerState::EItemType itemType = CPlayerState::EItemType(in.readUint32Big());
u32 capacity = in.readUint32Big();
u32 amount = in.readUint32Big();
float possibility = in.readFloatBig();
float lifeTime = in.readFloatBig();
float fadeInTime = in.readFloatBig();
CAssetId staticModel = in.readUint32Big();
CAnimationParameters animParms = LoadAnimationParameters(in);
CActorParameters actorParms = LoadActorParameters(in);
bool active = in.readBool();
float f4 = in.readFloatBig();
CAssetId w4(in);
float startDelay = in.readFloatBig();
CAssetId pickupEffect(in);
FourCC acsType = g_ResFactory->GetResourceTypeById(animParms.GetACSFile());
if (g_ResFactory->GetResourceTypeById(staticModel) == 0 && acsType == 0)
@ -931,7 +931,8 @@ CEntity* ScriptLoader::LoadPickup(CStateManager& mgr, CInputStream& in, int prop
aabb = data.GetBounds(head.x10_transform.getRotation());
return new CScriptPickup(mgr.AllocateUniqueId(), head.x0_name, info, head.x10_transform, std::move(data), actorParms,
aabb, w1, w3, w2, w4, f1, f2, f3, f4, active);
aabb, itemType, amount, capacity, pickupEffect, possibility, lifeTime, fadeInTime,
startDelay, active);
}
CEntity* ScriptLoader::LoadMemoryRelay(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {

2
amuse

@ -1 +1 @@
Subproject commit 54ef2dd73bd606f00a27192f23e66fbc6d896207
Subproject commit 9f2bb1b371f2bd652d6d130f789da0a263e5678a

View File

@ -8,16 +8,19 @@ set_target_properties(tinyxml2_static PROPERTIES
VERSION "${TINYXML_LIB_VERSION}"
SOVERSION "${TINYXML_LIB_SOVERSION}")
set_target_properties( tinyxml2_static PROPERTIES OUTPUT_NAME tinyxml2 )
if (NOT MSVC)
set_target_properties( tinyxml2_static PROPERTIES COMPILE_FLAGS -Wno-implicit-fallthrough )
endif()
add_executable(assetnameparser "main.cpp")
include_directories(${LOGVISOR_INCLUDE_DIR})
set(AN_PARSER_LIBS "")
if (UNIX)
list(APPEND AN_PARSER_LIBS pthread)
if(UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
list(APPEND AN_PARSER_LIBS dl)
endif()
list(APPEND AN_PARSER_LIBS pthread)
if(UNIX AND ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
list(APPEND AN_PARSER_LIBS dl)
endif()
endif()

View File

@ -159,11 +159,13 @@ 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 */
x40_siChan = m_endpoint->getChan();
x34_phase = EPhase::StartJoyBusBoot;
[[fallthrough]];
case EPhase::StartJoyBusBoot:
x34_phase = EPhase::PollJoyBusBoot;

2
hecl

@ -1 +1 @@
Subproject commit 829f3dba27b1acf59a274c6dbcb156b72c9ff483
Subproject commit 7477fb1ef79d314523e1c306f87540322052a8d3

2
nod

@ -1 +1 @@
Subproject commit be8409681fd5e921be72a04f460e87f2de5f6280
Subproject commit 95ed2ae7dc8619054bff5a6d0d63d51f07334943

@ -1 +1 @@
Subproject commit b28b91a91f4a30400707efc50f27e79114b72abc
Subproject commit 0d8470c4bfceb14374092a1426df26ceb7e16c71