metaforce/Runtime/Particle/CIntElement.hpp

219 lines
6.3 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CINTELEMENT_HPP__
#define __URDE_CINTELEMENT_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#Int_Elements */
2016-03-04 23:04:53 +00:00
namespace urde
{
2016-02-05 08:34:14 +00: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-05 08:34:14 +00:00
public:
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
{
std::unique_ptr<CIntElement> x4_a;
std::unique_ptr<CIntElement> x8_b;
2016-02-05 08:34:14 +00:00
public:
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
{
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:
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
{
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:
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
{
std::unique_ptr<CIntElement> x4_a;
std::unique_ptr<CIntElement> x8_b;
2016-02-05 08:34:14 +00:00
public:
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
{
int x4_val;
2016-02-05 08:34:14 +00:00
public:
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
{
std::unique_ptr<CIntElement> x4_a;
2016-02-05 08:34:14 +00:00
public:
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:
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
{
std::unique_ptr<CIntElement> x4_a;
std::unique_ptr<CIntElement> x8_b;
2016-02-05 08:34:14 +00:00
public:
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:
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
{
std::unique_ptr<CIntElement> x4_a;
std::unique_ptr<CIntElement> x8_b;
2016-02-05 08:34:14 +00:00
public:
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:
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:
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
{
std::unique_ptr<CRealElement> x4_a;
2016-02-05 08:34:14 +00:00
public:
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
};
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
};
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
};
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
{
std::unique_ptr<CIntElement> x4_a;
std::unique_ptr<CIntElement> x8_b;
2016-02-05 08:34:14 +00:00
public:
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
{
std::unique_ptr<CIntElement> x4_a;
std::unique_ptr<CIntElement> x8_b;
2016-02-05 08:34:14 +00:00
public:
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-04-13 06:07:23 +00:00
#endif // __URDE_CINTELEMENT_HPP__