2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-08-04 22:24:28 +00:00
|
|
|
|
2020-03-21 05:51:28 +00:00
|
|
|
#include <array>
|
|
|
|
|
2019-09-22 21:52:05 +00:00
|
|
|
#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 22:24:28 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2018-03-17 03:41:01 +00:00
|
|
|
struct SQuadDescr;
|
2018-12-08 05:30:43 +00:00
|
|
|
struct CQuadDecal {
|
2020-04-11 04:39:49 +00:00
|
|
|
bool x0_24_invalid : 1;
|
2018-12-08 05:30:43 +00:00
|
|
|
s32 x4_lifetime = 0;
|
|
|
|
float x8_rotation = 0.f;
|
|
|
|
const SQuadDescr* m_desc = nullptr;
|
2020-04-11 04:39:49 +00:00
|
|
|
CQuadDecal() : x0_24_invalid(true) {}
|
|
|
|
CQuadDecal(s32 i, float f) : x0_24_invalid(true), x4_lifetime(i), x8_rotation(f) {}
|
2018-03-17 03:41:01 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
boo::ObjToken<boo::IGraphicsBufferD> m_instBuf;
|
|
|
|
boo::ObjToken<boo::IGraphicsBufferD> m_uniformBuf;
|
|
|
|
boo::ObjToken<boo::IShaderDataBinding> m_normalDataBind;
|
|
|
|
boo::ObjToken<boo::IShaderDataBinding> m_redToAlphaDataBind;
|
2018-03-17 03:41:01 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CDecal {
|
|
|
|
friend class CDecalManager;
|
|
|
|
static bool sMoveRedToAlphaBuffer;
|
|
|
|
static CRandom16 sDecalRandom;
|
2016-08-04 22:24:28 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
TLockedToken<CDecalDescription> x0_description;
|
|
|
|
zeus::CTransform xc_transform;
|
2020-03-21 05:51:28 +00:00
|
|
|
std::array<CQuadDecal, 2> x3c_decalQuads;
|
2018-12-08 05:30:43 +00:00
|
|
|
s32 x54_modelLifetime = 0;
|
|
|
|
s32 x58_frameIdx = 0;
|
2020-04-11 04:39:49 +00:00
|
|
|
bool x5c_31_quad1Invalid : 1;
|
|
|
|
bool x5c_30_quad2Invalid : 1;
|
|
|
|
bool x5c_29_modelInvalid : 1;
|
2018-12-08 05:30:43 +00:00
|
|
|
zeus::CVector3f x60_rotation;
|
|
|
|
bool InitQuad(CQuadDecal& quad, const SQuadDescr& desc);
|
|
|
|
|
2016-08-04 22:24:28 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CDecal(const TToken<CDecalDescription>& desc, const zeus::CTransform& xf);
|
|
|
|
void RenderQuad(CQuadDecal& decal, const SQuadDescr& desc) const;
|
2020-04-09 17:28:20 +00:00
|
|
|
void RenderMdl();
|
|
|
|
void Render();
|
2018-12-08 05:30:43 +00:00
|
|
|
void Update(float dt);
|
2016-08-04 22:24:28 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static void SetGlobalSeed(u16);
|
|
|
|
static void SetMoveRedToAlphaBuffer(bool);
|
2016-08-04 22:24:28 +00:00
|
|
|
};
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|