2016-04-13 06:07:23 +00:00
|
|
|
#ifndef __URDE_CREALELEMENT_HPP__
|
|
|
|
#define __URDE_CREALELEMENT_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#Real_Elements */
|
|
|
|
|
2016-03-04 23:04:53 +00:00
|
|
|
namespace urde
|
2016-02-05 01:27:03 +00:00
|
|
|
{
|
|
|
|
|
2016-02-06 07:31:53 +00:00
|
|
|
class CREKeyframeEmitter : public CRealElement
|
|
|
|
{
|
|
|
|
u32 x4_percent;
|
|
|
|
u32 x8_unk1;
|
|
|
|
bool xc_loop;
|
|
|
|
bool xd_unk2;
|
|
|
|
u32 x10_loopEnd;
|
|
|
|
u32 x14_loopStart;
|
|
|
|
std::vector<float> x18_keys;
|
|
|
|
public:
|
|
|
|
CREKeyframeEmitter(CInputStream& in);
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
class CRELifetimeTween : public CRealElement
|
|
|
|
{
|
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
|
|
|
std::unique_ptr<CRealElement> x8_b;
|
|
|
|
public:
|
|
|
|
CRELifetimeTween(CRealElement* a, CRealElement* b)
|
|
|
|
: x4_a(a), x8_b(b) {}
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREConstant : public CRealElement
|
|
|
|
{
|
|
|
|
float x4_val;
|
|
|
|
public:
|
|
|
|
CREConstant(float val) : x4_val(val) {}
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
bool IsConstant() const {return true;}
|
|
|
|
};
|
|
|
|
|
|
|
|
class CRETimeChain : public CRealElement
|
|
|
|
{
|
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
|
|
|
std::unique_ptr<CRealElement> x8_b;
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CIntElement> xc_swFrame;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
|
|
|
CRETimeChain(CRealElement* a, CRealElement* b, CIntElement* c)
|
2016-02-06 00:34:40 +00:00
|
|
|
: x4_a(a), x8_b(b), xc_swFrame(c) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREAdd : public CRealElement
|
|
|
|
{
|
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
|
|
|
std::unique_ptr<CRealElement> x8_b;
|
|
|
|
public:
|
|
|
|
CREAdd(CRealElement* a, CRealElement* b)
|
|
|
|
: x4_a(a), x8_b(b) {}
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREClamp : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CRealElement> x4_min;
|
|
|
|
std::unique_ptr<CRealElement> x8_max;
|
|
|
|
std::unique_ptr<CRealElement> xc_val;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
|
|
|
CREClamp(CRealElement* a, CRealElement* b, CRealElement* c)
|
2016-02-06 00:34:40 +00:00
|
|
|
: x4_min(a), x8_max(b), xc_val(c) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREInitialRandom : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CRealElement> x4_min;
|
|
|
|
std::unique_ptr<CRealElement> x8_max;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CREInitialRandom(CRealElement* a, CRealElement* b)
|
|
|
|
: x4_min(a), x8_max(b) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
bool IsConstant() const {return true;}
|
|
|
|
};
|
|
|
|
|
|
|
|
class CRERandom : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CRealElement> x4_min;
|
|
|
|
std::unique_ptr<CRealElement> x8_max;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CRERandom(CRealElement* a, CRealElement* b)
|
|
|
|
: x4_min(a), x8_max(b) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
2016-02-12 06:06:17 +00:00
|
|
|
class CREDotProduct : public CRealElement
|
|
|
|
{
|
|
|
|
std::unique_ptr<CVectorElement> x4_a;
|
|
|
|
std::unique_ptr<CVectorElement> x8_b;
|
|
|
|
public:
|
|
|
|
CREDotProduct(CVectorElement* a, CVectorElement* b)
|
|
|
|
: x4_a(a), x8_b(b) {}
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
2016-02-05 08:34:14 +00:00
|
|
|
class CREMultiply : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
|
|
|
std::unique_ptr<CRealElement> x8_b;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CREMultiply(CRealElement* a, CRealElement* b)
|
|
|
|
: x4_a(a), x8_b(b) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREPulse : public CRealElement
|
|
|
|
{
|
2016-02-06 07:31:53 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_aDuration;
|
|
|
|
std::unique_ptr<CIntElement> x8_bDuration;
|
|
|
|
std::unique_ptr<CRealElement> xc_valA;
|
|
|
|
std::unique_ptr<CRealElement> x10_valB;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CREPulse(CIntElement* a, CIntElement* b, CRealElement* c, CRealElement* d)
|
2016-02-06 07:31:53 +00:00
|
|
|
: x4_aDuration(a), x8_bDuration(b), xc_valA(c), x10_valB(d) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CRETimeScale : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CRETimeScale(CRealElement* a)
|
|
|
|
: x4_a(a) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CRELifetimePercent : public CRealElement
|
|
|
|
{
|
2016-02-06 07:31:53 +00:00
|
|
|
std::unique_ptr<CRealElement> x4_percentVal;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CRELifetimePercent(CRealElement* a)
|
2016-02-06 07:31:53 +00:00
|
|
|
: x4_percentVal(a) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CRESineWave : public CRealElement
|
|
|
|
{
|
2016-02-06 07:31:53 +00:00
|
|
|
std::unique_ptr<CRealElement> x4_magnitude;
|
|
|
|
std::unique_ptr<CRealElement> x8_linearFrame;
|
|
|
|
std::unique_ptr<CRealElement> xc_constantFrame;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CRESineWave(CRealElement* a, CRealElement* b, CRealElement* c)
|
2016-02-06 07:31:53 +00:00
|
|
|
: x4_magnitude(a), x8_linearFrame(b), xc_constantFrame(c) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREISWT : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
|
|
|
std::unique_ptr<CRealElement> x8_b;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CREISWT(CRealElement* a, CRealElement* b)
|
|
|
|
: x4_a(a), x8_b(b) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CRECompareLessThan : public CRealElement
|
|
|
|
{
|
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
|
|
|
CRECompareLessThan(CRealElement* a, CRealElement* b, CRealElement* c, CRealElement* d)
|
|
|
|
: x4_a(a), x8_b(b), xc_c(c), x10_d(d) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CRECompareEquals : public CRealElement
|
|
|
|
{
|
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
|
|
|
CRECompareEquals(CRealElement* a, CRealElement* b, CRealElement* c, CRealElement* d)
|
|
|
|
: x4_a(a), x8_b(b), xc_c(c), x10_d(d) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREParticleAccessParam1 : public CRealElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREParticleAccessParam2 : public CRealElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREParticleAccessParam3 : public CRealElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREParticleAccessParam4 : public CRealElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREParticleAccessParam5 : public CRealElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREParticleAccessParam6 : public CRealElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREParticleAccessParam7 : public CRealElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREParticleAccessParam8 : public CRealElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREPSLL : public CRealElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREPRLW : public CRealElement
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CRESubtract : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CRealElement> x4_a;
|
|
|
|
std::unique_ptr<CRealElement> x8_b;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CRESubtract(CRealElement* a, CRealElement* b)
|
|
|
|
: x4_a(a), x8_b(b) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREVectorMagnitude : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CVectorElement> x4_a;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CREVectorMagnitude(CVectorElement* a)
|
|
|
|
: x4_a(a) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREVectorXToReal : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CVectorElement> x4_a;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CREVectorXToReal(CVectorElement* a)
|
|
|
|
: x4_a(a) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREVectorYToReal : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CVectorElement> x4_a;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CREVectorYToReal(CVectorElement* a)
|
|
|
|
: x4_a(a) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREVectorZToReal : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CVectorElement> x4_a;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CREVectorZToReal(CVectorElement* a)
|
|
|
|
: x4_a(a) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CRECEXT : public CRealElement
|
|
|
|
{
|
2016-02-06 00:34:40 +00:00
|
|
|
std::unique_ptr<CIntElement> x4_a;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-06 00:34:40 +00:00
|
|
|
CRECEXT(CIntElement* a)
|
|
|
|
: x4_a(a) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
2016-02-07 00:19:59 +00:00
|
|
|
class CREIntTimesReal : public CRealElement
|
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<CRealElement> x8_b;
|
2016-02-05 08:34:14 +00:00
|
|
|
public:
|
2016-02-07 00:19:59 +00:00
|
|
|
CREIntTimesReal(CIntElement* a, CRealElement* b)
|
2016-02-06 00:34:40 +00:00
|
|
|
: x4_a(a), x8_b(b) {}
|
2016-02-05 08:34:14 +00:00
|
|
|
bool GetValue(int frame, float& valOut) const;
|
2016-02-05 01:27:03 +00:00
|
|
|
};
|
|
|
|
|
2016-02-12 06:06:17 +00:00
|
|
|
class CREConstantRange : public CRealElement
|
|
|
|
{
|
|
|
|
std::unique_ptr<CRealElement> x4_val;
|
|
|
|
std::unique_ptr<CRealElement> x8_min;
|
|
|
|
std::unique_ptr<CRealElement> xc_max;
|
|
|
|
std::unique_ptr<CRealElement> x10_inRange;
|
|
|
|
std::unique_ptr<CRealElement> x14_outOfRange;
|
|
|
|
public:
|
|
|
|
CREConstantRange(CRealElement* a, CRealElement* b, CRealElement* c, CRealElement* d, CRealElement* e)
|
|
|
|
: x4_val(a), x8_min(b), xc_max(c), x10_inRange(d), x14_outOfRange(e) {}
|
|
|
|
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREGetComponentRed : public CRealElement
|
|
|
|
{
|
|
|
|
std::unique_ptr<CColorElement> x4_a;
|
|
|
|
public:
|
|
|
|
CREGetComponentRed(CColorElement* a)
|
|
|
|
: x4_a(a) {}
|
|
|
|
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREGetComponentGreen : public CRealElement
|
|
|
|
{
|
|
|
|
std::unique_ptr<CColorElement> x4_a;
|
|
|
|
public:
|
|
|
|
CREGetComponentGreen(CColorElement* a)
|
|
|
|
: x4_a(a) {}
|
|
|
|
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREGetComponentBlue : public CRealElement
|
|
|
|
{
|
|
|
|
std::unique_ptr<CColorElement> x4_a;
|
|
|
|
public:
|
|
|
|
CREGetComponentBlue(CColorElement* a)
|
|
|
|
: x4_a(a) {}
|
|
|
|
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class CREGetComponentAlpha : public CRealElement
|
|
|
|
{
|
|
|
|
std::unique_ptr<CColorElement> x4_a;
|
|
|
|
public:
|
|
|
|
CREGetComponentAlpha(CColorElement* a)
|
|
|
|
: x4_a(a) {}
|
|
|
|
|
|
|
|
bool GetValue(int frame, float& valOut) const;
|
|
|
|
};
|
2016-02-05 01:27:03 +00:00
|
|
|
}
|
|
|
|
|
2016-04-13 06:07:23 +00:00
|
|
|
#endif // __URDE_CREALELEMENT_HPP__
|