Update hecl, various fixes

This commit is contained in:
Phillip Stephens 2018-01-15 04:36:04 -08:00
parent 533b8775d4
commit 9255f0eeb0
6 changed files with 70 additions and 30 deletions

View File

@ -219,7 +219,11 @@ void CActor::OnScanStateChanged(EScanState state, CStateManager& mgr)
zeus::CAABox CActor::GetSortingBounds(const CStateManager&) const { return x9c_renderBounds; }
void CActor::DoUserAnimEvent(CStateManager&, CInt32POINode&, EUserEventType, float dt) {}
void CActor::DoUserAnimEvent(CStateManager&, CInt32POINode&, EUserEventType event, float)
{
if (event == EUserEventType::LoopedSoundStop)
RemoveEmitter();
}
void CActor::RemoveMaterial(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes t3, EMaterialTypes t4,
CStateManager& mgr)
@ -234,7 +238,11 @@ void CActor::RemoveMaterial(EMaterialTypes t1, EMaterialTypes t2, EMaterialTypes
RemoveMaterial(t2, t3, mgr);
}
void CActor::RemoveMaterial(EMaterialTypes t1, EMaterialTypes t2, CStateManager& mgr) { x68_material.Remove(t1); }
void CActor::RemoveMaterial(EMaterialTypes t1, EMaterialTypes t2, CStateManager& mgr)
{
x68_material.Remove(t1);
RemoveMaterial(t2, mgr);
}
void CActor::RemoveMaterial(EMaterialTypes t, CStateManager& mgr)
{

View File

@ -31,36 +31,33 @@ void CScriptCameraHint::Accept(IVisitor& visitor)
void CScriptCameraHint::InitializeInArea(CStateManager& mgr)
{
x164_delegatedCamera = kInvalidUniqueId;
for (CEntity* e : mgr.GetAllObjectList())
for (CEntity* ent : mgr.GetAllObjectList())
{
if (TCastToPtr<CEntity> ent = e)
for (const SConnection& conn : ent->GetConnectionList())
{
for (const SConnection& conn : ent->GetConnectionList())
{
if (mgr.GetIdForScript(conn.x8_objId) != GetUniqueId())
continue;
if (conn.x4_msg != EScriptObjectMessage::Increment &&
conn.x4_msg != EScriptObjectMessage::Decrement)
continue;
if (mgr.GetIdForScript(conn.x8_objId) != GetUniqueId())
continue;
if (conn.x4_msg != EScriptObjectMessage::Increment &&
conn.x4_msg != EScriptObjectMessage::Decrement)
continue;
for (auto it = ent->GetConnectionList().begin() ; it != ent->GetConnectionList().cend() ; ++it)
for (auto it = ent->GetConnectionList().begin() ; it != ent->GetConnectionList().cend() ; ++it)
{
const SConnection& conn2 = *it;
if (conn2.x4_msg != EScriptObjectMessage::Increment &&
conn2.x4_msg != EScriptObjectMessage::Decrement)
continue;
TUniqueId id = mgr.GetIdForScript(conn2.x8_objId);
if (TCastToPtr<CPathCamera>(mgr.ObjectById(id)) ||
TCastToPtr<CScriptSpindleCamera>(mgr.ObjectById((id))))
{
const SConnection& conn2 = *it;
if (conn2.x4_msg != EScriptObjectMessage::Increment &&
conn2.x4_msg != EScriptObjectMessage::Decrement)
continue;
TUniqueId id = mgr.GetIdForScript(conn2.x8_objId);
if (TCastToPtr<CPathCamera>(mgr.ObjectById(id)) ||
TCastToPtr<CScriptSpindleCamera>(mgr.ObjectById((id))))
{
ent->ConnectionList().erase(it);
if (x164_delegatedCamera != id)
x164_delegatedCamera = id;
break;
}
ent->ConnectionList().erase(it);
if (x164_delegatedCamera != id)
x164_delegatedCamera = id;
break;
}
break;
}
break;
}
}
}

View File

@ -20,7 +20,7 @@ void CScriptControllerAction::Accept(IVisitor& visitor)
visitor.Visit(this);
}
void CScriptControllerAction::Think(float dt, CStateManager& stateMgr)
void CScriptControllerAction::Think(float, CStateManager& stateMgr)
{
bool oldPressed = x3c_26_pressed;
if (x3c_24_mapScreenResponse)

View File

@ -1,4 +1,6 @@
#include "CScriptDebris.hpp"
#include "Collision/CCollisionInfoList.hpp"
#include "Particle/CElementGen.hpp"
#include "TCastTo.hpp"
namespace urde
@ -11,8 +13,8 @@ CScriptDebris::CScriptDebris(TUniqueId uid, std::string_view name, const CEntity
: CPhysicsActor(uid, active, name, info, xf, std::move(mData),
CMaterialList(EMaterialTypes::Solid, EMaterialTypes::Debris),
mData.GetBounds(xf.getRotation()), SMoverData(f2), aParams, 0.3f, 0.1f)
{
{
}
CScriptDebris::CScriptDebris(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
@ -26,7 +28,7 @@ CScriptDebris::CScriptDebris(TUniqueId uid, std::string_view name, const CEntity
: CPhysicsActor(uid, active, name, info, xf, std::move(mData),
CMaterialList(EMaterialTypes::Solid, EMaterialTypes::Debris),
mData.GetBounds(xf.getRotation()), SMoverData(1.f), aParams, 0.3f, 0.1f)
{
{
}
void CScriptDebris::Accept(IVisitor& visitor)
@ -34,4 +36,25 @@ void CScriptDebris::Accept(IVisitor& visitor)
visitor.Visit(this);
}
rstl::optional_object<zeus::CAABox> CScriptDebris::GetTouchBounds() const
{
return {};
}
void CScriptDebris::CollidedWith(TUniqueId, const CCollisionInfoList& colList, CStateManager&)
{
if (colList.GetCount() == 0)
return;
if (x282_24_)
{
x274_ = x270_;
SetVelocityWR(zeus::CVector3f::skZero);
}
else
{
x2c8_collisionNormal = colList.GetItem(0).GetNormalLeft();
}
}
}

View File

@ -5,6 +5,7 @@
namespace urde
{
class CElementGen;
class CScriptDebris : public CPhysicsActor
{
public:
@ -17,6 +18,14 @@ public:
};
private:
float x270_;
float x274_;
bool x282_24_ : 1;
zeus::CVector3f x2c8_collisionNormal;
std::unique_ptr<CElementGen> x2d4_;
std::unique_ptr<CElementGen> x2d8_;
std::unique_ptr<CElementGen> x2dc_;
TReservedAverage<float, 8> x2e0_;
public:
CScriptDebris(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, CModelData&&,
@ -31,6 +40,9 @@ public:
bool, bool, bool, bool);
void Accept(IVisitor& visitor);
rstl::optional_object<zeus::CAABox> GetTouchBounds() const;
void CollidedWith(TUniqueId uid, const CCollisionInfoList&, CStateManager&);
};
}

2
hecl

@ -1 +1 @@
Subproject commit 6b3abdd21acc0274c0bedff5d6cbd3bea3f21730
Subproject commit 3a8dc560c3c8d92826f0c5d214f5027884ddab9f