metaforce/Runtime/Particle/CColorElement.hpp

105 lines
3.4 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CCOLORELEMENT_HPP__
#define __URDE_CCOLORELEMENT_HPP__
2016-02-05 08:34:14 +00:00
#include "IElement.hpp"
2016-02-28 06:55:05 +00:00
/* Documentation at: http://www.metroid2002.com/retromodding/wiki/Particle_Script#Color_Elements */
2016-03-04 23:04:53 +00:00
namespace urde
{
2016-02-05 08:34:14 +00:00
class CCEKeyframeEmitter : public CColorElement
{
u32 x4_percent;
u32 x8_unk1;
bool xc_loop;
bool xd_unk2;
s32 x10_loopEnd;
s32 x14_loopStart;
2016-03-04 23:04:53 +00:00
std::vector<zeus::CColor> x18_keys;
2016-02-05 08:34:14 +00:00
public:
CCEKeyframeEmitter(CInputStream& in);
2016-03-04 23:04:53 +00:00
bool GetValue(int frame, zeus::CColor& colorOut) const;
2016-02-05 08:34:14 +00:00
};
class CCEConstant : public CColorElement
{
2018-09-20 18:17:09 +00:00
std::unique_ptr<CRealElement> x4_r;
std::unique_ptr<CRealElement> x8_g;
std::unique_ptr<CRealElement> xc_b;
std::unique_ptr<CRealElement> x10_a;
2016-02-05 08:34:14 +00:00
public:
CCEConstant(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b,
std::unique_ptr<CRealElement>&& c, std::unique_ptr<CRealElement>&& d)
2018-09-20 18:17:09 +00:00
: x4_r(std::move(a)), x8_g(std::move(b)), xc_b(std::move(c)), x10_a(std::move(d)) {}
2016-03-04 23:04:53 +00:00
bool GetValue(int frame, zeus::CColor& colorOut) const;
2016-02-05 08:34:14 +00:00
};
class CCEFastConstant : public CColorElement
{
2016-03-04 23:04:53 +00:00
zeus::CColor x4_val;
2016-02-05 08:34:14 +00:00
public:
CCEFastConstant(float a, float b, float c, float d)
: x4_val(a, b, c, d) {}
2016-03-04 23:04:53 +00:00
bool GetValue(int frame, zeus::CColor& colorOut) const;
2016-02-05 08:34:14 +00:00
};
class CCETimeChain : public CColorElement
{
std::unique_ptr<CColorElement> x4_a;
std::unique_ptr<CColorElement> x8_b;
2016-02-07 23:59:05 +00:00
std::unique_ptr<CIntElement> xc_swFrame;
2016-02-05 08:34:14 +00:00
public:
CCETimeChain(std::unique_ptr<CColorElement>&& a, std::unique_ptr<CColorElement>&& b,
std::unique_ptr<CIntElement>&& c)
: x4_a(std::move(a)), x8_b(std::move(b)), xc_swFrame(std::move(c)) {}
2016-03-04 23:04:53 +00:00
bool GetValue(int frame, zeus::CColor& colorOut) const;
2016-02-05 08:34:14 +00:00
};
class CCEFadeEnd : public CColorElement
{
std::unique_ptr<CColorElement> x4_a;
std::unique_ptr<CColorElement> x8_b;
2016-02-07 23:59:05 +00:00
std::unique_ptr<CRealElement> xc_startFrame;
std::unique_ptr<CRealElement> x10_endFrame;
2016-02-05 08:34:14 +00:00
public:
CCEFadeEnd(std::unique_ptr<CColorElement>&& a, std::unique_ptr<CColorElement>&& b,
std::unique_ptr<CRealElement>&& c, std::unique_ptr<CRealElement>&& d)
: x4_a(std::move(a)), x8_b(std::move(b)), xc_startFrame(std::move(c)), x10_endFrame(std::move(d)) {}
2016-03-04 23:04:53 +00:00
bool GetValue(int frame, zeus::CColor& colorOut) const;
2016-02-05 08:34:14 +00:00
};
class CCEFade : public CColorElement
{
std::unique_ptr<CColorElement> x4_a;
std::unique_ptr<CColorElement> x8_b;
2016-02-29 03:03:11 +00:00
std::unique_ptr<CRealElement> xc_endFrame;
2016-02-05 08:34:14 +00:00
public:
CCEFade(std::unique_ptr<CColorElement>&& a, std::unique_ptr<CColorElement>&& b,
std::unique_ptr<CRealElement>&& c)
: x4_a(std::move(a)), x8_b(std::move(b)), xc_endFrame(std::move(c)) {}
2016-03-04 23:04:53 +00:00
bool GetValue(int frame, zeus::CColor& colorOut) const;
2016-02-05 08:34:14 +00:00
};
class CCEPulse : public CColorElement
{
2016-02-07 23:59:05 +00:00
std::unique_ptr<CIntElement> x4_aDuration;
std::unique_ptr<CIntElement> x8_bDuration;
std::unique_ptr<CColorElement> xc_aVal;
std::unique_ptr<CColorElement> x10_bVal;
2016-02-05 08:34:14 +00:00
public:
CCEPulse(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b,
std::unique_ptr<CColorElement>&& c, std::unique_ptr<CColorElement>&& d)
: x4_aDuration(std::move(a)), x8_bDuration(std::move(b)), xc_aVal(std::move(c)), x10_bVal(std::move(d)) {}
2016-03-04 23:04:53 +00:00
bool GetValue(int frame, zeus::CColor& colorOut) const;
};
2016-02-12 06:06:17 +00:00
class CCEParticleColor : public CColorElement
{
public:
2016-03-04 23:04:53 +00:00
bool GetValue(int frame, zeus::CColor& colorOut) const;
2016-02-12 06:06:17 +00:00
};
}
2016-04-13 06:07:23 +00:00
#endif // __URDE_CCOLORELEMENT_HPP__