Minor CSfxManager fixes and renames

This commit is contained in:
Phillip Stephens 2024-10-12 19:29:07 -07:00
parent 8768673d18
commit 5b5c114bb6
7 changed files with 20 additions and 18 deletions

View File

@ -12744,8 +12744,8 @@ __ct<Q24rstl36vector<s,Q24rstl17rmemory_allocator>>__16CFactoryFnReturnFPQ24rstl
__dt__71TObjOwnerDerivedFromIObj<Q24rstl36vector<s,Q24rstl17rmemory_allocator>>Fv = .text:0x802E7ACC; // type:function size:0xDC scope:global
GetIObjObjectFor__53TToken<Q24rstl36vector<s,Q24rstl17rmemory_allocator>>FRCQ24rstl55auto_ptr<Q24rstl36vector<s,Q24rstl17rmemory_allocator>> = .text:0x802E7BA8; // type:function size:0x2C scope:global
GetNewDerivedObject__71TObjOwnerDerivedFromIObj<Q24rstl36vector<s,Q24rstl17rmemory_allocator>>FRCQ24rstl55auto_ptr<Q24rstl36vector<s,Q24rstl17rmemory_allocator>> = .text:0x802E7BD4; // type:function size:0x9C scope:global
DisableAuxCallback__11CSfxManagerFv = .text:0x802E7C70; // type:function size:0xB8 scope:global
EnableAuxCallback__11CSfxManagerFv = .text:0x802E7D28; // type:function size:0x33C scope:global
DisableAuxCallbacks__11CSfxManagerFv = .text:0x802E7C70; // type:function size:0xB8 scope:global
EnableAuxCallbacks__11CSfxManagerFv = .text:0x802E7D28; // type:function size:0x33C scope:global
PrepareDelayCallback__11CSfxManagerFRC13SND_AUX_DELAY = .text:0x802E8064; // type:function size:0x110 scope:global
PrepareReverbStdCallback__11CSfxManagerFRC17SND_AUX_REVERBSTD = .text:0x802E8174; // type:function size:0xB4 scope:global
PrepareChorusCallback__11CSfxManagerFRC14SND_AUX_CHORUS = .text:0x802E8228; // type:function size:0x94 scope:global
@ -21852,11 +21852,11 @@ lbl_805A92B0 = .sbss:0x805A92B0; // type:object size:0x1 data:byte
lbl_805A92B4 = .sbss:0x805A92B4; // type:object size:0x1 data:byte
mRefCount__10CSfxHandle = .sbss:0x805A92B8; // type:object size:0x4 scope:global data:4byte
mCurrentChannel__11CSfxManager = .sbss:0x805A92C0; // type:object size:0x4 data:4byte
lbl_805A92C4 = .sbss:0x805A92C4; // type:object size:0x1 data:byte
mDoUpdate__11CSfxManager = .sbss:0x805A92C4; // type:object size:0x1 data:byte
mTranslationTable__11CSfxManager = .sbss:0x805A92C8; // type:object size:0x4 data:4byte
lbl_805A92CC = .sbss:0x805A92CC; // type:object size:0x1 data:byte
mMuted__11CSfxManager = .sbss:0x805A92CC; // type:object size:0x1 data:byte
mTranslationTableTok__11CSfxManager = .sbss:0x805A92D0; // type:object size:0x8 data:byte
lbl_805A92D8 = .sbss:0x805A92D8; // type:object size:0x8 data:byte
mAuxProcessingEnabled__11CSfxManager = .sbss:0x805A92D8; // type:object size:0x8 data:byte
lbl_805A92E0 = .sbss:0x805A92E0; // type:object size:0x1 data:byte
lbl_805A92E4 = .sbss:0x805A92E4; // type:object size:0x1 data:byte
lbl_805A92E8 = .sbss:0x805A92E8; // type:object size:0x1 data:byte

View File

@ -12759,8 +12759,8 @@ __ct<Q24rstl36vector<s,Q24rstl17rmemory_allocator>>__16CFactoryFnReturnFPQ24rstl
__dt__71TObjOwnerDerivedFromIObj<Q24rstl36vector<s,Q24rstl17rmemory_allocator>>Fv = .text:0x802E7BAC; // type:function size:0xDC scope:global
GetIObjObjectFor__53TToken<Q24rstl36vector<s,Q24rstl17rmemory_allocator>>FRCQ24rstl55auto_ptr<Q24rstl36vector<s,Q24rstl17rmemory_allocator>> = .text:0x802E7C88; // type:function size:0x2C scope:global
GetNewDerivedObject__71TObjOwnerDerivedFromIObj<Q24rstl36vector<s,Q24rstl17rmemory_allocator>>FRCQ24rstl55auto_ptr<Q24rstl36vector<s,Q24rstl17rmemory_allocator>> = .text:0x802E7CB4; // type:function size:0x9C scope:global
DisableAuxCallback__11CSfxManagerFv = .text:0x802E7D50; // type:function size:0xB8 scope:global
EnableAuxCallback__11CSfxManagerFv = .text:0x802E7E08; // type:function size:0x33C scope:global
DisableAuxCallbacks__11CSfxManagerFv = .text:0x802E7D50; // type:function size:0xB8 scope:global
EnableAuxCallbacks__11CSfxManagerFv = .text:0x802E7E08; // type:function size:0x33C scope:global
PrepareDelayCallback__11CSfxManagerFRC13SND_AUX_DELAY = .text:0x802E8144; // type:function size:0x110 scope:global
PrepareReverbStdCallback__11CSfxManagerFRC17SND_AUX_REVERBSTD = .text:0x802E8254; // type:function size:0xB4 scope:global
PrepareChorusCallback__11CSfxManagerFRC14SND_AUX_CHORUS = .text:0x802E8308; // type:function size:0x94 scope:global
@ -21892,11 +21892,11 @@ lbl_805A92B0 = .sbss:0x805A9490; // type:object size:0x1 scope:global data:byte
lbl_805A92B4 = .sbss:0x805A9494; // type:object size:0x1 scope:global data:byte
mRefCount__10CSfxHandle = .sbss:0x805A9498; // type:object size:0x4 scope:global data:4byte
mCurrentChannel__11CSfxManager = .sbss:0x805A94A0; // type:object size:0x4 scope:global data:4byte
lbl_805A92C4 = .sbss:0x805A94A4; // type:object size:0x1 scope:global data:byte
mDoUpdate__11CSfxManager = .sbss:0x805A94A4; // type:object size:0x1 scope:global data:byte
mTranslationTable__11CSfxManager = .sbss:0x805A94A8; // type:object size:0x4 scope:global data:4byte
lbl_805A92CC = .sbss:0x805A94AC; // type:object size:0x1 scope:global data:byte
mMuted__11CSfxManager = .sbss:0x805A94AC; // type:object size:0x1 scope:global data:byte
mTranslationTableTok__11CSfxManager = .sbss:0x805A94B0; // type:object size:0x8 scope:global data:byte
lbl_805A92D8 = .sbss:0x805A94B8; // type:object size:0x8 scope:global data:byte
mAuxProcessingEnabled__11CSfxManager = .sbss:0x805A94B8; // type:object size:0x8 scope:global data:byte
lbl_805A92E0 = .sbss:0x805A94C0; // type:object size:0x1 scope:global data:byte
lbl_805A92E4 = .sbss:0x805A94C4; // type:object size:0x1 scope:global data:byte
lbl_805A92E8 = .sbss:0x805A94C8; // type:object size:0x1 scope:global data:byte

