| 189 | //----------------------------------------------------------------------------- |
| 190 | |
| 191 | SFXSystem::SFXSystem() |
| 192 | : mDevice( NULL ), |
| 193 | mLastSourceUpdateTime( 0 ), |
| 194 | mLastAmbientUpdateTime( 0 ), |
| 195 | mLastParameterUpdateTime( 0 ), |
| 196 | mStatNumSources( 0 ), |
| 197 | mStatNumSounds( 0 ), |
| 198 | mStatNumPlaying( 0 ), |
| 199 | mStatNumCulled( 0 ), |
| 200 | mStatNumVoices( 0 ), |
| 201 | mStatSourceUpdateTime( 0 ), |
| 202 | mStatParameterUpdateTime( 0 ), |
| 203 | mDistanceModel( SFXDistanceModelLinear ), |
| 204 | mStatAmbientUpdateTime( 0 ), |
| 205 | mDopplerFactor( 0.5 ), |
| 206 | mRolloffFactor( 1.0 ), |
| 207 | mSoundscapeMgr( NULL ) |
| 208 | { |
| 209 | VECTOR_SET_ASSOCIATION( mSounds ); |
| 210 | VECTOR_SET_ASSOCIATION( mPlayOnceSources ); |
| 211 | VECTOR_SET_ASSOCIATION( mPlugins ); |
| 212 | VECTOR_SET_ASSOCIATION( mListeners ); |
| 213 | |
| 214 | // Always at least one listener. |
| 215 | |
| 216 | mListeners.increment(); |
| 217 | |
| 218 | // Register stat variables. |
| 219 | |
| 220 | Con::addVariable( "SFX::numSources", TypeS32, &mStatNumSources, |
| 221 | "Number of SFXSource type objects that are currently instantiated.\n" |
| 222 | "@ingroup SFX" ); |
| 223 | Con::addVariable( "SFX::numSounds", TypeS32, &mStatNumSounds, |
| 224 | "Number of SFXSound type objects (i.e. actual single-file sounds) that are currently instantiated.\n" |
| 225 | "@ingroup SFX" ); |
| 226 | Con::addVariable( "SFX::numPlaying", TypeS32, &mStatNumPlaying, |
| 227 | "Number of SFXSources that are currently in playing state.\n" |
| 228 | "@ingroup SFX" ); |
| 229 | Con::addVariable( "SFX::numCulled", TypeS32, &mStatNumCulled, |
| 230 | "Number of SFXSounds that are currently in virtualized playback mode.\n" |
| 231 | "@ref SFXSound_virtualization\n\n" |
| 232 | "@ingroup SFX" ); |
| 233 | Con::addVariable( "SFX::numVoices", TypeS32, &mStatNumVoices, |
| 234 | "Number of voices that are currently allocated on the sound device.\n" |
| 235 | "@ingroup SFX" ); |
| 236 | Con::addVariable( "SFX::sourceUpdateTime", TypeS32, &mStatSourceUpdateTime, |
| 237 | "Milliseconds spent on the last SFXSource update loop.\n" |
| 238 | "@ref SFX_updating\n\n" |
| 239 | "@ingroup SFX" ); |
| 240 | Con::addVariable( "SFX::parameterUpdateTime", TypeS32, &mStatParameterUpdateTime, |
| 241 | "Milliseconds spent on the last SFXParameter update loop.\n" |
| 242 | "@ref SFX_updating\n\n" |
| 243 | "@ref SFX_interactive\n\n" |
| 244 | "@ingroup SFX" ); |
| 245 | Con::addVariable( "SFX::ambientUpdateTime", TypeS32, &mStatAmbientUpdateTime, |
| 246 | "Milliseconds spent on the last ambient audio update.\n" |
| 247 | "@ref SFX_updating\n\n" |
| 248 | "@ref SFX_ambient\n\n" |
nothing calls this directly
no test coverage detected