You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
voidupdateEffectiveGains(const This *ths, std::vector<K> &active)
21
+
{
22
+
// sort by priority
23
+
std::sort(active.begin(), active.end(), [](const T a, const T b) -> bool { returnstd::pair(a->priority, a->effectiveGain) > std::pair(b->priority, b->effectiveGain); });
24
+
for (uint32 i = ths->maxActiveSounds; i < active.size(); i++)
25
+
Dereferencer(active[i])->effectiveGain = 0;
26
+
27
+
/*
28
+
{ // fade-out sounds close to limit
29
+
const uint32 s = max(ths->maxActiveSounds * 70 / 100, 2u);
30
+
const Real f = 1.0 / (ths->maxActiveSounds - s + 1);
31
+
for (uint32 i = s; i < active.size(); i++)
32
+
Dereferencer(active[i])->effectiveGain *= saturate(1 - (i - s + 1) * f);
0 commit comments