MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / deleteDevice

Method deleteDevice

Engine/source/sfx/sfxSystem.cpp:503–527  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

501//-----------------------------------------------------------------------------
502
503void SFXSystem::deleteDevice()
504{
505 // Make sure we have a valid device.
506 if ( !mDevice )
507 return;
508
509 // Put all playing sounds into virtualized playback mode. Where this fails,
510 // stop the source.
511
512 for( U32 i = 0; i < mSounds.size(); ++ i )
513 {
514 SFXSound* sound = mSounds[ i ];
515 if( sound->hasVoice() && !sound->_releaseVoice() )
516 sound->stop();
517 }
518
519 // Signal everyone who cares that the
520 // device is being deleted.
521 getEventSignal().trigger( SFXSystemEvent_DestroyDevice );
522
523 // Free the device which should delete all
524 // the active voices and buffers.
525 delete mDevice;
526 mDevice = NULL;
527}
528
529//-----------------------------------------------------------------------------
530

Callers 1

sfxSystem.cppFile · 0.80

Calls 5

hasVoiceMethod · 0.80
_releaseVoiceMethod · 0.80
sizeMethod · 0.45
stopMethod · 0.45
triggerMethod · 0.45

Tested by

no test coverage detected