mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-25 15:05:06 -04:00
4df8ccc871
* Reorganize files into libs/{dolphin,JSystem,PowerPC_EABI_Support,revolution,TRK_MINNOW_DOLPHIN}
* Update configure.py and project.py for new libs structure
* Refactor `#include <dolphin/x.h>` -> `<x.h>`
* Remove `__REVOLUTION_SDK__` forwards from dolphin
* Fix dolphin/ references in revolution
* Wrap `#include <dolphin.h>` in `!__REVOLUTION_SDK__`
* Always build TRK against dolphin headers
* Resolve revolution SDK header resolution issues
56 lines
932 B
C++
56 lines
932 B
C++
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
|
|
|
#include "JSystem/JAudio2/JASLfo.h"
|
|
#include "SSystem/SComponent/c_math.h"
|
|
|
|
|
|
JASLfo::JASLfo() {
|
|
field_0x0 = 0;
|
|
field_0x4 = 1;
|
|
field_0x8 = 0.0f;
|
|
mDepth = 0.0f;
|
|
mPitch = 1.0f;
|
|
mDelay = 0;
|
|
field_0x16 = 0;
|
|
}
|
|
|
|
|
|
f32 JASLfo::getValue() const {
|
|
if (field_0x16) {
|
|
return 0.0f;
|
|
}
|
|
|
|
if (mDepth == 0.0f) {
|
|
return 0.0f;
|
|
}
|
|
|
|
return mDepth * JMASinLap(field_0x8);
|
|
}
|
|
|
|
|
|
void JASLfo::incCounter(f32 param_0) {
|
|
if (field_0x16) {
|
|
field_0x16--;
|
|
return;
|
|
}
|
|
|
|
field_0x8 += param_0 * ((1.0f / 72.0f) * mPitch);
|
|
if (field_0x8 >= 1.0f) {
|
|
field_0x8 -= 1.0f;
|
|
}
|
|
}
|
|
|
|
JASLfo JASLfo::sFreeRunLfo;
|
|
|
|
void JASLfo::resetCounter() {
|
|
field_0x16 = mDelay;
|
|
switch (field_0x4) {
|
|
case 0:
|
|
field_0x8 = sFreeRunLfo.field_0x8;
|
|
break;
|
|
case 1:
|
|
field_0x8 = 0.0f;
|
|
break;
|
|
}
|
|
}
|