1#ifndef NW4HBM_SND_SOUND_INSTANCE_MANAGER_H
2#define NW4HBM_SND_SOUND_INSTANCE_MANAGER_H
22 class SoundInstanceManager {
25 NW4HBM_ASSERT_CHECK_NULL(59,
buffer);
30 NW4HBM_ASSERT_CHECK_NULL(76,
buffer);
35 NW4R_ASSERT_MINMAXLT(92, priority, 0, 127);
39 void* ptr =
mPool.Alloc();
42 sound =
new (ptr)
T(
this);
53 if (priority < sound->CalcCurrentPlayerPriority()) {
59 NW4HBM_ASSERT_CHECK_NULL(114, ptr);
60 sound =
new (ptr)
T(
this);
68 NW4HBM_ASSERT_CHECK_NULL(134, sound);
96 if (priority < it->CalcCurrentPlayerPriority()) {
107 TPrioList listsByPrio[T::PRIORITY_MAX + 1];
112 listsByPrio[rSound.CalcCurrentPlayerPriority()].
PushBack(&rSound);
115 for (
int i = 0;
i < T::PRIORITY_MAX + 1;
i++) {
116 while (!listsByPrio[
i].IsEmpty()) {
Definition InstancePool.h:53
ut::LinkList< T, offsetof(T, mPriorityLink)> TPrioList
Definition SoundInstanceManager.h:130
void Destroy(void *buffer, u32 size)
Definition SoundInstanceManager.h:29
u32 Create(void *buffer, u32 size)
Definition SoundInstanceManager.h:24
TPrioList mPriorityList
Definition SoundInstanceManager.h:134
u32 GetActiveCount() const
Definition SoundInstanceManager.h:80
u32 GetFreeCount() const
Definition SoundInstanceManager.h:82
void Free(T *sound)
Definition SoundInstanceManager.h:67
T * Alloc(int priority)
Definition SoundInstanceManager.h:34
void InsertPriorityList(T *sound, int priority)
Definition SoundInstanceManager.h:92
void UpdatePriority(T *sound, int priority)
Definition SoundInstanceManager.h:124
T * GetLowestPrioritySound()
Definition SoundInstanceManager.h:84
void SortPriorityList()
Definition SoundInstanceManager.h:106
void RemovePriorityList(T *sound)
Definition SoundInstanceManager.h:104
MemoryPool< T > mPool
Definition SoundInstanceManager.h:133
Iterator Insert(Iterator it, T *pElem)
Definition LinkList.h:320
void PushBack(T *pElem)
Definition LinkList.h:329
Iterator GetBeginIter()
Definition LinkList.h:304
Iterator GetEndIter()
Definition LinkList.h:313
Iterator Erase(T *pElem)
Definition LinkList.h:324
T & GetFront()
Definition LinkList.h:331
u32 GetSize() const
Definition LinkList.h:127
bool IsEmpty() const
Definition LinkList.h:128
void PopFront()
Definition LinkList.h:130
static OSTime buffer
Definition ai.c:24
unsigned int size
Definition __os.h:106
int i
Definition e_log.c:92
unsigned long u32
Definition types.h:12
static const double T[]
Definition k_tan.c:106
Definition HBMAnmController.h:6