From 20bd0737a22eb9825fb790c9a2ac7bc2eb6ba9ae Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Thu, 15 Sep 2011 21:11:00 +0100 Subject: [PATCH] Make tree textures consistent across runs by replacing rand() call with something deterministic. --- simgear/scene/tgdb/TreeBin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } }; -- 2.39.5