View File

@ -84,7 +84,7 @@ public:
static void SfxCtrl(SND_VOICEID handle, uchar ctrl, uchar val);
static SND_VOICEID SfxCheck(SND_VOICEID handle);
static void SfxVolume(SND_VOICEID handle, u8 vol);
static uint S3dAddEmitterParaEx(const C3DEmitterParmData& params, short handle,
static uint S3dAddEmitterParaEx(const C3DEmitterParmData& params, ushort handle,
SND_PARAMETER_INFO* paraInfo);
static void S3dUpdateEmitter(uint, const CVector3f&, const CVector3f&, uchar);
static void S3dRemoveEmitter(uint handle);

View File

@ -8,7 +8,7 @@ public:
CSfxHandle() : mID(0) {}
CSfxHandle(uint value);
int GetIndex() const { return mID & 0xFFF; }
int GetIndex() const { return mID & 0xFF; }
static CSfxHandle NullHandle() { return CSfxHandle(); }
void operator=(const CSfxHandle& other) { mID = other.mID; }
const bool operator==(const CSfxHandle& other) const { return mID == other.mID; }

View File

@ -226,8 +226,8 @@ public:
static void TurnOffChannel(ESfxChannels);
static const bool IsAuxProcessingEnabled();
static void DisableAuxCallback();
static void EnableAuxCallback();
static void DisableAuxCallbacks();
static void EnableAuxCallbacks();
static void PrepareDelayCallback(const SND_AUX_DELAY& info);
static void PrepareReverbStdCallback(const SND_AUX_REVERBSTD& info);
static void PrepareChorusCallback(const SND_AUX_CHORUS& info);

View File

@ -68,7 +68,7 @@ inline int FtoL(float in) { return static_cast< int >(in); }
inline float LtoF(int in) { return static_cast< float >(in); }
inline float ToReal32(int in) { return static_cast< float >(in); }
inline int ToInt32(float in) { return static_cast< int >(in); }
inline unsigned short ToUint16(unsigned short in) { return static_cast< short >(in); }
inline unsigned short ToUint16(short in) { return static_cast<unsigned short >(in); }
inline char ToChar(int c) { return ToUint8(c); }
} // namespace CCast

View File

@ -1,6 +1,7 @@
#include "Kyoto/Alloc/CMemory.hpp"
#include "Kyoto/Audio/CAudioSys.hpp"
#include "Kyoto/Audio/CSfxHandle.hpp"
#include "Kyoto/Basics/CCast.hpp"
#include "dolphin/types.h"
#include "musyx/musyx.h"
#include "rstl/vector.hpp"
@ -180,7 +181,8 @@ void CSfxManager::CSfxWrapper::Play() {
x1c_voiceHandle = CAudioSys::SfxStart(x18_sfxId, x20_vol, x22_pan, 0);
if (x1c_voiceHandle != SND_ID_ERROR) {
if (CSfxManager::IsAuxProcessingEnabled() && UseAcoustics()) {
CAudioSys::SfxCtrl(x1c_voiceHandle, SND_MIDICTRL_REVERB, CSfxManager::GetReverbAmount());
int reverb = CSfxManager::GetReverbAmount();
CAudioSys::SfxCtrl(x1c_voiceHandle, SND_MIDICTRL_REVERB, reverb);
}
SetPlaying(true);
@ -223,7 +225,7 @@ void CSfxManager::Shutdown() {
StopAndRemoveAllEmitters();
if (lbl_805A8770 != -1) {
DisableAuxCallback();
DisableAuxCallbacks();
}
}
@ -340,7 +342,7 @@ ushort CSfxManager::TranslateSFXID(ushort id) {
if (ret < 0) {
return -1;
}
return ret;
return CCast::ToUint16(ret);
}
#pragma inline_max_size(250)
CFactoryFnReturn FAudioTranslationTableFactory(const SObjectTag& obj, CInputStream& in,