snd_StrmSound OK

This commit is contained in:
robojumper
2025-05-27 22:08:22 +02:00
parent cbcee6811f
commit 5797f4cf8a
4 changed files with 29 additions and 10 deletions
+17
View File
@@ -17,6 +17,7 @@
#include "nw4r/snd/snd_StrmSoundHandle.h"
#include "nw4r/snd/snd_MoveValue.h"
#include "nw4r/ut/ut_Lock.h"
#include "nw4r/ut/ut_RuntimeTypeInfo.h"
#include "nw4r/NW4RAssert.hpp"
@@ -116,6 +117,22 @@ void StrmSound::UpdateParam()
}
}
void StrmSound::SetTrackVolume(u32 trackFlags, f32 volume, int fadeFrames)
{
ut::AutoInterruptLock lock;
for (int trackNo = 0; trackNo < (int)ARRAY_LENGTH(mTrackVolume) && trackFlags != 0; trackNo++, trackFlags >>= 1)
{
StrmPlayer::StrmTrack *track = mStrmPlayer.GetPlayerTrack(trackNo);
if (track != NULL && ((trackFlags & 1) != 0))
{
if (volume < 0.0f)
volume = 0.0f;
mTrackVolume[trackNo].SetTarget(volume, fadeFrames);
}
}
}
void StrmSound::Shutdown()
{
BasicSound::Shutdown();