mirror of
https://github.com/rrika/cdcEngineDXHR.git
synced 2024-11-23 05:29:57 +00:00
28 lines
756 B
C++
28 lines
756 B
C++
#include "cdc/dtp/soundplex.h"
|
|
#include "SoundPlex.h"
|
|
#include "SoundPlexChoiceList.h"
|
|
|
|
namespace cdc {
|
|
|
|
SoundPlex *SoundPlexChoiceList::GetPlayableSoundFromChoiceList(
|
|
dtp::SoundPlex::ChoiceList& choiceList,
|
|
SoundTypes::Controls *pControls,
|
|
SoundTypes::Controls3d *pControls3d,
|
|
SoundOwner *pOwner)
|
|
{
|
|
if (choiceList.m_numSounds == 0)
|
|
return nullptr;
|
|
|
|
if (choiceList.m_numSounds == 1)
|
|
return SoundPlexCollection::Create(choiceList.m_sounds[0], pControls, pControls3d, pOwner);
|
|
|
|
// TODO: implement modes other than cycle
|
|
uint32_t index = choiceList.m_counter++;
|
|
if (choiceList.m_counter == choiceList.m_numSounds)
|
|
choiceList.m_counter = 0;
|
|
|
|
return SoundPlexCollection::Create(choiceList.m_sounds[index], pControls, pControls3d, pOwner);
|
|
}
|
|
|
|
}
|