MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / AdjustMixStreamsRefCount

Method AdjustMixStreamsRefCount

CrySoundSystem/MusicSystem.cpp:1117–1131  ·  view source on GitHub ↗

lookahead for all patterns in play-list to see which ones exceed in the next nSamples */

Source from the content-addressed store, hash-verified

1115/* lookahead for all patterns in play-list to see which ones exceed in the next nSamples
1116*/
1117void CMusicSystem::AdjustMixStreamsRefCount(int nSamples)
1118{
1119 for (TPatternPlayInfoVecIt It=m_vecPlayingPatterns.begin();It!=m_vecPlayingPatterns.end();++It)
1120 {
1121 SMusicPatternPlayInfo &PlayInfo=(*It);
1122 if (!PlayInfo.pRefCount)
1123 continue;
1124 int nSamplesToEnd=PlayInfo.pPatternInstance->GetSamplesToEnd();
1125 if (nSamplesToEnd<=nSamples)
1126 {
1127 (*(PlayInfo.pRefCount))--;
1128 PlayInfo.bRefCountAdjusted=true;
1129 }
1130 }
1131}
1132
1133/* mix all streams in the play-list into pBuffer; mixlength is nSamples
1134 the data is processed before mixing if needed (eg. ramping)

Callers

nothing calls this directly

Calls 3

GetSamplesToEndMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected