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

Method updateAudioState

Engine/source/T3D/shapeBase.cpp:2114–2141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2112}
2113
2114void ShapeBase::updateAudioState(Sound& st)
2115{
2116 SFX_DELETE( st.sound );
2117
2118 if ( st.play && st.profile )
2119 {
2120 if ( isGhost() )
2121 {
2122 if ( Sim::findObject( SimObjectId((uintptr_t)st.profile), st.profile ) )
2123 {
2124 st.sound = SFX->createSource( st.profile, &getTransform() );
2125 if ( st.sound )
2126 st.sound->play();
2127 }
2128 else
2129 st.play = false;
2130 }
2131 else
2132 {
2133 // Non-looping sounds timeout on the server
2134 st.timeout = 0;
2135 if ( !st.profile->getDescription()->mIsLooping )
2136 st.timeout = Sim::getCurrentTime() + sAudioTimeout;
2137 }
2138 }
2139 else
2140 st.play = false;
2141}
2142
2143void ShapeBase::updateAudioPos()
2144{

Callers

nothing calls this directly

Calls 5

findObjectFunction · 0.50
getCurrentTimeFunction · 0.50
createSourceMethod · 0.45
playMethod · 0.45
getDescriptionMethod · 0.45

Tested by

no test coverage detected