Refactor of sound asset

Refactored to match image asset.
This commit is contained in:
marauder2k7 2026-04-05 14:17:17 +01:00
parent 5796f0ea07
commit 71273e63c9
46 changed files with 639 additions and 775 deletions

View file

@ -40,7 +40,6 @@ ConsoleDocClass( GuiAudioCtrl,
GuiAudioCtrl::GuiAudioCtrl()
{
INIT_ASSET(Sound);
mTickPeriodMS = 100;
mLastThink = 0;
mCurrTick = 0;
@ -85,7 +84,7 @@ void GuiAudioCtrl::processTick()
{
mCurrTick = 0;
mLastThink = 0;
if (isSoundValid())
if (getSoundAsset().notNull())
{
_update();
}
@ -154,14 +153,11 @@ void GuiAudioCtrl::_update()
if (testCondition() && isAwake())
{
bool useTrackDescriptionOnly = (mUseTrackDescriptionOnly && getSoundProfile());
bool useTrackDescriptionOnly = mUseTrackDescriptionOnly;
if (getSoundProfile())
if (mSoundPlaying == NULL)
{
if (mSoundPlaying == NULL)
{
mSoundPlaying = SFX->createSource(getSoundProfile(), &(SFX->getListener().getTransform()));
}
mSoundPlaying = SFX->createSource(getSoundSFXTrack(), &(SFX->getListener().getTransform()));
}
if ( mSoundPlaying && !mSoundPlaying->isPlaying())