don't start to play sounds that are out of range of the listener
points.push_back(std::make_pair(randomPoint, img->getColor(x,y).r()));
}
} else {
- points.push_back(std::make_pair(randomPoint, mt_rand(&seed)));
+ points.push_back(std::make_pair(randomPoint, static_cast<float>(mt_rand(&seed))));
}
}
num -= 1.0;
for ( ; sample_current != sample_end; ++sample_current ) {
SGSoundSample *sample = sample_current->second;
- if ( !sample->is_valid_source() && sample->is_playing() ) {
+ if ( !sample->is_valid_source() && sample->is_playing() && !sample->test_out_of_range()) {
//
// a request to start playing a sound has been filed.
//