mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
playaudio related fixes
soundassets in general: initialize the ease to default for the ShapeBase::updateAudioState, we never call that without first checking if the asset is defined, *and* isvalid is not valid if it's never tried loading it. so that's both redundant *and* actively counterproductive for a filter
This commit is contained in:
parent
f1723bbb28
commit
5989bca127
2 changed files with 6 additions and 8 deletions
|
|
@ -167,7 +167,7 @@ SoundAsset::SoundAsset()
|
||||||
mProfileDesc.mScatterDistance = Point3F(0.f, 0.f, 0.f);
|
mProfileDesc.mScatterDistance = Point3F(0.f, 0.f, 0.f);
|
||||||
mProfileDesc.mPriority = 1.0f;
|
mProfileDesc.mPriority = 1.0f;
|
||||||
mProfileDesc.mSourceGroup = NULL;
|
mProfileDesc.mSourceGroup = NULL;
|
||||||
|
mProfileDesc.mFadeInEase = EaseF();
|
||||||
mIsPlaylist = false;
|
mIsPlaylist = false;
|
||||||
|
|
||||||
mPlaylist.mNumSlotsToPlay = SFXPlayList::SFXPlaylistSettings::NUM_SLOTS;
|
mPlaylist.mNumSlotsToPlay = SFXPlayList::SFXPlaylistSettings::NUM_SLOTS;
|
||||||
|
|
|
||||||
|
|
@ -2347,14 +2347,12 @@ void ShapeBase::updateAudioState(SoundThread& st)
|
||||||
if ( isGhost() )
|
if ( isGhost() )
|
||||||
{
|
{
|
||||||
// if asset is valid, play
|
// if asset is valid, play
|
||||||
if (st.asset->isAssetValid() )
|
if (st.asset->load() == AssetBase::Ok)
|
||||||
{
|
{
|
||||||
if (st.asset->load() == AssetBase::Ok)
|
SFXTrack* trk = st.asset->getSFXTrack();
|
||||||
{
|
st.sound = SFX->createSource(trk, &getTransform());
|
||||||
st.sound = SFX->createSource(st.asset->getSFXTrack(), &getTransform());
|
if (st.sound)
|
||||||
if (st.sound)
|
st.sound->play();
|
||||||
st.sound->play();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
st.play = false;
|
st.play = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue