2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 07:47:42 +00:00

Particle/C*EPulse: Fix implementations

This commit is contained in:
2020-04-12 05:31:00 -04:00
parent 3c9fef492a
commit 5e748a0d7f
5 changed files with 42 additions and 45 deletions

View File

@@ -137,17 +137,18 @@ bool CREPulse::GetValue(int frame, float& valOut) const {
int a, b;
x4_aDuration->GetValue(frame, a);
x8_bDuration->GetValue(frame, b);
int cv = std::max(1, a + b + 1);
int cv = a + b + 1;
if (cv < 0) {
cv = 1;
}
if (b >= 1) {
int cv2 = frame % cv;
if (cv2 >= a)
x10_valB->GetValue(frame, valOut);
else
xc_valA->GetValue(frame, valOut);
} else
// CREPulse is an outlier here, the other
// IElement classes use <= instead of <.
if (b < 1 || frame % cv < a) {
xc_valA->GetValue(frame, valOut);
} else {
x10_valB->GetValue(frame, valOut);
}
return false;
}