From: Stuart Buchanan Date: Thu, 15 Sep 2011 20:11:00 +0000 (+0100) Subject: Make tree textures consistent across runs by replacing rand() call with X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=20bd0737a22eb9825fb790c9a2ac7bc2eb6ba9ae;p=simgear.git Make tree textures consistent across runs by replacing rand() call with something deterministic. --- diff --git a/simgear/scene/tgdb/TreeBin.cxx b/simgear/scene/tgdb/TreeBin.cxx index 56c5d415..17da8374 100644 --- a/simgear/scene/tgdb/TreeBin.cxx +++ b/simgear/scene/tgdb/TreeBin.cxx @@ -253,7 +253,7 @@ struct AddTreesLeafObject { void operator() (LOD* lod, const TreeBin::Tree& tree) const { - Geode* geode = static_cast(lod->getChild(rand() % SG_TREE_FADE_OUT_LEVELS)); + Geode* geode = static_cast(lod->getChild(int(tree.position.x() * 10.0f) % lod->getNumChildren())); addTreeToLeafGeode(geode, tree.position); } };