refac: rename func_8030D90C to sfxsource_createSfxsourceAndReturnIndex and func_8030DBB4 to sfxsource_playSfxAtVolume

Additionally rename properties/variables assigned by sfxsource_createSfxsourceAndReturnIndex to sfxsourceIdx
This commit is contained in:
Bl00D4NGEL
2024-09-22 03:10:19 +02:00
parent fbe20325c2
commit 9bd6988f99
55 changed files with 297 additions and 297 deletions

View File

@@ -42,7 +42,7 @@ void chBeehive_update(Actor *this){
if(!this->volatile_initialized){
marker_setCollisionScripts(this->marker, NULL, NULL, chBeehive_die);
this->marker->propPtr->unk8_3 = 1;
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
this->volatile_initialized = TRUE;
this->unk38_0 = volatileFlag_get(VOLATILE_FLAG_1)| volatileFlag_get(VOLATILE_FLAG_1F_IN_CHARACTER_PARADE);
}//L802CE960
@@ -77,7 +77,7 @@ void chBeehive_update(Actor *this){
func_8030E394(this->unk44_31);
sfxsource_setSfxId(this->unk44_31, SFX_67_BEEHIVE_CLONK);
sfxsource_setSampleRate(this->unk44_31, 12000);
func_8030DBB4(this->unk44_31, (animctrl_getAnimTimer(this->animctrl) + 0.9) - 0.4);
sfxsource_playSfxAtVolume(this->unk44_31, (animctrl_getAnimTimer(this->animctrl) + 0.9) - 0.4);
sfxsource_set_position(this->unk44_31, this->position);
sfxsource_set_fade_distances(this->unk44_31, 300.0f, 1500.0f);
func_8030DD14(this->unk44_31, 3);

View File

@@ -236,12 +236,12 @@ void func_802C6240(Actor *this){
this->unk28 += 5.7;
tmp_a0 = this->unk44_31;
if(this->unk44_31 == 0){
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
tmp_a0 = this->unk44_31;
}
sfxsource_setSfxId(tmp_a0, SFX_18_BIGBUTT_SLIDE);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, (randf()*0.1 - 0.05) + 1.0);
sfxsource_playSfxAtVolume(this->unk44_31, (randf()*0.1 - 0.05) + 1.0);
func_8030E2C4(this->unk44_31);
}
else{//L802C69FC

View File

@@ -68,7 +68,7 @@ void chfirefx_update(Actor *this){
if(this->unkF4_8 != 0x32){
this->unk1C[0] = 1.0f;
this->unk44_31 = func_8030ED2C(SFX_128_FIRE_CRACKING, 2);
func_8030DBB4(this->unk44_31, 1.1f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.1f);
}
else{
this->unk1C[0] = 0.0f;

View File

@@ -211,7 +211,7 @@ void func_8035F138(Actor *this) {
if (this->unk1C[1] < 1.9) {
this->unk1C[1] += 0.1;
}
func_8030DBB4(this->unk44_31, this->unk1C[1]);
sfxsource_playSfxAtVolume(this->unk44_31, this->unk1C[1]);
if (actor_animationIsAt(this, 0.66f)) {
FUNC_8030E8B4(SFX_F9_GRUNTLING_NOISE_1, 0.8f, 32000, this->position, 1750, 3500);
@@ -272,7 +272,7 @@ void func_8035F138(Actor *this) {
if (this->unk1C[1] > 1.0) {
this->unk1C[1] -= 0.1;
}
func_8030DBB4(this->unk44_31, this->unk1C[1]);
sfxsource_playSfxAtVolume(this->unk44_31, this->unk1C[1]);
}
if (animctrl_getAnimTimer(this->animctrl) <= 0.02) {
subaddie_set_state_with_direction(this, 1, 0.02f, 1);

View File

@@ -128,10 +128,10 @@ void func_802D9530(Actor *this){
}
subaddie_set_state_with_direction(this, 4, 0.0001f, 1);
actor_playAnimationOnce(this);
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, SFX_3F9_UNKNOWN);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.4f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.4f);
sfxsource_setSampleRate(this->unk44_31, 26000);
func_8028F918(0);
}
@@ -255,10 +255,10 @@ void func_802D9ADC(Actor *this){
animctrl_setSmoothTransition(this->animctrl, TRUE);
subaddie_set_state_with_direction(this, 2, 0.0001f, 1);
actor_playAnimationOnce(this);
this->unk44_31 = func_8030D90C();
this->unk44_31 = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(this->unk44_31, SFX_3F9_UNKNOWN);
func_8030DD14(this->unk44_31, 2);
func_8030DBB4(this->unk44_31, 1.4f);
sfxsource_playSfxAtVolume(this->unk44_31, 1.4f);
sfxsource_setSampleRate(this->unk44_31, 26000);
chmole_setStaticCamera(this);
func_8028F94C(2, this->position);

View File

@@ -9,12 +9,12 @@ typedef struct{
s16 unk4;
s16 unk6;
s32 unk8;
f32 unkC;
f32 unkC; // volume for sfxsource
f32 unk10;
}struct49570s;
typedef struct{
u8 unk0;
u8 sfxsourceIdx;
}ActorLocal_Core2_49570;
/* .data */
@@ -36,9 +36,9 @@ void func_802D0500(Actor *this){
ActorLocal_Core2_49570 *local = (ActorLocal_Core2_49570 *)this->local;
if(D_80367340[(s32)this->yaw].unk8 != -1){
if(this->unk1C[0] == this->unk1C[1])
sfxsource_setSampleRate(local->unk0, D_80367340[(s32)this->yaw].unk8);
sfxsource_setSampleRate(local->sfxsourceIdx, D_80367340[(s32)this->yaw].unk8);
else{
sfxsource_setSampleRate(local->unk0, (s32)((D_80367340[(s32)this->yaw].unk8/this->unk1C[1])*this->unk1C[0]));
sfxsource_setSampleRate(local->sfxsourceIdx, (s32)((D_80367340[(s32)this->yaw].unk8/this->unk1C[1])*this->unk1C[0]));
}
}
@@ -46,9 +46,9 @@ void func_802D0500(Actor *this){
void func_802D05A0(Actor *this, s32 next_state){
ActorLocal_Core2_49570 *local = (ActorLocal_Core2_49570 *)this->local;
if(this->state == 2 && local->unk0){
func_8030DA44(local->unk0);
local->unk0 = 0;
if(this->state == 2 && local->sfxsourceIdx){
func_8030DA44(local->sfxsourceIdx);
local->sfxsourceIdx = 0;
}
if(next_state == 2){
this->unk1C[0] = 0.0f;
@@ -56,17 +56,17 @@ void func_802D05A0(Actor *this, s32 next_state){
if(-1.0f != D_80367340[(s32)this->yaw].unk10){
this->unk1C[1] = D_80367340[(s32)this->yaw].unk10;
}
local->unk0 = func_8030D90C();
sfxsource_setSfxId(local->unk0, D_80367340[(s32)this->yaw].unk0);
func_8030DD14(local->unk0, 3);
func_8030DFF0(local->unk0, 1);
sfxsource_set_position(local->unk0, this->position);
sfxsource_set_fade_distances(local->unk0, D_80367340[(s32)this->yaw].unk4*this->scale, D_80367340[(s32)this->yaw].unk6*this->scale);
func_8030DFB4(local->unk0, 1);
local->sfxsourceIdx = sfxsource_createSfxsourceAndReturnIndex();
sfxsource_setSfxId(local->sfxsourceIdx, D_80367340[(s32)this->yaw].unk0);
func_8030DD14(local->sfxsourceIdx, 3);
func_8030DFF0(local->sfxsourceIdx, 1);
sfxsource_set_position(local->sfxsourceIdx, this->position);
sfxsource_set_fade_distances(local->sfxsourceIdx, D_80367340[(s32)this->yaw].unk4*this->scale, D_80367340[(s32)this->yaw].unk6*this->scale);
func_8030DFB4(local->sfxsourceIdx, 1);
func_802D0500(this);
if(-1.0f != D_80367340[(s32)this->yaw].unkC)
func_8030DBB4(local->unk0, D_80367340[(s32)this->yaw].unkC);
func_8030E2C4(local->unk0);
sfxsource_playSfxAtVolume(local->sfxsourceIdx, D_80367340[(s32)this->yaw].unkC);
func_8030E2C4(local->sfxsourceIdx);
}//L802D0780
this->state = next_state;
}