NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
snd_Sound3DManager.h
1#ifndef NW4R_SND_SOUND_3D_MANAGER_H
2#define NW4R_SND_SOUND_3D_MANAGER_H
3#include "nw4r/snd/snd_BasicSound.h"
4#include "nw4r/snd/snd_InstancePool.h"
5#include "nw4r/snd/snd_Sound3DEngine.h"
6#include "nw4r/snd/snd_SoundArchive.h"
7#include "nw4r/types_nw4r.h"
8#include "nw4r/ut/ut_LinkList.h"
9
10#include "nw4r/math.h"
11
12namespace nw4r {
13namespace snd {
14
15struct Sound3DParam {
16 /* 0x00 */ math::VEC3 position;
17 /* 0x0C */ math::VEC3 velocity;
18 /* 0x18 */ UNKWORD field_0x18;
19 /* 0x1C */ u8 decayCurve;
20 /* 0x1D */ u8 decayRatio;
21 /* 0x1E */ u8 field_0x1E;
22 /* 0x20 */ ulong userParam;
23 /* 0x24 */ UNKWORD field_0x24;
24
25 Sound3DParam();
26};
27
30public:
31 typedef ut::LinkList<Sound3DListener, 0x64> ListenerList;
32
33 Sound3DManager();
34
35 virtual void detail_UpdateAmbientParam(const void*, ulong, int, SoundAmbientParam*) override;
36 virtual int detail_GetAmbientPriority(const void*, ulong) override;
37 virtual int detail_GetRequiredVoiceOutCount(const void*, ulong) override;
38
39 virtual void *detail_AllocAmbientArg(ulong size) override;
40
41 virtual void detail_FreeAmbientArg(void *pArg,
42 const detail::BasicSound *pSound) override;
43
44 ulong GetRequiredMemSize(const SoundArchive *pArchive);
45 bool Setup(const SoundArchive *pArchive, void *pBuffer, ulong size);
46
47 const ListenerList &GetListenerList() const {
48 return mListenerList;
49 }
50
51 ListenerList &GetListenerList() {
52 return mListenerList;
53 }
54
55 int GetMaxPriorityReduction() const {
56 return mMaxPriorityReduction;
57 }
58 void SetMaxPriorityReduction(int max) {
59 mMaxPriorityReduction = max;
60 }
61
62 int GetBiquadFilterType() const {
63 return mBiquadFilterType;
64 }
65 void SetBiquadFilterType(int type);
66
67 f32 GetField0x20() const {
68 return field_0x20;
69 }
70
71 void SetField0x20(f32 value) {
72 field_0x20 = value;
73 }
74
75 f32 GetField0x24() const {
76 return field_0x24;
77 }
78
79 void SetField0x24(f32 value) {
80 field_0x24 = value;
81 }
82
83 void SetEngine(Sound3DEngine *engine);
84
85 enum ParamDecayCurve {
86 DECAY_CURVE_NONE,
87 DECAY_CURVE_LOGARITHMIC,
88 DECAY_CURVE_LINEAR,
89 };
90
91private:
92 detail::InstancePool<Sound3DParam> mParamPool; // at 0x8
93 ListenerList mListenerList; // at 0x0C
94 Sound3DEngine *mpEngine; // at 0x18
95 s32 mMaxPriorityReduction; // at 0x1C
96 f32 field_0x20; // at 0x20
97 f32 field_0x24; // at 0x24
98 int mBiquadFilterType; // at 0x28
99};
100
101} // namespace snd
102} // namespace nw4r
103
104#endif