metaforce/Runtime/World/CVisorFlare.cpp

40 lines
1.1 KiB
C++
Raw Normal View History

2017-03-20 05:09:53 +00:00
#include "CVisorFlare.hpp"
#include "CSimplePool.hpp"
#include "GameGlobalObjects.hpp"
2018-12-08 05:30:43 +00:00
namespace urde {
2017-03-20 05:09:53 +00:00
2019-01-29 08:28:35 +00:00
rstl::optional<CVisorFlare::CFlareDef> CVisorFlare::LoadFlareDef(CInputStream& in) {
2018-12-08 05:30:43 +00:00
u32 propCount = in.readUint32Big();
if (propCount != 4)
return {};
2017-03-20 05:09:53 +00:00
2018-12-08 05:30:43 +00:00
CAssetId txtrId = in.readUint32Big();
float f1 = in.readFloatBig();
float f2 = in.readFloatBig();
zeus::CColor color = zeus::CColor::ReadRGBABig(in);
if (!txtrId.IsValid())
return {};
2017-03-20 05:09:53 +00:00
2018-12-08 05:30:43 +00:00
TToken<CTexture> tex = g_SimplePool->GetObj(SObjectTag{FOURCC('TXTR'), txtrId});
2017-03-20 05:09:53 +00:00
2018-12-08 05:30:43 +00:00
return CFlareDef(tex, f1, f2, color);
2017-03-20 05:09:53 +00:00
}
CVisorFlare::CVisorFlare(EBlendMode blendMode, bool b1, float f1, float f2, float f3, u32 w1, u32 w2,
const std::vector<CFlareDef>& flares)
2018-12-08 05:30:43 +00:00
: x0_blendMode(blendMode)
, x4_flareDefs(flares)
, x14_b1(b1)
, x18_f1(std::max(f1, 0.0001f))
, x1c_f2(f2)
, x20_f3(f3)
, x2c_w1(w1)
, x30_w2(w2) {}
2017-03-20 05:09:53 +00:00
2018-12-08 05:30:43 +00:00
void CVisorFlare::Update(float dt, const zeus::CVector3f& pos, const CActor* act, CStateManager& mgr) {}
2017-03-20 05:09:53 +00:00
2018-12-08 05:30:43 +00:00
void CVisorFlare::Render(const zeus::CVector3f& pos, const CStateManager& mgr) const {}
2017-03-20 05:09:53 +00:00
2018-12-08 05:30:43 +00:00
} // namespace urde