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;
252 void calculate(
const nw4r::math::VEC2 &pos) {
253 NMSndObject<4>::calc(pos);
256 SoundHandlePrm *startSound(ulong p1, ulong p2)
override;
257 SoundHandlePrm *holdSound(ulong p1, ulong p2)
override;
258 SoundHandlePrm *startSound(ulong p1,
short p2, ulong p3)
override;
259 SoundHandlePrm *holdSound(ulong p1,
short p2, ulong p3)
override;
260 SoundHandlePrm *startSound(ulong p1,
const nw4r::math::VEC2 &p2, ulong p3)
override;
261 SoundHandlePrm *holdSound(ulong p1,
const nw4r::math::VEC2 &p2, ulong p3)
override;
263 void stopPlyJumpSound();
264 void startFootSound(ulong,
float, ulong);
265 void fn_8019AAB0(ulong,
int);
266 void fn_8019ABB0(ulong,
int);
271 SoundHandlePrm *startSound(ulong p1, ulong p2)
override;
272 SoundHandlePrm *holdSound(ulong p1, ulong p2)
override;
273 SoundHandlePrm *startSound(ulong p1,
short p2, ulong p3)
override;
274 SoundHandlePrm *holdSound(ulong p1,
short p3, ulong p4)
override;
275 SoundHandlePrm *startSound(ulong p1,
const nw4r::math::VEC2 &p2, ulong p3)
override;
276 SoundHandlePrm *holdSound(ulong p1,
const nw4r::math::VEC2 &p3, ulong p4)
override;
335 virtual SoundHandlePrm *startSound(ulong p1, ulong p2) {
336 return SndObjctPly::startSound(p1, p2);
338 virtual SoundHandlePrm *startSound(ulong p1,
short p2, ulong p3) {
339 return SndObjctPly::startSound(p1, p2, p3);
341 virtual SoundHandlePrm *holdSound(ulong p1, ulong p2) {
342 return SndObjctPly::holdSound(p1, p2);
344 virtual SoundHandlePrm *holdSound(ulong p1,
short p2, ulong p3) {
345 return SndObjctPly::holdSound(p1, p2, p3);
361 virtual SoundHandlePrm *startSound(ulong p1, ulong p2) {
362 return SndObjctEmy::startSound(p1, p2);
364 virtual SoundHandlePrm *startSound(ulong p1,
short p2, ulong p3) {
365 return SndObjctEmy::startSound(p1, p2, p3);
367 virtual SoundHandlePrm *holdSound(ulong p1, ulong p2) {
368 return SndObjctEmy::holdSound(p1, p2);
370 virtual SoundHandlePrm *holdSound(ulong p1,
short p2, ulong p3) {
371 return SndObjctEmy::holdSound(p1, p2, p3);
377 void startSound(
unsigned long soundID,
const nw4r::math::VEC2 &pos,
int remPlayer) {
378 SndObjctCmnMap::startSound(soundID, pos, remPlayer);
380 void startSound(
unsigned long soundID,
const mVec3_c &pos,
int remPlayer) {
381 SndObjctCmnMap::startSound(soundID, dAudio::cvtSndObjctPos(pos), remPlayer);
383 void holdSound(
unsigned long soundID,
int id,
const nw4r::math::VEC2 &pos,
int remPlayer) {
384 SndObjctCmnMap::holdSound(soundID,
id, pos, remPlayer);
386 void holdSound(
unsigned long soundID,
int id,
const mVec3_c &pos,
int remPlayer) {
387 SndObjctCmnMap::holdSound(soundID,
id, dAudio::cvtSndObjctPos(pos), remPlayer);
395 class SoundEffectID_t {
397 SoundEffectID_t(u32 soundID) : mID(soundID) {}
399 operator u32()
const {
404 template<
class T,
class TVec>
405 void playObjSound(T *obj,
const TVec &pos,
int playerNo)
const {
406 obj->startSound(mID, dAudio::cvtSndObjctPos(pos), playerNo);
409 template<
class T,
class TVec>
410 void holdObjSound(T *obj,
int id,
const TVec &pos,
int playerNo)
const {
411 obj->holdSound(mID,
id, dAudio::cvtSndObjctPos(pos), playerNo);
416 void playEmySound(
const TVec &pos,
int playerNo)
const {
417 playObjSound(dAudio::g_pSndObjEmy, pos, playerNo);
421 void playMapSound(
const TVec &pos,
int playerNo)
const {
422 playObjSound(dAudio::g_pSndObjMap, pos, playerNo);
426 void holdMapSound(
int id,
const TVec &pos,
int playerNo)
const {
427 holdObjSound(dAudio::g_pSndObjMap,
id, pos, playerNo);