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
|
|
|
|
{
|
2018-03-17 03:41:01 +00:00
|
|
|
struct SQuadDescr;
|
|
|
|
struct CQuadDecal
|
2016-08-04 22:24:28 +00:00
|
|
|
{
|
2018-03-17 03:41:01 +00:00
|
|
|
union
|
2016-08-04 22:24:28 +00:00
|
|
|
{
|
2018-03-17 03:41:01 +00:00
|
|
|
struct
|
2016-08-04 22:24:28 +00:00
|
|
|
{
|
2018-03-17 03:41:01 +00:00
|
|
|
bool x0_24_invalid : 1;
|
2016-08-04 22:24:28 +00:00
|
|
|
};
|
2018-03-17 03:41:01 +00:00
|
|
|
u32 _dummy = 0;
|
2016-08-04 22:24:28 +00:00
|
|
|
};
|
2018-03-17 03:41:01 +00:00
|
|
|
s32 x4_lifetime = 0;
|
|
|
|
float x8_rotation = 0.f;
|
|
|
|
const SQuadDescr* m_desc = nullptr;
|
|
|
|
CQuadDecal() = default;
|
|
|
|
CQuadDecal(s32 i, float f)
|
|
|
|
: x4_lifetime(i),
|
|
|
|
x8_rotation(f)
|
|
|
|
{
|
|
|
|
x0_24_invalid = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
boo::ObjToken<boo::IGraphicsBufferD> m_instBuf;
|
|
|
|
boo::ObjToken<boo::IGraphicsBufferD> m_uniformBuf;
|
|
|
|
boo::ObjToken<boo::IShaderDataBinding> m_normalDataBind;
|
|
|
|
boo::ObjToken<boo::IShaderDataBinding> m_redToAlphaDataBind;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CDecal
|
|
|
|
{
|
|
|
|
friend class CDecalManager;
|
|
|
|
static bool sMoveRedToAlphaBuffer;
|
2016-08-04 22:24:28 +00:00
|
|
|
static CRandom16 sDecalRandom;
|
|
|
|
|
|
|
|
TLockedToken<CDecalDescription> x0_description;
|
|
|
|
zeus::CTransform xc_transform;
|
2018-03-17 03:41:01 +00:00
|
|
|
CQuadDecal x3c_decalQuads[2];
|
|
|
|
s32 x54_modelLifetime = 0;
|
2017-01-22 17:36:25 +00:00
|
|
|
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;
|
2018-03-17 03:41:01 +00:00
|
|
|
bool InitQuad(CQuadDecal& quad, const SQuadDescr& desc);
|
2016-08-04 22:24:28 +00:00
|
|
|
public:
|
2018-03-17 03:41:01 +00:00
|
|
|
CDecal(const TToken<CDecalDescription>& desc, const zeus::CTransform& xf);
|
|
|
|
void RenderQuad(CQuadDecal& decal, const SQuadDescr& desc) const;
|
2016-08-04 22:24:28 +00:00
|
|
|
void RenderMdl() const;
|
2017-03-04 04:31:08 +00:00
|
|
|
void Render() const;
|
2018-03-17 03:41:01 +00:00
|
|
|
void Update(float dt);
|
2016-08-04 22:24:28 +00:00
|
|
|
|
|
|
|
static void SetGlobalSeed(u16);
|
|
|
|
static void SetMoveRedToAlphaBuffer(bool);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CDECAL_HPP__
|