2018-10-06 20:42:33 -07:00
|
|
|
#pragma once
|
2016-02-04 17:27:03 -08:00
|
|
|
|
2019-09-22 14:52:05 -07:00
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Runtime/Particle/IElement.hpp"
|
2016-02-05 00:34:14 -08:00
|
|
|
|
2019-12-03 00:47:05 -08:00
|
|
|
/* Documentation at: https://wiki.axiodl.com/w/Particle_Script#Int_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 CIEKeyframeEmitter : public CIntElement {
|
|
|
|
u32 x4_percent;
|
|
|
|
u32 x8_unk1;
|
|
|
|
bool xc_loop;
|
|
|
|
bool xd_unk2;
|
|
|
|
u32 x10_loopEnd;
|
|
|
|
u32 x14_loopStart;
|
|
|
|
std::vector<int> x18_keys;
|
2016-02-04 17:27:03 -08:00
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2020-03-25 18:25:11 -07:00
|
|
|
explicit CIEKeyframeEmitter(CInputStream& in);
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEDeath : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CIEDeath(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEClamp : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_min;
|
|
|
|
std::unique_ptr<CIntElement> x8_max;
|
|
|
|
std::unique_ptr<CIntElement> xc_val;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CIEClamp(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b, std::unique_ptr<CIntElement>&& c)
|
|
|
|
: x4_min(std::move(a)), x8_max(std::move(b)), xc_val(std::move(c)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIETimeChain : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> 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
|
|
|
CIETimeChain(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b, std::unique_ptr<CIntElement>&& c)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)), xc_swFrame(std::move(c)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEAdd : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CIEAdd(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b) : x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEConstant : public CIntElement {
|
|
|
|
int x4_val;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2020-03-25 18:25:11 -07:00
|
|
|
explicit CIEConstant(int val) : x4_val(val) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEImpulse : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2020-03-25 18:25:11 -07:00
|
|
|
explicit CIEImpulse(std::unique_ptr<CIntElement>&& a) : x4_a(std::move(a)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIELifetimePercent : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_percentVal;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2020-03-25 18:25:11 -07:00
|
|
|
explicit CIELifetimePercent(std::unique_ptr<CIntElement>&& a) : x4_percentVal(std::move(a)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEInitialRandom : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CIEInitialRandom(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEPulse : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_aDuration;
|
|
|
|
std::unique_ptr<CIntElement> x8_bDuration;
|
|
|
|
std::unique_ptr<CIntElement> xc_aVal;
|
|
|
|
std::unique_ptr<CIntElement> x10_bVal;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CIEPulse(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b, std::unique_ptr<CIntElement>&& c,
|
|
|
|
std::unique_ptr<CIntElement>&& d)
|
|
|
|
: x4_aDuration(std::move(a)), x8_bDuration(std::move(b)), xc_aVal(std::move(c)), x10_bVal(std::move(d)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEMultiply : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CIEMultiply(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIESampleAndHold : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_sampleSource;
|
2020-03-22 03:05:56 -07:00
|
|
|
mutable int x8_nextSampleFrame = 0;
|
2018-12-07 21:30:43 -08:00
|
|
|
std::unique_ptr<CIntElement> xc_waitFramesMin;
|
|
|
|
std::unique_ptr<CIntElement> x10_waitFramesMax;
|
2020-04-13 13:20:47 -07:00
|
|
|
mutable int x14_holdVal = 0;
|
2018-12-07 21:30:43 -08:00
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CIESampleAndHold(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b, std::unique_ptr<CIntElement>&& c)
|
|
|
|
: x4_sampleSource(std::move(a)), xc_waitFramesMin(std::move(b)), x10_waitFramesMax(std::move(c)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIERandom : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_min;
|
|
|
|
std::unique_ptr<CIntElement> x8_max;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CIERandom(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_min(std::move(a)), x8_max(std::move(b)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIETimeScale : public CIntElement {
|
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2020-03-25 18:25:11 -07:00
|
|
|
explicit CIETimeScale(std::unique_ptr<CRealElement>&& a) : x4_a(std::move(a)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEGetCumulativeParticleCount : public CIntElement {
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEGetActiveParticleCount : public CIntElement {
|
2016-02-11 12:32:42 -08:00
|
|
|
public:
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-11 12:32:42 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEGetEmitterTime : public CIntElement {
|
2016-02-11 12:32:42 -08:00
|
|
|
public:
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-11 12:32:42 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIEModulo : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CIEModulo(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-05 00:34:14 -08:00
|
|
|
};
|
|
|
|
|
2018-12-07 21:30:43 -08:00
|
|
|
class CIESubtract : public CIntElement {
|
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
|
|
|
|
2016-02-05 00:34:14 -08:00
|
|
|
public:
|
2018-12-07 21:30:43 -08:00
|
|
|
CIESubtract(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2019-08-09 05:45:18 -07:00
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
2016-02-04 17:27:03 -08:00
|
|
|
};
|
|
|
|
|
2019-10-06 04:56:43 -07:00
|
|
|
class CIERealToInt final : public CIntElement {
|
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
|
|
|
std::unique_ptr<CRealElement> x8_b;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit CIERealToInt(std::unique_ptr<CRealElement>&& a, std::unique_ptr<CRealElement>&& b)
|
|
|
|
: x4_a{std::move(a)}, x8_b{std::move(b)} {}
|
|
|
|
|
|
|
|
bool GetValue(int frame, int& valOut) const override;
|
|
|
|
int GetMaxValue() const override;
|
|
|
|
};
|
|
|
|
|
2021-04-10 01:42:06 -07:00
|
|
|
} // namespace metaforce
|