More bug fixes

This commit is contained in:
Jack Andersen 2018-05-18 19:16:08 -10:00
parent 979a54a8a8
commit 5f03362149
9 changed files with 26 additions and 21 deletions

View File

@ -5,9 +5,9 @@ namespace DataSpec::DNAAudio
bool ATBL::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
{
size_t idxCount = rs.length() / 2;
uint32_t idxCount = rs.readUint32Big();
athena::io::YAMLDocWriter w("ATBL");
for (size_t i=0 ; i<idxCount ; ++i)
for (uint32_t i=0 ; i<idxCount ; ++i)
{
uint16_t idx = rs.readUint16Big();
if (idx == 0xffff)
@ -52,6 +52,7 @@ bool ATBL::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
athena::io::FileWriter w(outPath.getAbsolutePath());
if (w.hasError())
return false;
w.writeUint32Big(uint32_t(vecOut.size()));
w.writeBytes(vecOut.data(), vecOut.size() * 2);
return true;

View File

@ -758,7 +758,7 @@ void CStateManager::DrawWorld() const
{
if (TCastToPtr<CActor> actor = ent)
{
if (!actor->xe7_29_drawEnabled)
if (!actor->IsDrawEnabled())
continue;
TUniqueId actorId = actor->GetUniqueId();
if (!thermal && area.LookupPVSUniqueID(actorId) == actorId)
@ -978,7 +978,7 @@ void CStateManager::PreRender()
{
if (TCastToPtr<CActor> act = ent)
{
if (act->IsActorActive())
if (act->IsDrawEnabled())
{
act->CalculateRenderBounds();
act->PreRender(*this, frustum);

View File

@ -632,6 +632,8 @@ void CBooModel::DrawSurface(const CBooSurface& surf, const CModelFlags& flags) c
if (data.flags.shadowOccluderMesh() && !g_DrawingOccluders)
return;
bool noZWrite = flags.m_noZWrite || !data.flags.depthWrite();
const std::vector<boo::ObjToken<boo::IShaderDataBinding>>& extendeds = inst.m_shaderDataBindings[surf.selfIdx];
EExtendedShader extended = EExtendedShader::Flat;
if (flags.m_extendedShader == EExtendedShader::Lighting)
@ -640,28 +642,28 @@ void CBooModel::DrawSurface(const CBooSurface& surf, const CModelFlags& flags) c
{
/* Override shader if originally opaque (typical for FRME models) */
if (flags.x0_blendMode > 6)
extended = flags.m_noCull ? (flags.m_noZWrite ?
extended = flags.m_noCull ? (noZWrite ?
EExtendedShader::ForcedAdditiveNoCullNoZWrite :
EExtendedShader::ForcedAdditiveNoCull) :
(flags.m_noZWrite ?
(noZWrite ?
EExtendedShader::ForcedAdditiveNoZWrite :
EExtendedShader::ForcedAdditive);
else if (flags.x0_blendMode > 4)
extended = flags.m_noCull ? (flags.m_noZWrite ?
extended = flags.m_noCull ? (noZWrite ?
EExtendedShader::ForcedAlphaNoCullNoZWrite :
EExtendedShader::ForcedAlphaNoCull) :
(flags.m_noZWrite ?
(noZWrite ?
EExtendedShader::ForcedAlphaNoZWrite :
EExtendedShader::ForcedAlpha);
else
extended = flags.m_noCull ? (flags.m_noZWrite ?
extended = flags.m_noCull ? (noZWrite ?
EExtendedShader::ForcedAlphaNoCullNoZWrite :
EExtendedShader::ForcedAlphaNoCull) :
(flags.m_noZWrite ?
(noZWrite ?
EExtendedShader::ForcedAlphaNoZWrite :
EExtendedShader::Lighting);
}
else if (flags.m_noCull && flags.m_noZWrite)
else if (flags.m_noCull && noZWrite)
{
/* Substitute no-cull,no-zwrite pipeline if available */
if (data.heclIr.m_blendDst == boo::BlendFactor::One)
@ -677,7 +679,7 @@ void CBooModel::DrawSurface(const CBooSurface& surf, const CModelFlags& flags) c
else
extended = EExtendedShader::ForcedAlphaNoCull;
}
else if (flags.m_noZWrite)
else if (noZWrite)
{
/* Substitute no-zwrite pipeline if available */
if (data.heclIr.m_blendDst == boo::BlendFactor::One)

View File

@ -1784,6 +1784,7 @@ void CSamusHud::SetMessage(std::u16string_view text, const CHUDMemoParms& info)
{
if (info.IsFadeOutOnly())
{
x558_messageTextTime = 1.f;
if (!info.IsHintMemo() || !isWidgetVisible)
return;
CSfxManager::SfxStart(1449, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);

View File

@ -184,7 +184,7 @@ public:
const CActorLights* GetActorLights() const { return x90_actorLights.get(); }
CActorLights* ActorLights() { return x90_actorLights.get(); }
bool CanDrawStatic() const;
bool IsActorActive() const { return xe7_29_drawEnabled; }
bool IsDrawEnabled() const { return xe7_29_drawEnabled; }
void SetWorldLightingDirty(bool b) { xe7_28_worldLightingDirty = b; }
const CScannableObjectInfo* GetScannableObjectInfo() const;
const CHealthInfo* GetHealthInfo(const CStateManager& mgr) const

View File

@ -65,7 +65,7 @@ zeus::CVector3f CScriptDoor::GetOrbitPosition(const CStateManager& /*mgr*/) cons
/* ORIGINAL 0-00 OFFSET: 8007E550 */
void CScriptDoor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager &mgr)
{
switch(msg)
switch (msg)
{
case EScriptObjectMessage::Close:
{
@ -77,11 +77,9 @@ void CScriptDoor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStat
if (x2a8_26_isOpen)
{
// if (x27e_partner2 != kInvalidUniqueId)
// {
// if (CEntity* ent = mgr.ObjectById(x27e_partner2))
// mgr.SendScriptMsg(ent, GetUniqueId(), EScriptObjectMessage::Close);
// }
if (x27e_partner2 != kInvalidUniqueId)
if (CEntity* ent = mgr.ObjectById(x27e_partner2))
mgr.SendScriptMsg(ent, GetUniqueId(), EScriptObjectMessage::Close);
x2a8_26_isOpen = false;
SetDoorAnimation(EDoorAnimType::Close);
mgr.GetCameraManager()->GetBallCamera()->DoorClosing(GetUniqueId());

View File

@ -376,7 +376,7 @@ void CScriptEffect::CalculateRenderBounds()
if (particleBounds || electricBounds)
{
zeus::CAABox renderBounds = zeus::CAABox::skNullBox;
zeus::CAABox renderBounds = zeus::CAABox::skInvertedBox;
if (particleBounds)
{
renderBounds.accumulateBounds(particleBounds->min);

View File

@ -176,6 +176,9 @@ void CScriptSound::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSta
break;
case EScriptObjectMessage::Play:
{
if (xc_editorId.id == 0x00000223)
printf("");
if (GetActive())
PlaySound(mgr);
}

2
amuse

@ -1 +1 @@
Subproject commit 594fb346e1ffd25f7d387f42716cd77202460c30
Subproject commit 1fefba66e7fc96cb6fc1b1b014c365da2e0b7a43