]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/tgdb/TreeBin.cxx
Make tree textures consistent across runs by replacing rand() call with
[simgear.git] / simgear / scene / tgdb / TreeBin.cxx
index 56c5d41588d3616dfc288a2d8b8dcd079a15c3d0..17da8374231b5d06fe559edf76808dc8adb3d1ca 100644 (file)
@@ -253,7 +253,7 @@ struct AddTreesLeafObject
 {
     void operator() (LOD* lod, const TreeBin::Tree& tree) const
     {
-        Geode* geode = static_cast<Geode*>(lod->getChild(rand() % SG_TREE_FADE_OUT_LEVELS));
+        Geode* geode = static_cast<Geode*>(lod->getChild(int(tree.position.x() * 10.0f) % lod->getNumChildren()));
         addTreeToLeafGeode(geode, tree.position);
     }
 };