diff options
| author | robojumper <robojumper@gmail.com> | 2025-04-27 07:13:47 +0200 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2025-04-27 07:13:47 +0200 |
| commit | c1a0264e6ac151f3a884bc32126de192eede19c7 (patch) | |
| tree | 1649757ae5c7b47b87f17ef69760b4a359a8d46d /src/JSystem/JParticle/JPAKeyBlock.cpp | |
| parent | 5df26c52fcc06e017f2cf525264d4f7563715e05 (diff) | |
Initial import of JParticle + JSUList from TP
Diffstat (limited to 'src/JSystem/JParticle/JPAKeyBlock.cpp')
| -rw-r--r-- | src/JSystem/JParticle/JPAKeyBlock.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/JSystem/JParticle/JPAKeyBlock.cpp b/src/JSystem/JParticle/JPAKeyBlock.cpp new file mode 100644 index 00000000..fdb1e8e6 --- /dev/null +++ b/src/JSystem/JParticle/JPAKeyBlock.cpp @@ -0,0 +1,25 @@ +// +// Generated By: dol2asm +// Translation Unit: JPAKeyBlock +// + +#include "JSystem/JParticle/JPAKeyBlock.h" +#include "JSystem/JParticle/JPAMath.h" + +/* 8027D730-8027D740 278070 0010+00 0/0 1/1 0/0 .text __ct__11JPAKeyBlockFPCUc */ +JPAKeyBlock::JPAKeyBlock(const u8* data) + : mDataStart(data) + , field_0x4(reinterpret_cast<const float*>(&data[0xC])) +{ +} + +/* 8027D740-8027D7D4 278080 0094+00 0/0 1/1 0/0 .text calc__11JPAKeyBlockFf */ +f32 JPAKeyBlock::calc(float p1) { + if (mDataStart[0xB] != '\0') { + int v1 = (int)field_0x4[(mDataStart[9] - 1) * 4] + 1; + // p1 -= (v1 * ((int)p1 / v1)); + int v2 = ((int)p1 / v1); + p1 = p1 - (v2 * v1); + } + return JPACalcKeyAnmValue(p1, mDataStart[9], field_0x4); +} |
