mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-04 12:35:52 +00:00
Add CIEDeath from MP2/3
This commit is contained in:
parent
073af40c4d
commit
2369083b50
@ -53,7 +53,7 @@ bool CIEKeyframeEmitter::GetValue([[maybe_unused]] int frame, int& valOut) const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIEKeyframeEmitter::GetMaxValue() const { return *std::max_element(x18_keys.cbegin(), x18_keys.cend()); }
|
// int CIEKeyframeEmitter::GetMaxValue() const { return *std::max_element(x18_keys.cbegin(), x18_keys.cend()); }
|
||||||
|
|
||||||
bool CIEDeath::GetValue(int frame, int& valOut) const {
|
bool CIEDeath::GetValue(int frame, int& valOut) const {
|
||||||
x4_a->GetValue(frame, valOut);
|
x4_a->GetValue(frame, valOut);
|
||||||
@ -63,7 +63,7 @@ bool CIEDeath::GetValue(int frame, int& valOut) const {
|
|||||||
return frame > b;
|
return frame > b;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIEDeath::GetMaxValue() const { return x4_a->GetMaxValue(); }
|
// int CIEDeath::GetMaxValue() const { return x4_a->GetMaxValue(); }
|
||||||
|
|
||||||
bool CIEClamp::GetValue(int frame, int& valOut) const {
|
bool CIEClamp::GetValue(int frame, int& valOut) const {
|
||||||
int a, b;
|
int a, b;
|
||||||
@ -74,7 +74,7 @@ bool CIEClamp::GetValue(int frame, int& valOut) const {
|
|||||||
valOut = std::clamp(valOut, a, b);
|
valOut = std::clamp(valOut, a, b);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
int CIEClamp::GetMaxValue() const {
|
int CIEClamp::GetMaxValue() const {
|
||||||
const int a = x4_min->GetMaxValue();
|
const int a = x4_min->GetMaxValue();
|
||||||
const int b = x8_max->GetMaxValue();
|
const int b = x8_max->GetMaxValue();
|
||||||
@ -82,6 +82,7 @@ int CIEClamp::GetMaxValue() const {
|
|||||||
|
|
||||||
return std::clamp(valOut, a, b);
|
return std::clamp(valOut, a, b);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bool CIETimeChain::GetValue(int frame, int& valOut) const {
|
bool CIETimeChain::GetValue(int frame, int& valOut) const {
|
||||||
int v;
|
int v;
|
||||||
@ -92,7 +93,7 @@ bool CIETimeChain::GetValue(int frame, int& valOut) const {
|
|||||||
return x4_a->GetValue(frame, valOut);
|
return x4_a->GetValue(frame, valOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIETimeChain::GetMaxValue() const { return std::max(x8_b->GetMaxValue(), x4_a->GetMaxValue()); }
|
// int CIETimeChain::GetMaxValue() const { return std::max(x8_b->GetMaxValue(), x4_a->GetMaxValue()); }
|
||||||
|
|
||||||
bool CIEAdd::GetValue(int frame, int& valOut) const {
|
bool CIEAdd::GetValue(int frame, int& valOut) const {
|
||||||
int a, b;
|
int a, b;
|
||||||
@ -102,18 +103,20 @@ bool CIEAdd::GetValue(int frame, int& valOut) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
int CIEAdd::GetMaxValue() const {
|
int CIEAdd::GetMaxValue() const {
|
||||||
const int a = x4_a->GetMaxValue();
|
const int a = x4_a->GetMaxValue();
|
||||||
const int b = x8_b->GetMaxValue();
|
const int b = x8_b->GetMaxValue();
|
||||||
return a + b;
|
return a + b;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bool CIEConstant::GetValue([[maybe_unused]] int frame, int& valOut) const {
|
bool CIEConstant::GetValue([[maybe_unused]] int frame, int& valOut) const {
|
||||||
valOut = x4_val;
|
valOut = x4_val;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIEConstant::GetMaxValue() const { return x4_val; }
|
// int CIEConstant::GetMaxValue() const { return x4_val; }
|
||||||
|
|
||||||
bool CIEImpulse::GetValue(int frame, int& valOut) const {
|
bool CIEImpulse::GetValue(int frame, int& valOut) const {
|
||||||
if (frame == 0)
|
if (frame == 0)
|
||||||
@ -123,7 +126,7 @@ bool CIEImpulse::GetValue(int frame, int& valOut) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIEImpulse::GetMaxValue() const { return x4_a->GetMaxValue(); }
|
// int CIEImpulse::GetMaxValue() const { return x4_a->GetMaxValue(); }
|
||||||
|
|
||||||
bool CIELifetimePercent::GetValue(int frame, int& valOut) const {
|
bool CIELifetimePercent::GetValue(int frame, int& valOut) const {
|
||||||
int a;
|
int a;
|
||||||
@ -133,12 +136,14 @@ bool CIELifetimePercent::GetValue(int frame, int& valOut) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
int CIELifetimePercent::GetMaxValue() const {
|
int CIELifetimePercent::GetMaxValue() const {
|
||||||
const int a = std::max(0, x4_percentVal->GetMaxValue());
|
const int a = std::max(0, x4_percentVal->GetMaxValue());
|
||||||
|
|
||||||
// Assume 10000 frames max (not ideal estimate)
|
// Assume 10000 frames max (not ideal estimate)
|
||||||
return int((float(a) / 100.0f) * 10000 + 0.5f);
|
return int((float(a) / 100.0f) * 10000 + 0.5f);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bool CIEInitialRandom::GetValue(int frame, int& valOut) const {
|
bool CIEInitialRandom::GetValue(int frame, int& valOut) const {
|
||||||
if (frame == 0) {
|
if (frame == 0) {
|
||||||
@ -150,7 +155,7 @@ bool CIEInitialRandom::GetValue(int frame, int& valOut) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIEInitialRandom::GetMaxValue() const { return x8_b->GetMaxValue(); }
|
// int CIEInitialRandom::GetMaxValue() const { return x8_b->GetMaxValue(); }
|
||||||
|
|
||||||
bool CIEPulse::GetValue(int frame, int& valOut) const {
|
bool CIEPulse::GetValue(int frame, int& valOut) const {
|
||||||
int a, b;
|
int a, b;
|
||||||
@ -169,7 +174,7 @@ bool CIEPulse::GetValue(int frame, int& valOut) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIEPulse::GetMaxValue() const { return std::max(xc_aVal->GetMaxValue(), x10_bVal->GetMaxValue()); }
|
// int CIEPulse::GetMaxValue() const { return std::max(xc_aVal->GetMaxValue(), x10_bVal->GetMaxValue()); }
|
||||||
|
|
||||||
bool CIEMultiply::GetValue(int frame, int& valOut) const {
|
bool CIEMultiply::GetValue(int frame, int& valOut) const {
|
||||||
int a, b;
|
int a, b;
|
||||||
@ -179,7 +184,16 @@ bool CIEMultiply::GetValue(int frame, int& valOut) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIEMultiply::GetMaxValue() const { return x4_a->GetMaxValue() * x8_b->GetMaxValue(); }
|
// int CIEMultiply::GetMaxValue() const { return x4_a->GetMaxValue() * x8_b->GetMaxValue(); }
|
||||||
|
|
||||||
|
bool CIEDivide::GetValue(s32 frame, s32& out) const {
|
||||||
|
int divisor = 0;
|
||||||
|
int dividend = 0;
|
||||||
|
x4_dividend->GetValue(frame, dividend);
|
||||||
|
x8_divisor->GetValue(frame, divisor);
|
||||||
|
out = divisor == 0 ? dividend : dividend / divisor;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool CIESampleAndHold::GetValue(int frame, int& valOut) const {
|
bool CIESampleAndHold::GetValue(int frame, int& valOut) const {
|
||||||
if (x8_nextSampleFrame < frame) {
|
if (x8_nextSampleFrame < frame) {
|
||||||
@ -195,7 +209,7 @@ bool CIESampleAndHold::GetValue(int frame, int& valOut) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIESampleAndHold::GetMaxValue() const { return x4_sampleSource->GetMaxValue(); }
|
// int CIESampleAndHold::GetMaxValue() const { return x4_sampleSource->GetMaxValue(); }
|
||||||
|
|
||||||
bool CIERandom::GetValue(int frame, int& valOut) const {
|
bool CIERandom::GetValue(int frame, int& valOut) const {
|
||||||
int a, b;
|
int a, b;
|
||||||
@ -207,13 +221,14 @@ bool CIERandom::GetValue(int frame, int& valOut) const {
|
|||||||
valOut = CRandom16::GetRandomNumber()->Next();
|
valOut = CRandom16::GetRandomNumber()->Next();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
int CIERandom::GetMaxValue() const {
|
int CIERandom::GetMaxValue() const {
|
||||||
if (x4_min->GetMaxValue() > 0)
|
if (x4_min->GetMaxValue() > 0)
|
||||||
return x8_max->GetMaxValue();
|
return x8_max->GetMaxValue();
|
||||||
else
|
else
|
||||||
return 65535;
|
return 65535;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bool CIETimeScale::GetValue(int frame, int& valOut) const {
|
bool CIETimeScale::GetValue(int frame, int& valOut) const {
|
||||||
float a;
|
float a;
|
||||||
@ -222,28 +237,28 @@ bool CIETimeScale::GetValue(int frame, int& valOut) const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIETimeScale::GetMaxValue() const { return 10000; /* Assume 10000 frames max (not ideal estimate) */ }
|
// int CIETimeScale::GetMaxValue() const { return 10000; /* Assume 10000 frames max (not ideal estimate) */ }
|
||||||
|
|
||||||
bool CIEGetCumulativeParticleCount::GetValue([[maybe_unused]] int frame, int& valOut) const {
|
bool CIEGetCumulativeParticleCount::GetValue([[maybe_unused]] int frame, int& valOut) const {
|
||||||
valOut = CParticleGlobals::instance()->m_currentParticleSystem->x4_system->GetCumulativeParticleCount();
|
valOut = CParticleGlobals::instance()->m_currentParticleSystem->x4_system->GetCumulativeParticleCount();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIEGetCumulativeParticleCount::GetMaxValue() const { return 256; }
|
// int CIEGetCumulativeParticleCount::GetMaxValue() const { return 256; }
|
||||||
|
|
||||||
bool CIEGetActiveParticleCount::GetValue([[maybe_unused]] int frame, int& valOut) const {
|
bool CIEGetActiveParticleCount::GetValue([[maybe_unused]] int frame, int& valOut) const {
|
||||||
valOut = CParticleGlobals::instance()->m_currentParticleSystem->x4_system->GetParticleCount();
|
valOut = CParticleGlobals::instance()->m_currentParticleSystem->x4_system->GetParticleCount();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIEGetActiveParticleCount::GetMaxValue() const { return 256; }
|
// int CIEGetActiveParticleCount::GetMaxValue() const { return 256; }
|
||||||
|
|
||||||
bool CIEGetEmitterTime::GetValue([[maybe_unused]] int frame, int& valOut) const {
|
bool CIEGetEmitterTime::GetValue([[maybe_unused]] int frame, int& valOut) const {
|
||||||
valOut = CParticleGlobals::instance()->m_currentParticleSystem->x4_system->GetEmitterTime();
|
valOut = CParticleGlobals::instance()->m_currentParticleSystem->x4_system->GetEmitterTime();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CIEGetEmitterTime::GetMaxValue() const { return 10000; /* Assume 10000 frames max (not ideal estimate) */ }
|
// int CIEGetEmitterTime::GetMaxValue() const { return 10000; /* Assume 10000 frames max (not ideal estimate) */ }
|
||||||
|
|
||||||
bool CIEModulo::GetValue(int frame, int& valOut) const {
|
bool CIEModulo::GetValue(int frame, int& valOut) const {
|
||||||
int a, b;
|
int a, b;
|
||||||
@ -255,7 +270,7 @@ bool CIEModulo::GetValue(int frame, int& valOut) const {
|
|||||||
valOut = a;
|
valOut = a;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
int CIEModulo::GetMaxValue() const {
|
int CIEModulo::GetMaxValue() const {
|
||||||
const int a = x4_a->GetMaxValue();
|
const int a = x4_a->GetMaxValue();
|
||||||
const int b = x8_b->GetMaxValue();
|
const int b = x8_b->GetMaxValue();
|
||||||
@ -266,6 +281,7 @@ int CIEModulo::GetMaxValue() const {
|
|||||||
|
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
bool CIESubtract::GetValue(int frame, int& valOut) const {
|
bool CIESubtract::GetValue(int frame, int& valOut) const {
|
||||||
int a, b;
|
int a, b;
|
||||||
@ -274,13 +290,13 @@ bool CIESubtract::GetValue(int frame, int& valOut) const {
|
|||||||
valOut = a - b;
|
valOut = a - b;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
int CIESubtract::GetMaxValue() const {
|
int CIESubtract::GetMaxValue() const {
|
||||||
const int a = x4_a->GetMaxValue();
|
const int a = x4_a->GetMaxValue();
|
||||||
const int b = x8_b->GetMaxValue();
|
const int b = x8_b->GetMaxValue();
|
||||||
return a - b;
|
return a - b;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
bool CIERealToInt::GetValue(int frame, int& valOut) const {
|
bool CIERealToInt::GetValue(int frame, int& valOut) const {
|
||||||
float a = 0.0f;
|
float a = 0.0f;
|
||||||
float b = 1.0f;
|
float b = 1.0f;
|
||||||
@ -291,10 +307,11 @@ bool CIERealToInt::GetValue(int frame, int& valOut) const {
|
|||||||
valOut = static_cast<int>(a * b);
|
valOut = static_cast<int>(a * b);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
int CIERealToInt::GetMaxValue() const {
|
int CIERealToInt::GetMaxValue() const {
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
} // namespace metaforce
|
} // namespace metaforce
|
||||||
|
@ -21,7 +21,7 @@ class CIEKeyframeEmitter : public CIntElement {
|
|||||||
public:
|
public:
|
||||||
explicit CIEKeyframeEmitter(CInputStream& in);
|
explicit CIEKeyframeEmitter(CInputStream& in);
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEDeath : public CIntElement {
|
class CIEDeath : public CIntElement {
|
||||||
@ -32,7 +32,7 @@ public:
|
|||||||
CIEDeath(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
CIEDeath(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
||||||
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEClamp : public CIntElement {
|
class CIEClamp : public CIntElement {
|
||||||
@ -44,7 +44,7 @@ public:
|
|||||||
CIEClamp(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b, std::unique_ptr<CIntElement>&& c)
|
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)) {}
|
: x4_min(std::move(a)), x8_max(std::move(b)), xc_val(std::move(c)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIETimeChain : public CIntElement {
|
class CIETimeChain : public CIntElement {
|
||||||
@ -56,7 +56,7 @@ public:
|
|||||||
CIETimeChain(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b, std::unique_ptr<CIntElement>&& c)
|
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)) {}
|
: x4_a(std::move(a)), x8_b(std::move(b)), xc_swFrame(std::move(c)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEAdd : public CIntElement {
|
class CIEAdd : public CIntElement {
|
||||||
@ -66,7 +66,7 @@ class CIEAdd : public CIntElement {
|
|||||||
public:
|
public:
|
||||||
CIEAdd(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b) : x4_a(std::move(a)), x8_b(std::move(b)) {}
|
CIEAdd(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b) : x4_a(std::move(a)), x8_b(std::move(b)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEConstant : public CIntElement {
|
class CIEConstant : public CIntElement {
|
||||||
@ -75,7 +75,7 @@ class CIEConstant : public CIntElement {
|
|||||||
public:
|
public:
|
||||||
explicit CIEConstant(int val) : x4_val(val) {}
|
explicit CIEConstant(int val) : x4_val(val) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEImpulse : public CIntElement {
|
class CIEImpulse : public CIntElement {
|
||||||
@ -84,7 +84,7 @@ class CIEImpulse : public CIntElement {
|
|||||||
public:
|
public:
|
||||||
explicit CIEImpulse(std::unique_ptr<CIntElement>&& a) : x4_a(std::move(a)) {}
|
explicit CIEImpulse(std::unique_ptr<CIntElement>&& a) : x4_a(std::move(a)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIELifetimePercent : public CIntElement {
|
class CIELifetimePercent : public CIntElement {
|
||||||
@ -93,7 +93,7 @@ class CIELifetimePercent : public CIntElement {
|
|||||||
public:
|
public:
|
||||||
explicit CIELifetimePercent(std::unique_ptr<CIntElement>&& a) : x4_percentVal(std::move(a)) {}
|
explicit CIELifetimePercent(std::unique_ptr<CIntElement>&& a) : x4_percentVal(std::move(a)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEInitialRandom : public CIntElement {
|
class CIEInitialRandom : public CIntElement {
|
||||||
@ -104,7 +104,7 @@ public:
|
|||||||
CIEInitialRandom(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
CIEInitialRandom(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
||||||
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEPulse : public CIntElement {
|
class CIEPulse : public CIntElement {
|
||||||
@ -118,7 +118,7 @@ public:
|
|||||||
std::unique_ptr<CIntElement>&& d)
|
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)) {}
|
: x4_aDuration(std::move(a)), x8_bDuration(std::move(b)), xc_aVal(std::move(c)), x10_bVal(std::move(d)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEMultiply : public CIntElement {
|
class CIEMultiply : public CIntElement {
|
||||||
@ -129,7 +129,19 @@ public:
|
|||||||
CIEMultiply(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
CIEMultiply(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
||||||
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
|
};
|
||||||
|
|
||||||
|
class CIEDivide : public CIntElement {
|
||||||
|
std::unique_ptr<CIntElement> x4_dividend;
|
||||||
|
std::unique_ptr<CIntElement> x8_divisor;
|
||||||
|
|
||||||
|
public:
|
||||||
|
CIEDivide(std::unique_ptr<CIntElement>&& dividend, std::unique_ptr<CIntElement>&& divisor)
|
||||||
|
: x4_dividend(std::move(dividend)), x8_divisor(std::move(divisor)) {}
|
||||||
|
|
||||||
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
|
// int GetMaxValue() const override { return 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIESampleAndHold : public CIntElement {
|
class CIESampleAndHold : public CIntElement {
|
||||||
@ -143,7 +155,7 @@ public:
|
|||||||
CIESampleAndHold(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b, std::unique_ptr<CIntElement>&& c)
|
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)) {}
|
: x4_sampleSource(std::move(a)), xc_waitFramesMin(std::move(b)), x10_waitFramesMax(std::move(c)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIERandom : public CIntElement {
|
class CIERandom : public CIntElement {
|
||||||
@ -154,7 +166,7 @@ public:
|
|||||||
CIERandom(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
CIERandom(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
||||||
: x4_min(std::move(a)), x8_max(std::move(b)) {}
|
: x4_min(std::move(a)), x8_max(std::move(b)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIETimeScale : public CIntElement {
|
class CIETimeScale : public CIntElement {
|
||||||
@ -163,25 +175,25 @@ class CIETimeScale : public CIntElement {
|
|||||||
public:
|
public:
|
||||||
explicit CIETimeScale(std::unique_ptr<CRealElement>&& a) : x4_a(std::move(a)) {}
|
explicit CIETimeScale(std::unique_ptr<CRealElement>&& a) : x4_a(std::move(a)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEGetCumulativeParticleCount : public CIntElement {
|
class CIEGetCumulativeParticleCount : public CIntElement {
|
||||||
public:
|
public:
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEGetActiveParticleCount : public CIntElement {
|
class CIEGetActiveParticleCount : public CIntElement {
|
||||||
public:
|
public:
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEGetEmitterTime : public CIntElement {
|
class CIEGetEmitterTime : public CIntElement {
|
||||||
public:
|
public:
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIEModulo : public CIntElement {
|
class CIEModulo : public CIntElement {
|
||||||
@ -192,7 +204,7 @@ public:
|
|||||||
CIEModulo(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
CIEModulo(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
||||||
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIESubtract : public CIntElement {
|
class CIESubtract : public CIntElement {
|
||||||
@ -203,7 +215,7 @@ public:
|
|||||||
CIESubtract(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
CIESubtract(std::unique_ptr<CIntElement>&& a, std::unique_ptr<CIntElement>&& b)
|
||||||
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
: x4_a(std::move(a)), x8_b(std::move(b)) {}
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CIERealToInt final : public CIntElement {
|
class CIERealToInt final : public CIntElement {
|
||||||
@ -215,7 +227,7 @@ public:
|
|||||||
: x4_a{std::move(a)}, x8_b{std::move(b)} {}
|
: x4_a{std::move(a)}, x8_b{std::move(b)} {}
|
||||||
|
|
||||||
bool GetValue(int frame, int& valOut) const override;
|
bool GetValue(int frame, int& valOut) const override;
|
||||||
int GetMaxValue() const override;
|
// int GetMaxValue() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace metaforce
|
} // namespace metaforce
|
||||||
|
@ -658,6 +658,11 @@ std::unique_ptr<CIntElement> CParticleDataFactory::GetIntElement(CInputStream& i
|
|||||||
auto b = GetIntElement(in);
|
auto b = GetIntElement(in);
|
||||||
return std::make_unique<CIEMultiply>(std::move(a), std::move(b));
|
return std::make_unique<CIEMultiply>(std::move(a), std::move(b));
|
||||||
}
|
}
|
||||||
|
case SBIG('DIVD'): {
|
||||||
|
auto a = GetIntElement(in);
|
||||||
|
auto b = GetIntElement(in);
|
||||||
|
return std::make_unique<CIEDivide>(std::move(a), std::move(b));
|
||||||
|
}
|
||||||
case SBIG('SPAH'): {
|
case SBIG('SPAH'): {
|
||||||
auto a = GetIntElement(in);
|
auto a = GetIntElement(in);
|
||||||
auto b = GetIntElement(in);
|
auto b = GetIntElement(in);
|
||||||
|
@ -24,7 +24,7 @@ public:
|
|||||||
class CIntElement : public IElement {
|
class CIntElement : public IElement {
|
||||||
public:
|
public:
|
||||||
virtual bool GetValue(int frame, int& valOut) const = 0;
|
virtual bool GetValue(int frame, int& valOut) const = 0;
|
||||||
virtual int GetMaxValue() const = 0;
|
// virtual int GetMaxValue() const = 0; Deprecated and unused
|
||||||
};
|
};
|
||||||
|
|
||||||
class CVectorElement : public IElement {
|
class CVectorElement : public IElement {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user