MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / _play

Method _play

Engine/source/sfx/sfxSound.cpp:394–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392//-----------------------------------------------------------------------------
393
394void SFXSound::_play()
395{
396 Parent::_play();
397
398 if( mVoice )
399 mVoice->play( isLooping() );
400 else
401 {
402 // To ensure the fastest possible reaction
403 // to this playback let the system reassign
404 // voices immediately.
405 SFX->_assignVoice( this );
406
407 // If we did not get assigned a voice, we'll be
408 // running virtualized.
409
410 #ifdef DEBUG_SPEW
411 if( !mVoice )
412 Platform::outputDebugString( "[SFXSound] virtualizing playback of source '%i'", getId() );
413 #endif
414 }
415 if(getPosition() != mSetPositionValue)
416 setPosition(mSetPositionValue);
417 mSetPositionValue = 0; //Non looping sounds need this to reset.
418}
419
420//-----------------------------------------------------------------------------
421

Callers

nothing calls this directly

Calls 4

getPositionFunction · 0.85
_assignVoiceMethod · 0.80
setPositionFunction · 0.50
playMethod · 0.45

Tested by

no test coverage detected