metaforce/Runtime/Particle/CDecal.hpp

71 lines
1.7 KiB
C++
Raw Normal View History

2016-08-04 22:24:28 +00:00
#ifndef __URDE_CDECAL_HPP__
#define __URDE_CDECAL_HPP__
#include "RetroTypes.hpp"
#include "CToken.hpp"
#include "zeus/CTransform.hpp"
#include "CDecalDescription.hpp"
#include "CRandom16.hpp"
namespace urde
{
class CDecal
{
public:
struct CQuadDecal
{
union
{
struct
{
2017-01-22 17:36:25 +00:00
bool x0_24_invalid : 1;
2016-08-04 22:24:28 +00:00
};
u32 _dummy = 0;
};
s32 x4_lifetime = 0;
float x8_rotation = 0.f;
CQuadDecal(s32 i, float f)
: x4_lifetime(i),
x8_rotation(f)
{
2017-01-22 17:36:25 +00:00
x0_24_invalid = true;
2016-08-04 22:24:28 +00:00
}
};
private:
static bool sMoveRedToAphaBuffer;
static CRandom16 sDecalRandom;
TLockedToken<CDecalDescription> x0_description;
zeus::CTransform xc_transform;
CQuadDecal x3c_decalQuad1;
CQuadDecal x48_decalQuad2;
2017-01-22 17:36:25 +00:00
s32 x54_lifetime = 0;
s32 x58_frameIdx = 0;
union
{
struct
{
bool x5c_31_quad1Invalid : 1;
bool x5c_30_quad2Invalid : 1;
bool x5c_29_modelInvalid : 1;
};
u32 x5c_dummy = 0;
};
zeus::CVector3f x60_rotation;
bool InitQuad(CQuadDecal&, const CDecalDescription::SQuadDescr&);
2016-08-04 22:24:28 +00:00
public:
CDecal(const TToken<CDecalDescription>&, const zeus::CTransform&);
bool IsDone() const;
void RenderQuad(CQuadDecal&, const CDecalDescription::SQuadDescr&) const;
void RenderMdl() const;
void ProcessQuad(CQuadDecal&, const CDecalDescription::SQuadDescr&, s32) const;
void Update(float);
void CheckTime(s32, s32);
static void SetGlobalSeed(u16);
static void SetMoveRedToAlphaBuffer(bool);
};
}
#endif // __URDE_CDECAL_HPP__