Various CWorldTransManager bug fixes

This commit is contained in:
Jack Andersen 2016-09-02 07:50:03 -10:00
parent dc0bb55390
commit 302d897e10
10 changed files with 36 additions and 21 deletions

View File

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

View File

@ -155,6 +155,10 @@ public:
{
return *msg.GetParm<CArchMsgParmVoidPtr>();
}
static CArchitectureMessage CreateFrameBegin(EArchMsgTarget target, int a)
{
return CArchitectureMessage(target, EArchMsgType::FrameBegin, new CArchMsgParmInt32(a));
}
/* URDE Messages */
static CArchitectureMessage CreateApplicationExit(EArchMsgTarget target)
{

View File

@ -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;
}

View File

@ -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)

View File

@ -203,9 +203,9 @@ public:
void PrimitiveSetToTokenVector(const std::set<CPrimitive>& primSet, std::vector<CToken>& tokensOut);
void GetAnimationPrimitives(const CAnimPlaybackParms& parms, std::set<CPrimitive>& 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<CModel>& model, const TLockedToken<CSkinRules>& skinRules);
void SetInfraModel(const TLockedToken<CModel>& model, const TLockedToken<CSkinRules>& skinRules);

View File

@ -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 {};
}

View File

@ -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;

View File

@ -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<CBooSurface>* surfaces, SShader& shader,

View File

@ -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;
}

View File

@ -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<CCharacterFactory> fac = g_CharFactoryBuilder->GetFactory(samusRes);
const CCharacterInfo& info = fac.GetObj()->GetCharInfo(GetSuitCharIdx());