metaforce/Runtime/World/CScriptVisorFlare.cpp

55 lines
1.7 KiB
C++
Raw Normal View History

2017-03-20 05:09:53 +00:00
#include "CScriptVisorFlare.hpp"
#include "CActorParameters.hpp"
#include "TCastTo.hpp"
#include "CStateManager.hpp"
#include "CPlayer.hpp"
2017-03-20 06:59:46 +00:00
#include "Particle/CGenDescription.hpp"
2017-03-20 05:09:53 +00:00
namespace urde
{
2017-11-13 06:19:18 +00:00
CScriptVisorFlare::CScriptVisorFlare(TUniqueId uid, std::string_view name, const CEntityInfo& info,
2017-03-20 05:09:53 +00:00
bool active, const zeus::CVector3f& pos, CVisorFlare::EBlendMode blendMode,
bool b1, float f1, float f2, float f3, u32 w1, u32 w2,
const std::vector<CVisorFlare::CFlareDef>& flares)
: CActor(uid, active, name, info, zeus::CTransform::Translate(pos), CModelData::CModelDataNull(),
2017-12-19 03:05:50 +00:00
CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId),
2017-03-20 05:09:53 +00:00
xe8_flare(blendMode, b1, f1, f2, f3, w1, w2, flares)
{
2017-08-13 07:56:35 +00:00
xe6_27_renderVisorFlags = 2;
2017-03-20 05:09:53 +00:00
}
void CScriptVisorFlare::Accept(IVisitor& visitor)
{
visitor.Visit(this);
}
void CScriptVisorFlare::Think(float dt, CStateManager& stateMgr)
{
if (GetActive())
xe8_flare.Update(dt, GetTranslation(), this, stateMgr);
}
void CScriptVisorFlare::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CStateManager& stateMgr)
{
CActor::AcceptScriptMsg(msg, objId, stateMgr);
}
void CScriptVisorFlare::PreRender(CStateManager& stateMgr, const zeus::CFrustum&)
{
x11c_notInRenderLast = !stateMgr.RenderLast(x8_uid);
}
void CScriptVisorFlare::AddToRenderer(const zeus::CFrustum&, const CStateManager& stateMgr) const
{
if (x11c_notInRenderLast)
EnsureRendered(stateMgr, stateMgr.GetPlayer().GetTranslation(), GetSortingBounds(stateMgr));
}
void CScriptVisorFlare::Render(const CStateManager& stateMgr) const
{
xe8_flare.Render(GetTranslation(), stateMgr);
}
}