From 2275eb710b4b0794f198059a7fd61db7499941ff Mon Sep 17 00:00:00 2001 From: hatal175 Date: Tue, 1 Aug 2023 10:17:21 +0300 Subject: Work on J2DMaterialFactory (#394) * Work on J2DMaterialFactory * J3DUClipper OK * Work on JAISoundStarter * JAISoundHandles OK * JAISoundInfo OK * Fix JAISound::isStopping * Work on J2DTextBoxEx * dspproc OK * osdsp OK * osdsp_task OK * Work on dsptask * Import some JASCalc code * JASCallback OK * JASOscillator OK * JASLfo OK --- include/JSystem/JMath/JMATrigonometric.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/JSystem/JMath') diff --git a/include/JSystem/JMath/JMATrigonometric.h b/include/JSystem/JMath/JMATrigonometric.h index 8fd009944b..2b09c3939d 100644 --- a/include/JSystem/JMath/JMATrigonometric.h +++ b/include/JSystem/JMath/JMATrigonometric.h @@ -9,6 +9,13 @@ struct TSinCosTable { f32 sinShort(s16 v) const { return table[static_cast(v) >> 3].first; } f32 cosShort(s16 v) const { return table[static_cast(v) >> 3].second; } + + inline f32 sinLap(f32 v) { + if (v < 0.0f) { + return -table[(u16)(-8192.0f * v) & 0x1fff].first; + } + return table[(u16)(8192.0f * v) & 0x1fff].first; + } }; struct TAtanTable { @@ -41,4 +48,8 @@ inline f32 JMASSin(s16 v) { return JMASinShort(v); } +inline f32 JMASinLap(f32 v) { + return JMath::sincosTable_.sinLap(v); +} + #endif /* JMATRIGONOMETRIC_H */ -- cgit v1.2.3