Make tree textures consistent across runs by replacing rand() call with

something deterministic.
This commit is contained in:
Stuart Buchanan 2011-09-15 21:11:00 +01:00
parent b3e07077fa
commit 20bd0737a2

View 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);
}
};