36class NMSndObject :
public NMSndObjectBase {
40 SoundHandlePrm() : m_04(1.0f) {}
46 NMSndObjectBase(NMSndObjectBase::OBJ_TYPE_0,
SndAudioMgr::sInstance->mArcPlayer),
47 m_64(1.0f), m_68(0), m_6c(1.0f), m_70(0.0f)
49 SetPlayableSoundCount(0, T);
54 void processParams() {
55 for (
int idx = 0; idx < mTotalCount; idx++) {
56 if (!mParams[idx].IsAttachedSound()) {
59 u32 flag = SndAudioMgr::sInstance->get3DCtrlFlag(mParams[idx].GetId());
61 mParams[idx].SetVolume(m_64, 0);
63 SndSceneMgr::sInstance->m_14 == 3 ||
64 (SndSceneMgr::sInstance->m_14 == 2 && SndSceneMgr::sInstance->m_10 == 3)
66 mParams[idx].SetVolume(m_64, 0);
69 nw4r::snd::SoundArchive::SoundInfo info;
70 SndAudioMgr::sInstance->mpSndArc->ReadSoundInfo(mParams[idx].GetId(), &info);
72 mParams[idx].SetPlayerPriority(info.playerPriority + m_68);
74 mParams[idx].SetPlayerPriority(info.playerPriority);
78 mParams[idx].SetPan(m_70);
84 for (
int i = 0; i < T; i++) {
85 if (GetPlayingSoundCount(i) > 0) {
86 mpSnd2dCalc->fn_8019ee20(m_64, mPos, 0);
93 virtual void calc(
const nw4r::math::VEC2 &pos) {
99 for (
int i = 0; i < mTotalCount; i++) {
100 if (mParams[i].IsAttachedSound()) {
101 if (mParams[i].GetId() ==
id) {
110 for (
int i = 0; i < mTotalCount; i++) {
111 if (!mParams[i].IsAttachedSound()) {
112 mParams[i].m_04 = 1.0f;
119 virtual SoundHandlePrm *startSound(
unsigned long p1,
unsigned long p2) {
122 detail_StartSound(p, p1, 0);
123 if (!p->IsAttachedSound()) {
126 sendRemote(p, p1, p2);
131 virtual SoundHandlePrm *holdSound(
unsigned long p1,
unsigned long p2) {
137 detail_HoldSound(p, p1, 0);
138 if (!p->IsAttachedSound()) {
141 sendRemote(p, p1, p2);
147 virtual SoundHandlePrm *prepareSound(
unsigned long p1,
unsigned long p2) {
150 detail_PrepareSound(p, p1, 0);
151 if (!p->IsAttachedSound()) {
154 sendRemote(p, p1, p2);
160 virtual SoundHandlePrm *startSound(
unsigned long p1,
short p2,
unsigned long p3) {
163 detail_StartSound(p, p1, 0);
164 if (!p->IsAttachedSound()) {
167 sendRemote(p, p1, p3);
168 if (SndAudioMgr::sInstance->mpSndArc->GetSoundType(p1) == 1) {
169 nw4r::snd::SeqSoundHandle handle(p);
170 handle.WriteVariable(0, p2);
176 virtual SoundHandlePrm *holdSound(
unsigned long p1,
short p2,
unsigned long p3) {
182 detail_HoldSound(p, p1, 0);
183 if (!p->IsAttachedSound()) {
186 sendRemote(p, p1, p3);
187 if (SndAudioMgr::sInstance->mpSndArc->GetSoundType(p1) == 1) {
188 nw4r::snd::SeqSoundHandle handle(p);
189 handle.WriteVariable(0, p2);
196 virtual SoundHandlePrm *startSound(
unsigned long p1,
const nw4r::math::VEC2 &p2,
unsigned long p3) {
199 detail_StartSound(p, p1, 0);
200 if (!p->IsAttachedSound()) {
203 SndAudioMgr::sInstance->setSoundPosition(p, p2);
204 sendRemote(p, p1, p3);
209 virtual SoundHandlePrm *holdSound(
unsigned long p1,
const nw4r::math::VEC2 &p2,
unsigned long p3) {
215 detail_HoldSound(p, p1, 0);
216 if (!p->IsAttachedSound()) {
219 SndAudioMgr::sInstance->setSoundPosition(p, p2);
220 sendRemote(p, p1, p3);
231 nw4r::math::VEC2 mPos;
236 void calculate(
const nw4r::math::VEC2 &pos) {
237 NMSndObject<4>::calc(pos);
240 virtual SoundHandlePrm *startSound(ulong p1, ulong p2);
241 virtual SoundHandlePrm *holdSound(ulong p1, ulong p2);
242 virtual SoundHandlePrm *startSound(ulong p1,
short p2, ulong p3);
243 virtual SoundHandlePrm *holdSound(ulong p1,
short p2, ulong p3);
244 virtual SoundHandlePrm *startSound(ulong p1,
const nw4r::math::VEC2 &p2, ulong p3);
245 virtual SoundHandlePrm *holdSound(ulong p1,
const nw4r::math::VEC2 &p2, ulong p3);
247 void stopPlyJumpSound();
248 void startFootSound(ulong,
float, ulong);
249 void fn_8019AAB0(ulong,
int);
250 void fn_8019ABB0(ulong,
int);
255 virtual SoundHandlePrm *startSound(ulong p1, ulong p2);
256 virtual SoundHandlePrm *holdSound(ulong p1, ulong p2);
257 virtual SoundHandlePrm *startSound(ulong p1,
short p2, ulong p3);
258 virtual SoundHandlePrm *holdSound(ulong p1,
short p2, ulong p3);
259 virtual SoundHandlePrm *startSound(ulong p1,
const nw4r::math::VEC2 &p2, ulong p3);
260 virtual SoundHandlePrm *holdSound(ulong p1,
const nw4r::math::VEC2 &p2, ulong p3);
265 virtual SoundHandlePrm *startSound(ulong p1, ulong p2);
266 virtual SoundHandlePrm *holdSound(ulong p1, ulong p2);
267 virtual SoundHandlePrm *startSound(ulong p1,
short p2, ulong p3);
268 virtual SoundHandlePrm *holdSound(ulong p1,
short p2, ulong p3);
269 virtual SoundHandlePrm *startSound(ulong p1,
const nw4r::math::VEC2 &p2, ulong p3);
270 virtual SoundHandlePrm *holdSound(ulong p1,
const nw4r::math::VEC2 &p2, ulong p3);
275 virtual SoundHandlePrm *startSound(ulong p1, ulong p2);
276 virtual SoundHandlePrm *holdSound(ulong p1, ulong p2);
277 virtual SoundHandlePrm *startSound(ulong p1,
short p2, ulong p3);
278 virtual SoundHandlePrm *holdSound(ulong p1,
short p2, ulong p3);
279 virtual SoundHandlePrm *startSound(ulong p1,
const nw4r::math::VEC2 &p2, ulong p3);
280 virtual SoundHandlePrm *holdSound(ulong p1,
const nw4r::math::VEC2 &p2, ulong p3);
321 virtual SoundHandlePrm *startSound(ulong p1, ulong p2) {
322 return SndObjctPly::startSound(p1, p2);
324 virtual SoundHandlePrm *startSound(ulong p1,
short p2, ulong p3) {
325 return SndObjctPly::startSound(p1, p2, p3);
327 virtual SoundHandlePrm *holdSound(ulong p1, ulong p2) {
328 return SndObjctPly::holdSound(p1, p2);
330 virtual SoundHandlePrm *holdSound(ulong p1,
short p2, ulong p3) {
331 return SndObjctPly::holdSound(p1, p2, p3);
347 virtual SoundHandlePrm *startSound(ulong p1, ulong p2) {
348 return SndObjctEmy::startSound(p1, p2);
350 virtual SoundHandlePrm *startSound(ulong p1,
short p2, ulong p3) {
351 return SndObjctEmy::startSound(p1, p2, p3);
353 virtual SoundHandlePrm *holdSound(ulong p1, ulong p2) {
354 return SndObjctEmy::holdSound(p1, p2);
356 virtual SoundHandlePrm *holdSound(ulong p1,
short p2, ulong p3) {
357 return SndObjctEmy::holdSound(p1, p2, p3);
375 class SoundEffectID_t {
377 SoundEffectID_t(u32 soundID) : id(soundID) {}
379 operator u32()
const {
384 void playObjSound(T *obj,
const mVec2_c &pos,
int playerNo)
const {
385 obj->startSound(
id, dAudio::cvtSndObjctPos(pos), playerNo);
389 void playObjSound(T *obj,
const mVec3_c &pos,
int playerNo)
const {
390 obj->startSound(
id, dAudio::cvtSndObjctPos(pos), playerNo);
393 void playEmySound(
const mVec2_c &pos,
int playerNo)
const {
394 playObjSound(dAudio::g_pSndObjEmy, pos, playerNo);
397 void playEmySound(
const mVec3_c &pos,
int playerNo)
const {
398 playObjSound(dAudio::g_pSndObjEmy, pos, playerNo);
401 void playMapSound(
const mVec2_c &pos,
int playerNo)
const {
402 playObjSound(dAudio::g_pSndObjMap, pos, playerNo);
405 void playMapSound(
const mVec3_c &pos,
int playerNo)
const {
406 playObjSound(dAudio::g_pSndObjMap, pos, playerNo);