]> git.mxchange.org Git - simgear.git/commitdiff
remove some warnings for MSVC
authorHarald JOHNSEN <hjohnsen@evc.net>
Tue, 29 May 2012 17:59:54 +0000 (19:59 +0200)
committerThorstenB <brehmt@gmail.com>
Fri, 8 Jun 2012 13:23:54 +0000 (15:23 +0200)
don't start to play sounds that are out of range of the listener

simgear/scene/tgdb/SGTexturedTriangleBin.hxx
simgear/sound/sample_group.cxx

index 5de1b5cc3699186f383b05edb65a4d9d24b3f5e3..9404e437ef4a567e1bfef4f9e9f17491768424b9 100644 (file)
@@ -293,7 +293,7 @@ public:
               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;
index b0ddab8a8ec357ca67131a290624bcd79dbb27c6..6b2d8566e3a8da6664916e32b4bd134f8969e400 100644 (file)
@@ -134,7 +134,7 @@ void SGSampleGroup::update( double dt ) {
     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.
             //