本文整理汇总了C++中AList::AddSorted方法的典型用法代码示例。如果您正苦于以下问题:C++ AList::AddSorted方法的具体用法?C++ AList::AddSorted怎么用?C++ AList::AddSorted使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AList
的用法示例。
在下文中一共展示了AList::AddSorted方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Exec
void mlrVoiceManager::Exec(Tpoint *campos, Trotation *camrot, Tpoint *camvel){
static const Tpoint upv = { 0, 0, 1 };
static const Tpoint fwd = { 1, 0, 0 };
MatrixMult(camrot, &upv, &listenerUp);
MatrixMult(camrot, &fwd, &listenerFront);
listenerPosition = *campos;
listenerVelocity = *camvel;
Lock();
mlrVoice *n;
int channels;
channels=g_nDynamicVoices;
// sort the PlayList, store in temp
AList temp;
while (n=(mlrVoice *)PlayList.RemHead()){
n->PreExec();
temp.AddSorted((ANode *)n);
}
// filter out what will be played
while (n=(mlrVoice *)temp.RemHead()){
if(( n->status==mlrVoice::VSSTART || n->status==mlrVoice::VSPLAYING ) && channels > 0){
PlayList.AddTail(n); // maintain sortedness
channels--;
}
else {
n->ReleaseBuffers();
HoldList.AddTail(n);
}
}
channels=g_nDynamicVoices;
// make these allocate their sound buffers
// then exec()
if (SimDriver.MotionOn()){
n=(mlrVoice *)PlayList.GetHead();
while (n){
//COUNT_PROFILE("VOICEMAN_COUNT");
n->AllocateBuffers();
n->Exec();
n=(mlrVoice *)n->GetSucc();
}
}
else{
n=(mlrVoice *)PlayList.GetHead();
while (n){
n->Pause();
n=(mlrVoice *)n->GetSucc();
}
}
Unlock();
}