blob: 4a09d3bcb5ae86c8168e00eb6b70f15795359257 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#ifndef D_SND_DISTANT_SOUND_ACTOR_POOL_H
#define D_SND_DISTANT_SOUND_ACTOR_POOL_H
#include "common.h"
#include "d/snd/d_snd_distant_sound_actor.h"
#include "d/snd/d_snd_misc.h"
#include "d/snd/d_snd_types.h"
#include "d/snd/d_snd_util.h"
#include "nw4r/math/math_types.h"
#include "nw4r/ut/ut_list.h"
SND_DISPOSER_FORWARD_DECL(dSndDistantSoundActorPool_c);
/**
* A pool for distant sounds actors. Sound sources will borrow
* actors from this pool when they want to play a sound
* at a specific position. The finisher target sound will
* also play using this pool.
*/
class dSndDistantSoundActorPool_c {
SND_DISPOSER_MEMBERS(dSndDistantSoundActorPool_c);
static const s32 POOL_SIZE = 64;
public:
dSndDistantSoundActorPool_c();
static dSndSourceParam &getSourceParam() {
return sParam;
}
void setup();
void calc();
void onChangeStage();
dSndDistantSoundActor_c *acquireActor(u32 soundId, const nw4r::math::VEC3 *position, dSoundSource_c *source);
dSndDistantSoundActor_c *findActiveActor(u32 soundId, dSoundSource_c *source);
bool startSound(u32 soundId, const nw4r::math::VEC3 *position);
bool holdSound(u32 soundId, const nw4r::math::VEC3 *position);
void setAllPause(bool flag, s32 fadeFrames);
void disableAll();
void enableAll();
private:
void addToActiveList(dSndDistantSoundActor_c *actor, u32 id);
void removeFromActiveList(dSndDistantSoundActor_c *actor);
/* 0x0010 */ dSndDistantSoundActor_c mSounds[POOL_SIZE];
/* 0x4210 */ UNKWORD field_0x4210;
/* 0x4214 */ nw4r::ut::List mActiveActors;
static dSndSourceParam sParam;
};
#endif
|