mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 10:27:42 +00:00
macOS decal rendering support
This commit is contained in:
@@ -9,38 +9,44 @@
|
||||
|
||||
namespace urde
|
||||
{
|
||||
struct SQuadDescr;
|
||||
struct CQuadDecal
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
bool x0_24_invalid : 1;
|
||||
};
|
||||
u32 _dummy = 0;
|
||||
};
|
||||
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;
|
||||
public:
|
||||
struct CQuadDecal
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
bool x0_24_invalid : 1;
|
||||
};
|
||||
u32 _dummy = 0;
|
||||
};
|
||||
s32 x4_lifetime = 0;
|
||||
float x8_rotation = 0.f;
|
||||
CQuadDecal(s32 i, float f)
|
||||
: x4_lifetime(i),
|
||||
x8_rotation(f)
|
||||
{
|
||||
x0_24_invalid = true;
|
||||
}
|
||||
};
|
||||
private:
|
||||
static bool sMoveRedToAphaBuffer;
|
||||
static bool sMoveRedToAlphaBuffer;
|
||||
static CRandom16 sDecalRandom;
|
||||
|
||||
TLockedToken<CDecalDescription> x0_description;
|
||||
zeus::CTransform xc_transform;
|
||||
CQuadDecal x3c_decalQuad1;
|
||||
CQuadDecal x48_decalQuad2;
|
||||
s32 x54_lifetime = 0;
|
||||
CQuadDecal x3c_decalQuads[2];
|
||||
s32 x54_modelLifetime = 0;
|
||||
s32 x58_frameIdx = 0;
|
||||
union
|
||||
{
|
||||
@@ -53,16 +59,13 @@ private:
|
||||
u32 x5c_dummy = 0;
|
||||
};
|
||||
zeus::CVector3f x60_rotation;
|
||||
bool InitQuad(CQuadDecal&, const CDecalDescription::SQuadDescr&);
|
||||
bool InitQuad(CQuadDecal& quad, const SQuadDescr& desc);
|
||||
public:
|
||||
CDecal(const TToken<CDecalDescription>&, const zeus::CTransform&);
|
||||
bool IsDone() const;
|
||||
void RenderQuad(CQuadDecal&, const CDecalDescription::SQuadDescr&) const;
|
||||
CDecal(const TToken<CDecalDescription>& desc, const zeus::CTransform& xf);
|
||||
void RenderQuad(CQuadDecal& decal, const SQuadDescr& desc) const;
|
||||
void RenderMdl() const;
|
||||
void Render() const;
|
||||
void ProcessQuad(CQuadDecal&, const CDecalDescription::SQuadDescr&, s32) const;
|
||||
void Update(float);
|
||||
void CheckTime(s32, s32);
|
||||
void Update(float dt);
|
||||
|
||||
static void SetGlobalSeed(u16);
|
||||
static void SetMoveRedToAlphaBuffer(bool);
|
||||
|
||||
Reference in New Issue
Block a user