2016-02-13 09:02:47 +00:00
|
|
|
#ifndef __PSHAG_CCOLORELEMENT_HPP__
|
|
|
|
#define __PSHAG_CCOLORELEMENT_HPP__
|
2016-02-05 01:27:03 +00:00
|
|
|
|
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 01:27:03 +00:00
|
|
|
{
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
class CCEKeyframeEmitter : public CColorElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
u32 x4_percent;
|
|
|
|
u32 x8_unk1;
|
|
|
|
bool xc_loop;
|
|
|
|
bool xd_unk2;
|
|
|
|
u32 x10_loopEnd;
|
|
|
|
u32 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:
|
2016-02-06 00:34:40 +00:00
|
|
|
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
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
|
|
|
std::unique_ptr<CRealElement> x8_b;
|
|
|
|
std::unique_ptr<CRealElement> xc_c;
|
|
|
|
std::unique_ptr<CRealElement> x10_d;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CCEConstant(CRealElement* a, CRealElement* b, CRealElement* c, CRealElement* d)
|
|
|
|
: x4_a(a), x8_b(b), xc_c(c), x10_d(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:
|
2016-02-06 00:34:40 +00:00
|
|
|
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
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
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:
|
2016-02-06 00:34:40 +00:00
|
|
|
CCETimeChain(CColorElement* a, CColorElement* b, CIntElement* c)
|
2016-02-07 23:59:05 +00:00
|
|
|
: x4_a(a), x8_b(b), xc_swFrame(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
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
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:
|
2016-02-06 00:34:40 +00:00
|
|
|
CCEFadeEnd(CColorElement* a, CColorElement* b, CRealElement* c, CRealElement* d)
|
2016-02-07 23:59:05 +00:00
|
|
|
: x4_a(a), x8_b(b), xc_startFrame(c), x10_endFrame(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
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
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:
|
2016-02-06 00:34:40 +00:00
|
|
|
CCEFade(CColorElement* a, CColorElement* b, CRealElement* c)
|
2016-02-29 03:03:11 +00:00
|
|
|
: x4_a(a), x8_b(b), xc_endFrame(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-05 01:27:03 +00:00
|
|
|
{
|
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:
|
2016-02-06 00:34:40 +00:00
|
|
|
CCEPulse(CIntElement* a, CIntElement* b, CColorElement* c, CColorElement* d)
|
2016-02-07 23:59:05 +00:00
|
|
|
: x4_aDuration(a), x8_bDuration(b), xc_aVal(c), x10_bVal(d) {}
|
2016-03-04 23:04:53 +00:00
|
|
|
bool GetValue(int frame, zeus::CColor& colorOut) const;
|
2016-02-05 01:27:03 +00:00
|
|
|
};
|
|
|
|
|
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-02-05 01:27:03 +00:00
|
|
|
}
|
|
|
|
|
2016-02-13 09:02:47 +00:00
|
|
|
#endif // __PSHAG_CCOLORELEMENT_HPP__
|