metaforce/Runtime/Particle/CDecal.hpp

50 lines
1.3 KiB
C++
Raw Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
2016-08-04 15:24:28 -07:00
#include <array>
#include "Runtime/CRandom16.hpp"
#include "Runtime/CToken.hpp"
#include "Runtime/RetroTypes.hpp"
#include "Runtime/Particle/CDecalDescription.hpp"
#include <zeus/CTransform.hpp>
#include <zeus/CVector3f.hpp>
2016-08-04 15:24:28 -07:00
2021-04-10 01:42:06 -07:00
namespace metaforce {
2018-03-16 20:41:01 -07:00
struct SQuadDescr;
2018-12-07 21:30:43 -08:00
struct CQuadDecal {
bool x0_24_invalid : 1 = true;
2018-12-07 21:30:43 -08:00
s32 x4_lifetime = 0;
float x8_rotation = 0.f;
CQuadDecal() = default;
CQuadDecal(s32 i, float f) : x4_lifetime(i), x8_rotation(f) {}
2018-03-16 20:41:01 -07:00
};
2018-12-07 21:30:43 -08:00
class CDecal {
friend class CDecalManager;
static bool sMoveRedToAlphaBuffer;
static CRandom16 sDecalRandom;
2016-08-04 15:24:28 -07:00
2018-12-07 21:30:43 -08:00
TLockedToken<CDecalDescription> x0_description;
zeus::CTransform xc_transform;
std::array<CQuadDecal, 2> x3c_decalQuads;
2018-12-07 21:30:43 -08:00
s32 x54_modelLifetime = 0;
s32 x58_frameIdx = 0;
bool x5c_31_quad1Invalid : 1 = false;
bool x5c_30_quad2Invalid : 1 = false;
bool x5c_29_modelInvalid : 1 = false;
2018-12-07 21:30:43 -08:00
zeus::CVector3f x60_rotation;
bool InitQuad(CQuadDecal& quad, const SQuadDescr& desc);
2016-08-04 15:24:28 -07:00
public:
2018-12-07 21:30:43 -08:00
CDecal(const TToken<CDecalDescription>& desc, const zeus::CTransform& xf);
void RenderQuad(CQuadDecal& decal, const SQuadDescr& desc) const;
void RenderMdl();
void Render();
2018-12-07 21:30:43 -08:00
void Update(float dt);
2016-08-04 15:24:28 -07:00
2018-12-07 21:30:43 -08:00
static void SetGlobalSeed(u16);
static void SetMoveRedToAlphaBuffer(bool);
2016-08-04 15:24:28 -07:00
};
2021-04-10 01:42:06 -07:00
} // namespace metaforce