diff --git a/Editor/ViewManager.cpp b/Editor/ViewManager.cpp index eabb8af4d..6ed2c5297 100644 --- a/Editor/ViewManager.cpp +++ b/Editor/ViewManager.cpp @@ -172,6 +172,8 @@ void ViewManager::ParticleView::draw(boo::IGraphicsCommandQueue *gfxQ) m_vm.m_moviePlayer->Update(1.f / 60.f); m_vm.m_moviePlayer->DrawFrame(); } + + g_GameState->GetWorldTransitionManager()->Update(1.f / 60.f); g_GameState->GetWorldTransitionManager()->Draw(); } diff --git a/Runtime/CArchitectureMessage.hpp b/Runtime/CArchitectureMessage.hpp index d23ac9cf7..12e2d5830 100644 --- a/Runtime/CArchitectureMessage.hpp +++ b/Runtime/CArchitectureMessage.hpp @@ -155,6 +155,10 @@ public: { return *msg.GetParm(); } + static CArchitectureMessage CreateFrameBegin(EArchMsgTarget target, int a) + { + return CArchitectureMessage(target, EArchMsgType::FrameBegin, new CArchMsgParmInt32(a)); + } /* URDE Messages */ static CArchitectureMessage CreateApplicationExit(EArchMsgTarget target) { diff --git a/Runtime/CToken.hpp b/Runtime/CToken.hpp index 0be1c4ff9..2c8ba7e7a 100644 --- a/Runtime/CToken.hpp +++ b/Runtime/CToken.hpp @@ -36,7 +36,8 @@ class CObjectReference Unload(); if (IsLoading()) CancelLoad(); - xC_objectStore->ObjectUnreferenced(x4_objTag); + if (xC_objectStore) + xC_objectStore->ObjectUnreferenced(x4_objTag); } return x0_refCount; } diff --git a/Runtime/Character/CAnimData.cpp b/Runtime/Character/CAnimData.cpp index 6a79dd49c..fcf655cab 100644 --- a/Runtime/Character/CAnimData.cpp +++ b/Runtime/Character/CAnimData.cpp @@ -289,7 +289,7 @@ void CAnimData::SetAnimation(const CAnimPlaybackParms& parms, bool) { } -SAdvancementDeltas CAnimData::DoAdvance(float dt, bool& b1, CRandom16& random, bool b2) +SAdvancementDeltas CAnimData::DoAdvance(float dt, bool& b1, CRandom16& random, bool advTree) { b1 = false; @@ -317,7 +317,7 @@ SAdvancementDeltas CAnimData::DoAdvance(float dt, bool& b1, CRandom16& random, b b1 = true; } - if (b2) + if (advTree && x1f8_animRoot) { SetRandomPlaybackRate(random); CCharAnimTime time(scaleDt); @@ -362,10 +362,10 @@ SAdvancementDeltas CAnimData::DoAdvance(float dt, bool& b1, CRandom16& random, b } SAdvancementDeltas CAnimData::Advance(float dt, const zeus::CVector3f& scale, - CStateManager& stateMgr, TAreaId aid, bool b1) + CStateManager& stateMgr, TAreaId aid, bool advTree) { bool b2; - return DoAdvance(dt, b2, *stateMgr.GetActiveRandom(), b1); + return DoAdvance(dt, b2, *stateMgr.GetActiveRandom(), advTree); if (b2) x120_particleDB.SuspendAllActiveEffects(stateMgr); @@ -379,10 +379,10 @@ SAdvancementDeltas CAnimData::Advance(float dt, const zeus::CVector3f& scale, } } -SAdvancementDeltas CAnimData::AdvanceIgnoreParticles(float dt, CRandom16& random, bool b1) +SAdvancementDeltas CAnimData::AdvanceIgnoreParticles(float dt, CRandom16& random, bool advTree) { bool b2; - return DoAdvance(dt, b2, random, b1); + return DoAdvance(dt, b2, random, advTree); } void CAnimData::AdvanceAnim(CCharAnimTime& time, zeus::CVector3f& offset, zeus::CQuaternion& quat) diff --git a/Runtime/Character/CAnimData.hpp b/Runtime/Character/CAnimData.hpp index d0553073e..22b6d69cf 100644 --- a/Runtime/Character/CAnimData.hpp +++ b/Runtime/Character/CAnimData.hpp @@ -203,9 +203,9 @@ public: void PrimitiveSetToTokenVector(const std::set& primSet, std::vector& tokensOut); void GetAnimationPrimitives(const CAnimPlaybackParms& parms, std::set& primsOut) const; void SetAnimation(const CAnimPlaybackParms& parms, bool); - SAdvancementDeltas DoAdvance(float, bool&, CRandom16&, bool); - SAdvancementDeltas Advance(float, const zeus::CVector3f&, CStateManager& stateMgr, TAreaId aid, bool); - SAdvancementDeltas AdvanceIgnoreParticles(float, CRandom16&, bool); + SAdvancementDeltas DoAdvance(float, bool&, CRandom16&, bool advTree); + SAdvancementDeltas Advance(float, const zeus::CVector3f&, CStateManager& stateMgr, TAreaId aid, bool advTree); + SAdvancementDeltas AdvanceIgnoreParticles(float, CRandom16&, bool advTree); void AdvanceAnim(CCharAnimTime& time, zeus::CVector3f&, zeus::CQuaternion&); void SetXRayModel(const TLockedToken& model, const TLockedToken& skinRules); void SetInfraModel(const TLockedToken& model, const TLockedToken& skinRules); diff --git a/Runtime/Character/CModelData.cpp b/Runtime/Character/CModelData.cpp index 850904fd8..dde8515a2 100644 --- a/Runtime/Character/CModelData.cpp +++ b/Runtime/Character/CModelData.cpp @@ -235,18 +235,18 @@ zeus::CTransform CModelData::GetLocatorTransform(const std::string& name) const return {}; } -SAdvancementDeltas CModelData::AdvanceAnimationIgnoreParticles(float dt, CRandom16& rand, bool flag) +SAdvancementDeltas CModelData::AdvanceAnimationIgnoreParticles(float dt, CRandom16& rand, bool advTree) { if (x10_animData) - return x10_animData->AdvanceIgnoreParticles(dt, rand, flag); + return x10_animData->AdvanceIgnoreParticles(dt, rand, advTree); else return {}; } -SAdvancementDeltas CModelData::AdvanceAnimation(float dt, CStateManager& stateMgr, TAreaId aid, bool flag) +SAdvancementDeltas CModelData::AdvanceAnimation(float dt, CStateManager& stateMgr, TAreaId aid, bool advTree) { if (x10_animData) - return x10_animData->Advance(dt, x0_particleScale, stateMgr, aid, flag); + return x10_animData->Advance(dt, x0_particleScale, stateMgr, aid, advTree); else return {}; } diff --git a/Runtime/Character/CModelData.hpp b/Runtime/Character/CModelData.hpp index 685a7e16f..cd42fce91 100644 --- a/Runtime/Character/CModelData.hpp +++ b/Runtime/Character/CModelData.hpp @@ -119,8 +119,8 @@ public: zeus::CTransform GetScaledLocatorTransform(const std::string& name) const; zeus::CTransform GetLocatorTransformDynamic(const std::string& name, const CCharAnimTime* time) const; zeus::CTransform GetLocatorTransform(const std::string& name) const; - SAdvancementDeltas AdvanceAnimationIgnoreParticles(float dt, CRandom16&, bool); - SAdvancementDeltas AdvanceAnimation(float dt, CStateManager& stateMgr, TAreaId aid, bool); + SAdvancementDeltas AdvanceAnimationIgnoreParticles(float dt, CRandom16&, bool advTree); + SAdvancementDeltas AdvanceAnimation(float dt, CStateManager& stateMgr, TAreaId aid, bool advTree); bool IsAnimating() const; bool IsInFrustum(const zeus::CTransform& xf, const CFrustumPlanes& frustum) const; void RenderParticles(const CFrustumPlanes& frustum) const; diff --git a/Runtime/Graphics/CModelBoo.cpp b/Runtime/Graphics/CModelBoo.cpp index a7f7f5da4..d68ab92fa 100644 --- a/Runtime/Graphics/CModelBoo.cpp +++ b/Runtime/Graphics/CModelBoo.cpp @@ -13,7 +13,7 @@ namespace urde { -static logvisor::Module Log("urde::CModelBoo"); +static logvisor::Module Log("urde::CBooModel"); bool CBooModel::g_DrawingOccluders = false; CBooModel::CBooModel(std::vector* surfaces, SShader& shader, diff --git a/Runtime/MP1/MP1.hpp b/Runtime/MP1/MP1.hpp index 2b8872779..32b617fc3 100644 --- a/Runtime/MP1/MP1.hpp +++ b/Runtime/MP1/MP1.hpp @@ -162,6 +162,13 @@ public: bool finished = false; m_inputGenerator.Update(1.0 / 60.0, m_archQueue); + g_GameState->GetWorldTransitionManager()->TouchModels(); + int unk = 0; + m_archQueue.Push(std::move(MakeMsg::CreateFrameBegin(EArchMsgTarget::Game, unk))); + + m_ioWinManager.PumpMessages(m_archQueue); + + /* while (m_archQueue) { CArchitectureMessage msg = m_archQueue.Pop(); @@ -178,6 +185,7 @@ public: m_archQueue.Push(std::move(MakeMsg::CreateApplicationExit(EArchMsgTarget::ArchitectureSupport))); } } + */ return finished; } diff --git a/Runtime/World/CWorldTransManager.cpp b/Runtime/World/CWorldTransManager.cpp index 6ba7c8125..253168ab1 100644 --- a/Runtime/World/CWorldTransManager.cpp +++ b/Runtime/World/CWorldTransManager.cpp @@ -323,15 +323,15 @@ void CWorldTransManager::EnableTransition(const CAnimRes& samusRes, x8_textData.reset(); x20_random.SetSeed(99); - x4_modelData->x1c_samusModelData = CModelData(samusRes); + //x4_modelData->x1c_samusModelData = CModelData(samusRes); - CAnimPlaybackParms aData(samusRes.GetDefaultAnim(), -1, 1.f, true); - x4_modelData->x1c_samusModelData.AnimationData()->SetAnimation(aData, false); + //CAnimPlaybackParms aData(samusRes.GetDefaultAnim(), -1, 1.f, true); + //x4_modelData->x1c_samusModelData.AnimationData()->SetAnimation(aData, false); const std::string& modelName = g_tweakPlayerRes->GetBeamCineModel( DataSpec::ITweakPlayerRes::EBeamId(g_GameState->GetPlayerState()->GetCurrentBeam())); - x4_modelData->x14c_beamModel = g_SimplePool->GetObj(modelName.c_str()); + x4_modelData->x14c_beamModel = g_SimplePool->GetObj(("MP1/TestAnim/" + modelName + ".blend").c_str()); TToken fac = g_CharFactoryBuilder->GetFactory(samusRes); const CCharacterInfo& info = fac.GetObj()->GetCharInfo(GetSuitCharIdx());