]> git.mxchange.org Git - simgear.git/commitdiff
don't only complain that the volume is larger than 1.0, but say how much
authormfranz <mfranz>
Sat, 23 Jun 2007 16:48:01 +0000 (16:48 +0000)
committermfranz <mfranz>
Sat, 23 Jun 2007 16:48:01 +0000 (16:48 +0000)
it actually is

simgear/sound/xmlsound.cxx

index c4b6523314fa643fbbcee35315e0940542edea6d..078dffd76bfa92ea28c6631ac902ad628acdcaa6 100644 (file)
@@ -424,15 +424,15 @@ SGXmlSound::update (double dt)
    //
    // 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 );
-   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 );
 
 
    //