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
This commit is contained in:
hatal175
2023-08-01 00:17:21 -07:00
committed by GitHub
parent 396449b597
commit 2275eb710b
122 changed files with 1901 additions and 4402 deletions
+32 -5
View File
@@ -2,6 +2,7 @@
#define JAISOUND_H
#include "JSystem/JAudio2/JAISoundParams.h"
#include "JSystem/JAudio2/JAIAudible.h"
#include "JSystem/JGeometry.h"
#include "dolphin/types.h"
#include "global.h"
@@ -55,6 +56,9 @@ struct JAISoundStatus_ {
inline bool isMute() { return field_0x0.flags.mute; }
inline bool isPaused() { return field_0x0.flags.paused; }
void pauseWhenOut() {
field_0x1.flags.flag6 = 1;
}
/* 0x0 */ union {
u8 value;
@@ -115,10 +119,7 @@ struct JAISoundFader {
}
}
bool isOut() {
if (mTransition.mCount != 0 || mIntensity < 0.01f) {
return true;
}
return false;
return (mTransition.mCount == 0 && mIntensity < 0.01f);
}
inline void calc() { mIntensity = mTransition.apply(mIntensity); }
f32 getIntensity() { return mIntensity; }
@@ -227,7 +228,7 @@ public:
bool isStopping() {
bool isStopping = false;
if (status_.state.flags.flag1) {
isStopping = status_.state.flags.flag5 ? fader.isOut() : true;
isStopping = !status_.state.flags.flag5 || fader.isOut();
}
return isStopping;
}
@@ -236,6 +237,32 @@ public:
status_.field_0x0.flags.paused = param_0;
}
void updateLifeTime(u32 param_0) {
if (lifeTime < param_0) {
lifeTime = param_0;
}
}
void setLifeTime(u32 param_0, bool param_1) {
lifeTime = param_0;
setComesBack(param_1);
status_.field_0x1.flags.flag2 = 1;
}
void setComesBack(bool param_0) {
status_.field_0x1.flags.flag1 = 1;
if (param_0) {
status_.pauseWhenOut();
}
}
bool setPos(const JGeometry::TVec3<f32>& param_1) {
if (audible_ != NULL) {
audible_->setPos(param_1);
}
return audible_ != NULL;
}
/* 0x04 */ JAISoundHandle* handle_;
/* 0x08 */ JAIAudible* audible_;
/* 0x0C */ JAIAudience* audience_;