metaforce/Runtime/Particle/CColorElement.hpp

101 lines
3.4 KiB
C++
Raw Permalink Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
#include <memory>
#include <vector>
#include "Runtime/GCNTypes.hpp"
#include "Runtime/Particle/IElement.hpp"
2016-02-05 00:34:14 -08:00
/* Documentation at: https://wiki.axiodl.com/w/Particle_Script#Color_Elements */
2016-02-27 22:55:05 -08:00
2021-04-10 01:42:06 -07:00
namespace metaforce {
2018-12-07 21:30:43 -08:00
class CCEKeyframeEmitter : public CColorElement {
u32 x4_percent;
u32 x8_unk1;
bool xc_loop;
bool xd_unk2;
s32 x10_loopEnd;
s32 x14_loopStart;
std::vector<zeus::CColor> x18_keys;
2016-02-05 00:34:14 -08:00
public:
explicit CCEKeyframeEmitter(CInputStream& in);
bool GetValue(int frame, zeus::CColor& colorOut) const override;
2016-02-05 00:34:14 -08:00
};
2018-12-07 21:30:43 -08:00
class CCEConstant : public CColorElement {
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 00:34:14 -08:00
public:
2018-12-07 21:30:43 -08:00
CCEConstant(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b, std::unique_ptr<CRealElement>&& c,
std::unique_ptr<CRealElement>&& d)
: x4_r(std::move(a)), x8_g(std::move(b)), xc_b(std::move(c)), x10_a(std::move(d)) {}
bool GetValue(int frame, zeus::CColor& colorOut) const override;
2016-02-05 00:34:14 -08:00
};
2018-12-07 21:30:43 -08:00
class CCEFastConstant : public CColorElement {
zeus::CColor x4_val;
2016-02-05 00:34:14 -08:00
public:
2018-12-07 21:30:43 -08:00
CCEFastConstant(float a, float b, float c, float d) : x4_val(a, b, c, d) {}
bool GetValue(int frame, zeus::CColor& colorOut) const override;
2016-02-05 00:34:14 -08:00
};
2018-12-07 21:30:43 -08:00
class CCETimeChain : public CColorElement {
std::unique_ptr<CColorElement> x4_a;
std::unique_ptr<CColorElement> x8_b;
std::unique_ptr<CIntElement> xc_swFrame;
2016-02-05 00:34:14 -08:00
public:
2018-12-07 21:30:43 -08:00
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)) {}
bool GetValue(int frame, zeus::CColor& colorOut) const override;
2016-02-05 00:34:14 -08:00
};
2018-12-07 21:30:43 -08:00
class CCEFadeEnd : public CColorElement {
std::unique_ptr<CColorElement> x4_a;
std::unique_ptr<CColorElement> x8_b;
std::unique_ptr<CRealElement> xc_startFrame;
std::unique_ptr<CRealElement> x10_endFrame;
2016-02-05 00:34:14 -08:00
public:
2018-12-07 21:30:43 -08:00
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)) {}
bool GetValue(int frame, zeus::CColor& colorOut) const override;
2016-02-05 00:34:14 -08:00
};
2018-12-07 21:30:43 -08:00
class CCEFade : public CColorElement {
std::unique_ptr<CColorElement> x4_a;
std::unique_ptr<CColorElement> x8_b;
std::unique_ptr<CRealElement> xc_endFrame;
2016-02-05 00:34:14 -08:00
public:
2018-12-07 21:30:43 -08:00
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)) {}
bool GetValue(int frame, zeus::CColor& colorOut) const override;
2016-02-05 00:34:14 -08:00
};
2018-12-07 21:30:43 -08:00
class CCEPulse : public CColorElement {
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 00:34:14 -08:00
public:
2018-12-07 21:30:43 -08:00
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)) {}
bool GetValue(int frame, zeus::CColor& colorOut) const override;
};
2018-12-07 21:30:43 -08:00
class CCEParticleColor : public CColorElement {
2016-02-11 22:06:17 -08:00
public:
bool GetValue(int frame, zeus::CColor& colorOut) const override;
2016-02-11 22:06:17 -08:00
};
2021-04-10 01:42:06 -07:00
} // namespace metaforce