Re: [AD] rand() vs random()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> is the random number generator properly seeded with srand() where rand()
> gives you poor random numbers?

srand() is indeed the solution. See demo/demo.c:2004 for an example.

> calling it on on the system driver's init method or allegro_install()
> should suffice, but grepping through allegro's sources i only find one
> occurrence of rand() and that's in colblend.c, no occurrence of srand()
> though. i beleive i have just found a bug.

This call to rand() is in a blender and we probably don't care about real 
randomness here.

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/