mirror of https://github.com/PrimeDecomp/prime.git
parent
8af6095198
commit
2b0a843ec8
|
@ -223,9 +223,7 @@ CRELifetimeTween::~CRELifetimeTween() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// fake but using it to test
|
// fake but using it to test
|
||||||
static inline float Lerp(float a, float b, float c) {
|
static inline float Lerp(float a, float b, float c) { return b * c + a * (1.f - c); }
|
||||||
return b * c + a * (1.f - c);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CRELifetimeTween::GetValue(int frame, float& valOut) const {
|
bool CRELifetimeTween::GetValue(int frame, float& valOut) const {
|
||||||
float ltFac = frame / CParticleGlobals::GetParticleLifetimeReal();
|
float ltFac = frame / CParticleGlobals::GetParticleLifetimeReal();
|
||||||
|
@ -264,15 +262,13 @@ bool CREKeyframeEmitter::GetValue(int frame, float& valOut) const {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ltPerc = CParticleGlobals::GetParticleLifetimePercentage();
|
if (CParticleGlobals::GetParticleLifetimePercentage() == 100) {
|
||||||
if (ltPerc == 100) {
|
valOut = x18_keys[CParticleGlobals::GetParticleLifetimePercentage()];
|
||||||
valOut = x18_keys[ltPerc];
|
|
||||||
} else {
|
} else {
|
||||||
float ltPercRem = CParticleGlobals::GetParticleLifetimePercentageRemainder();
|
valOut = (1.f - CParticleGlobals::GetParticleLifetimePercentageRemainder()) *
|
||||||
float key1 = x18_keys[ltPerc];
|
x18_keys[CParticleGlobals::GetParticleLifetimePercentage()] +
|
||||||
float key2 = x18_keys[ltPerc + 1];
|
CParticleGlobals::GetParticleLifetimePercentageRemainder() *
|
||||||
valOut = (1.f - ltPercRem) * key1 + ltPercRem * key2;
|
x18_keys[CParticleGlobals::GetParticleLifetimePercentage() + 1];
|
||||||
// valOut = Lerp(key1, key2, ltPercRem);
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue