| 7180 | } |
| 7181 | |
| 7182 | void Player::updateWaterSounds(F32 dt) |
| 7183 | { |
| 7184 | if ( mWaterCoverage < 1.0f || mDamageState != Enabled ) |
| 7185 | { |
| 7186 | // Stop everything |
| 7187 | if ( mMoveBubbleSound ) |
| 7188 | mMoveBubbleSound->stop(); |
| 7189 | if ( mWaterBreathSound ) |
| 7190 | mWaterBreathSound->stop(); |
| 7191 | return; |
| 7192 | } |
| 7193 | |
| 7194 | if ( mMoveBubbleSound ) |
| 7195 | { |
| 7196 | // We're under water and still alive, so let's play something |
| 7197 | if ( mVelocity.len() > 1.0f ) |
| 7198 | { |
| 7199 | if ( !mMoveBubbleSound->isPlaying() ) |
| 7200 | mMoveBubbleSound->play(); |
| 7201 | |
| 7202 | mMoveBubbleSound->setTransform( getTransform() ); |
| 7203 | } |
| 7204 | else |
| 7205 | mMoveBubbleSound->stop(); |
| 7206 | } |
| 7207 | |
| 7208 | if ( mWaterBreathSound ) |
| 7209 | { |
| 7210 | if ( !mWaterBreathSound->isPlaying() ) |
| 7211 | mWaterBreathSound->play(); |
| 7212 | |
| 7213 | mWaterBreathSound->setTransform( getTransform() ); |
| 7214 | } |
| 7215 | } |
| 7216 | |
| 7217 | |
| 7218 | //-------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected