NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_audio.hpp
Go to the documentation of this file.
1#pragma once
3#include <game/mLib/m_vec.hpp>
4#include <nw4r/snd.h>
5#include <nw4r/math.h>
6
7/// @file
8
9/// @ingroup bases
10
12 u32 mNumHandles;
13 u32 mRemotePlayer;
14 void * mSnd2DCalc; // TODO: Snd2DCalc *
15 u32 mObjType;
16};
17
18template<int T>
20public:
21 virtual void startSound(unsigned long, const nw4r::math::VEC2 &, unsigned long);
22};
23
24class SndObjctCmnEmy : public NMSndObject<4> {
25public:
26 virtual void startSound(unsigned long, const nw4r::math::VEC2 &, unsigned long);
27};
28
29class SndObjctCmnMap : public NMSndObject<4> {
30public:
31 virtual void startSound(unsigned long, const nw4r::math::VEC2 &, unsigned long);
32};
33
34namespace dAudio {
35 void requestStartScene(ProfileName sceneProf); ///< Sets up game audio for the given scene.
36 void prepareSceneSnd(); ///< @unofficial
37 void destroySceneSnd(); ///< @unofficial
38 void setNextScene(ProfileName prof, unsigned long bgmIndex);
39 void pauseOffGameWithReset(); ///< @unofficial
40 void boot();
41 void loadSceneSnd();
42 bool isLoadedSceneSnd();
43 void FUN_8006a6a0(bool); ///< @unofficial
44
45 int getRemotePlayer(int);
46 mVec2_c cvtSndObjctPos(const mVec2_c &);
47 mVec2_c cvtSndObjctPos(const mVec3_c &);
48
50 public:
51 void startSound(unsigned long soundID, const nw4r::math::VEC2 &pos, int remPlayer) {
52 SndObjctCmnEmy::startSound(soundID, pos, remPlayer);
53 }
54 void startSound(unsigned long soundID, const mVec3_c &pos, int remPlayer) {
55 SndObjctCmnEmy::startSound(soundID, dAudio::cvtSndObjctPos(pos), remPlayer);
56 }
57 };
58
60 public:
61 void startSound(unsigned long soundID, const nw4r::math::VEC2 &pos, int remPlayer) {
62 SndObjctCmnMap::startSound(soundID, pos, remPlayer);
63 }
64 void startSound(unsigned long soundID, const mVec3_c &pos, int remPlayer) {
65 SndObjctCmnMap::startSound(soundID, dAudio::cvtSndObjctPos(pos), remPlayer);
66 }
67 };
68
69 extern SndObjctCmnEmy_c *g_pSndObjEmy;
70 extern SndObjctCmnMap_c *g_pSndObjMap;
71
72 /// @unofficial
73 class SoundEffectID_t {
74 public:
75 SoundEffectID_t(u32 soundID) : id(soundID) {}
76
77 operator u32() const {
78 return id;
79 }
80
81 template<class T>
82 void playObjSound(T *obj, const mVec2_c &pos, int playerNo) const {
83 obj->startSound(id, dAudio::cvtSndObjctPos(pos), playerNo);
84 }
85
86 template<class T>
87 void playObjSound(T *obj, const mVec3_c &pos, int playerNo) const {
88 obj->startSound(id, dAudio::cvtSndObjctPos(pos), playerNo);
89 }
90
91 void playEmySound(const mVec2_c &pos, int playerNo) const {
92 playObjSound(dAudio::g_pSndObjEmy, pos, playerNo);
93 }
94
95 void playEmySound(const mVec3_c &pos, int playerNo) const {
96 playObjSound(dAudio::g_pSndObjEmy, pos, playerNo);
97 }
98
99 void playMapSound(const mVec2_c &pos, int playerNo) const {
100 playObjSound(dAudio::g_pSndObjMap, pos, playerNo);
101 }
102
103 void playMapSound(const mVec3_c &pos, int playerNo) const {
104 playObjSound(dAudio::g_pSndObjMap, pos, playerNo);
105 }
106
107 private:
108 u32 id;
109 };
110};
A two-dimensional floating point vector.
Definition m_vec.hpp:9
A three-dimensional floating point vector.
Definition m_vec.hpp:100
void requestStartScene(ProfileName sceneProf)
Sets up game audio for the given scene.
void destroySceneSnd()
void prepareSceneSnd()
void FUN_8006a6a0(bool)
void pauseOffGameWithReset()
u16 ProfileName
The name of a profile. Value is a fProfile::PROFILE_NAME_e.
Definition f_profile.hpp:32