2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
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#Int_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 CIEKeyframeEmitter : public CIntElement
|
|
|
|
{
|
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;
|
|
|
|
std::vector<int> x18_keys;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CIEKeyframeEmitter(CInputStream& in);
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIEDeath : public CIntElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00:00
|
|
|
CIEDeath(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIEClamp : public CIntElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_min;
|
|
|
|
std::unique_ptr<CIntElement> x8_max;
|
|
|
|
std::unique_ptr<CIntElement> xc_val;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00: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)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIETimeChain : public CIntElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
2016-02-07 00:19:59 +00:00
|
|
|
std::unique_ptr<CIntElement> xc_swFrame;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00: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)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIEAdd : public CIntElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00:00
|
|
|
CIEAdd(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIEConstant : public CIntElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
int x4_val;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CIEConstant(int val) : x4_val(val) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIEImpulse : public CIntElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00:00
|
|
|
CIEImpulse(std::unique_ptr<CIntElement>&& a)
|
|
|
|
: x4_a(std::move(a)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIELifetimePercent : public CIntElement
|
|
|
|
{
|
2016-02-07 00:19:59 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_percentVal;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00:00
|
|
|
CIELifetimePercent(std::unique_ptr<CIntElement>&& a)
|
|
|
|
: x4_percentVal(std::move(a)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIEInitialRandom : public CIntElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00:00
|
|
|
CIEInitialRandom(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIEPulse : public CIntElement
|
|
|
|
{
|
2016-02-07 00:19:59 +00:00
|
|
|
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 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00: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)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIEMultiply : public CIntElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00:00
|
|
|
CIEMultiply(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIESampleAndHold : public CIntElement
|
|
|
|
{
|
2016-02-07 00:19:59 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_sampleSource;
|
|
|
|
int x8_nextSampleFrame = 0;
|
|
|
|
std::unique_ptr<CIntElement> xc_waitFramesMin;
|
|
|
|
std::unique_ptr<CIntElement> x10_waitFramesMax;
|
|
|
|
int x14_holdVal;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00: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)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIERandom : public CIntElement
|
|
|
|
{
|
2016-02-07 00:19:59 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_min;
|
|
|
|
std::unique_ptr<CIntElement> x8_max;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00:00
|
|
|
CIERandom(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_min(std::move(a)), x8_max(std::move(b)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIETimeScale : public CIntElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00:00
|
|
|
CIETimeScale(std::unique_ptr<CRealElement>&& a)
|
|
|
|
: x4_a(std::move(a)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2016-03-19 02:04:12 +00:00
|
|
|
class CIEGetCumulativeParticleCount : public CIntElement
|
2016-02-05 08:34:14 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
2016-03-19 02:04:12 +00:00
|
|
|
class CIEGetActiveParticleCount : public CIntElement
|
2016-02-11 20:32:42 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, int &valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-11 20:32:42 +00:00
|
|
|
};
|
|
|
|
|
2016-03-19 02:04:12 +00:00
|
|
|
class CIEGetEmitterTime : public CIntElement
|
2016-02-11 20:32:42 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, int &valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-11 20:32:42 +00:00
|
|
|
};
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
class CIEModulo : public CIntElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00:00
|
|
|
CIEModulo(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 08:34:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CIESubtract : public CIntElement
|
2016-02-05 01:27:03 +00:00
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
|
|
|
std::unique_ptr<CIntElement> x8_b;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2018-05-20 06:14:57 +00:00
|
|
|
CIESubtract(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
|
|
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, int& valOut) const;
|
2018-06-08 01:15:46 +00:00
|
|
|
int GetMaxValue() const;
|
2016-02-05 01:27:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|