mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
SFX and soundasset safeties and fixe
adress several insatnaces of things like ServerPlay2D et al either not emitting sound at all, or doing so only at scene origin
This commit is contained in:
parent
66766006d3
commit
b12cd00b74
5 changed files with 69 additions and 46 deletions
|
|
@ -550,7 +550,12 @@ DefineEngineMethod(SoundAsset, playSound, S32, (Point3F position), (Point3F::Zer
|
|||
{
|
||||
MatrixF transform;
|
||||
transform.setPosition(position);
|
||||
SFXSource* source = SFX->playOnce(object->getSFXTrack(), &transform, NULL, -1);
|
||||
SFXSource* source;
|
||||
if (position == Point3F::Zero || !object->is3D())
|
||||
source = SFX->playOnce(object->getSFXTrack());
|
||||
else
|
||||
source = SFX->playOnce(object->getSFXTrack(), &transform, NULL, -1);
|
||||
|
||||
if(source)
|
||||
return source->getId();
|
||||
else
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ public:
|
|||
inline StringTableEntry getSoundPath(const U32 slotId = 0) const { return mSoundPath[slotId]; };
|
||||
SFXProfile* getSfxProfile(const U32 slotId = 0) { return &mSFXProfile[slotId]; }
|
||||
SFXPlayList* getSfxPlaylist() { return &mPlaylist; }
|
||||
SFXTrack* getSFXTrack() { return mIsPlaylist ? dynamic_cast<SFXTrack*>(&mPlaylist) : dynamic_cast<SFXTrack*>(&mSFXProfile[0]); }
|
||||
SFXTrack* getSFXTrack() { load(); return mIsPlaylist ? dynamic_cast<SFXTrack*>(&mPlaylist) : dynamic_cast<SFXTrack*>(&mSFXProfile[0]); }
|
||||
SFXDescription* getSfxDescription() { return &mProfileDesc; }
|
||||
bool isPlaylist(){ return mIsPlaylist; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue