don't only complain that the volume is larger than 1.0, but say how much
it actually is
This commit is contained in:
parent
c8953c6275
commit
5cb04946b0
@ -424,15 +424,15 @@ SGXmlSound::update (double dt)
|
|||||||
//
|
//
|
||||||
// Change sample state
|
// Change sample state
|
||||||
//
|
//
|
||||||
|
|
||||||
|
double vol = volume_offset + volume;
|
||||||
|
if (vol > 1.0) {
|
||||||
|
SG_LOG(SG_GENERAL, SG_WARN, "Sound volume too large for '"
|
||||||
|
<< _name << "': " << vol << " -> clipping to 1.0");
|
||||||
|
vol = 1.0;
|
||||||
|
}
|
||||||
|
_sample->set_volume(vol);
|
||||||
_sample->set_pitch( pitch_offset + pitch );
|
_sample->set_pitch( pitch_offset + pitch );
|
||||||
if ((volume_offset + volume ) > 1.0)
|
|
||||||
{
|
|
||||||
_sample->set_volume( 1.0 );
|
|
||||||
SG_LOG(SG_GENERAL, SG_WARN,
|
|
||||||
"Volume larger than 1.0 in configuration for '" << _name
|
|
||||||
<< "', clipping.");
|
|
||||||
} else
|
|
||||||
_sample->set_volume( volume_offset + volume );
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user