mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-09 13:44:32 +00:00
Adds safety check to SoundAsset's playSound so if we don't have a source, it doesn't crash
Adds logic to SoundAsset's load sound to 'nudge' the SFX system to load the required data for first use Shifts SimSoundAssetEvent constructor to utilize assetId instead of raw asset so we can safely fail if for whatever reason we end up default constructor'ing blanks Standardizes the shapeImage playList lookup a bit into a common function and ensures that on packet receive we force an update of the state's sound
This commit is contained in:
parent
956bd51d6d
commit
943cf8351b
6 changed files with 43 additions and 27 deletions
|
|
@ -297,13 +297,13 @@ void SimDataBlockEvent::process(NetConnection *cptr)
|
|||
static F32 SoundPosAccuracy = 0.5;
|
||||
static S32 SoundRotBits = 8;
|
||||
|
||||
SimSoundAssetEvent::SimSoundAssetEvent(AssetPtr<SoundAsset> asset, const MatrixF* mat)
|
||||
SimSoundAssetEvent::SimSoundAssetEvent(StringTableEntry assetId, const MatrixF& mat)
|
||||
{
|
||||
// cant get here unless the asset is declared.
|
||||
mAsset = asset;
|
||||
mAsset = assetId;
|
||||
|
||||
if (mat)
|
||||
mTransform = *mat;
|
||||
mTransform = mat;
|
||||
}
|
||||
|
||||
void SimSoundAssetEvent::pack(NetConnection* con, BitStream* stream)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue