]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/sky/cloudfield.cxx
warning fix: initializing members in the order they are declared keeps gcc happy
[simgear.git] / simgear / scene / sky / cloudfield.cxx
index 313e255a06fe68bc8faff49c039666f6df92deef..7ecd4292995e6b0711990bf8d4f1a467b9a33462 100644 (file)
@@ -68,7 +68,6 @@ using namespace simgear;
 #endif
 
 float SGCloudField::fieldSize = 50000.0f;
-float SGCloudField::coverage = 1.0f;
 double SGCloudField::timer_dt = 0.0;
 float SGCloudField::view_distance = 20000.0f;
 sgVec3 SGCloudField::view_vec, SGCloudField::view_X, SGCloudField::view_Y;
@@ -138,7 +137,7 @@ bool SGCloudField::reposition( const SGVec3f& p, const SGVec3f& up, double lon,
         field_transform->setMatrix( LAT*LON*T );
     }
     
-    field_root->getStateSet()->setRenderBinDetails(asl, "RenderBin");
+    field_root->getStateSet()->setRenderBinDetails(asl, "DepthSortedBin");
 
     return true;
 }
@@ -151,8 +150,9 @@ SGCloudField::SGCloudField() :
        deltay(0.0),
        last_course(0.0),
        last_coverage(0.0),
-        defined3D(false),
-        reposition_count(0)
+        coverage(0.0),
+        reposition_count(0),
+        defined3D(false)
 {
     cld_pos = SGGeoc();
     field_root->addChild(field_transform.get());
@@ -211,10 +211,7 @@ void SGCloudField::clear(void) {
     for (int x = 0; x < QUADTREE_SIZE; x++) {
         for (int y = 0; y < QUADTREE_SIZE; y++) {
             int num_children = field_group[x][y]->getNumChildren();
-
-            for (int i = 0; i < num_children; i++) {
-                field_group[x][y]->removeChild(i);
-            }
+            field_group[x][y]->removeChildren(0, num_children);
         }
     }
     
@@ -239,7 +236,7 @@ static int densTable[][10] = {
 void SGCloudField::applyCoverage(void) {
 
         int row = (int) (coverage * 10.0);
-        if (row > 10) row = 9;
+        if (row > 9) row = 9;
         int col = 0;
 
         if (coverage != last_coverage) {