keyframe emitter member names

This commit is contained in:
Jack Andersen 2016-02-04 23:52:20 -10:00
parent 0947f60214
commit d782a698bb
2 changed files with 17 additions and 19 deletions

View File

@ -8,10 +8,10 @@ CREKeyframeEmitter::CREKeyframeEmitter(CInputStream& in)
{ {
x4_percent = in.readUint32Big(); x4_percent = in.readUint32Big();
x8_a = in.readUint32Big(); x8_a = in.readUint32Big();
xc_b = in.readBool(); xc_loop = in.readBool();
xd_c = in.readBool(); xd_c = in.readBool();
x10_d = in.readUint32Big(); x10_loopEnd = in.readUint32Big();
x14_e = in.readUint32Big(); x14_loopStart = in.readUint32Big();
u32 count = in.readUint32Big(); u32 count = in.readUint32Big();
x18_keys.reserve(count); x18_keys.reserve(count);
@ -25,24 +25,22 @@ bool CREKeyframeEmitter::GetValue(int frame, float& valOut) const
{ {
int emitterTime = CParticleGlobals::g_emitterTimeInt; int emitterTime = CParticleGlobals::g_emitterTimeInt;
int calcKey = emitterTime; int calcKey = emitterTime;
if (xc_b) if (xc_loop)
{ {
if (emitterTime >= x10_d) if (emitterTime >= x10_loopEnd)
{ {
int v1 = emitterTime - x14_e; int v1 = emitterTime - x14_loopStart;
int v2 = x10_d - x14_e; int v2 = x10_loopEnd - x14_loopStart;
calcKey = v1 / v2; calcKey = v1 % v2;
calcKey *= v2; calcKey += x14_loopStart;
calcKey = v1 - calcKey;
calcKey += x14_e;
} }
valOut = x18_keys[calcKey]; valOut = x18_keys[calcKey];
} }
else else
{ {
int x10_d_m1 = x10_d - 1; int v1 = x10_loopEnd - 1;
if (x10_d_m1 < calcKey) if (v1 < emitterTime)
calcKey = x10_d_m1; calcKey = v1;
valOut = x18_keys[calcKey]; valOut = x18_keys[calcKey];
} }
} }

View File

@ -60,11 +60,11 @@ public:
class CREKeyframeEmitter : public CRealElement class CREKeyframeEmitter : public CRealElement
{ {
u32 x4_percent; u32 x4_percent;
u32 x8_a; u32 x8_unk1;
bool xc_b; bool xc_loop;
bool xd_c; bool xd_unk2;
u32 x10_d; u32 x10_loopEnd;
u32 x14_e; u32 x14_loopStart;
std::vector<float> x18_keys; std::vector<float> x18_keys;
public: public:
CREKeyframeEmitter(CInputStream& in); CREKeyframeEmitter(CInputStream& in);