Skip to content

Commit 524ec52

Browse files
committed
Handle emitter link
1 parent bc790d4 commit 524ec52

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

scripts/yySequence.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,11 +1607,15 @@ function yySequenceAudioTrack(_pStorage) {
16071607

16081608
this.UpdateBusLayout = function()
16091609
{
1610-
if (this.m_busStruct === null)
1611-
return;
1612-
16131610
const fxStructs = this.m_tracks.filter(_track => _track.m_effectStruct instanceof AudioEffectStruct)
16141611
.map(_track => _track.m_effectStruct);
1612+
1613+
if (fxStructs.length == 0 && this.m_busStruct === null)
1614+
{
1615+
return;
1616+
}
1617+
1618+
this.InstantiateBus();
16151619

16161620
for (let i = 0; i < AudioBus.NUM_EFFECT_SLOTS; ++i)
16171621
{
@@ -1621,6 +1625,12 @@ function yySequenceAudioTrack(_pStorage) {
16211625
this.m_busStruct.proxy[AudioBus.NUM_EFFECT_SLOTS - 1 - i] = fxStructs[i];
16221626
}
16231627
}
1628+
1629+
if (fxStructs.length > AudioBus.NUM_EFFECT_SLOTS)
1630+
{
1631+
yyError("Failed to assign effect to bus. Audio tracks cannot hold more than "
1632+
+ AudioBus.NUM_EFFECT_SLOTS + " audio effect tracks");
1633+
}
16241634
}
16251635
}
16261636

@@ -5721,6 +5731,14 @@ yySequenceManager.prototype.HandleAudioTrackUpdate = function (_pEl, _pSeq, _pIn
57215731
//audio_emitter_falloff(pInfo.emitterindex, )
57225732

57235733
audio_emitter_position(pAudioInfo.emitterindex, emitterPosX, emitterPosY, 0.0);
5734+
5735+
_pTrack.UpdateBusLayout();
5736+
5737+
if (_pTrack.m_busStruct != null
5738+
&& audio_emitter_get_bus(pAudioInfo.emitterindex) !== _pTrack.m_busStruct)
5739+
{
5740+
audio_emitter_bus(pAudioInfo.emitterindex, _pTrack.m_busStruct);
5741+
}
57245742
}
57255743

57265744
_srcVars.emitterIndex = pAudioInfo.emitterindex;
@@ -5734,8 +5752,6 @@ yySequenceManager.prototype.HandleAudioTrackUpdate = function (_pEl, _pSeq, _pIn
57345752
g_SeqStack.pop();
57355753
}
57365754
}
5737-
5738-
_pTrack.UpdateBusLayout();
57395755
};
57405756

57415757

0 commit comments

Comments
 (0)