Use a real random number generator instead of using a time hack. Add myself to
authors. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40112 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -4,13 +4,14 @@
|
|||||||
*
|
*
|
||||||
* Authors:
|
* Authors:
|
||||||
* Geoffry Song, [email protected]
|
* Geoffry Song, [email protected]
|
||||||
|
* Ryan Leavengood, [email protected]
|
||||||
*/
|
*/
|
||||||
#include "Butterfly.h"
|
#include "Butterfly.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
|
#include <OS.h>
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
|
|
||||||
#include <BuildScreenSaverDefaultSettingsView.h>
|
#include <BuildScreenSaverDefaultSettingsView.h>
|
||||||
@@ -50,9 +51,10 @@ Butterfly::StartSaver(BView* view, bool preview)
|
|||||||
|
|
||||||
SetTickSize(20000);
|
SetTickSize(20000);
|
||||||
|
|
||||||
struct timeval tv;
|
// Set fBase to a random radian value scaled by 1000. The scaling produces
|
||||||
gettimeofday(&tv, NULL);
|
// more interesting results.
|
||||||
fBase = tv.tv_usec * 0.01f;
|
srand48(system_time());
|
||||||
|
fBase = drand48() * 2 * M_PI * 1000;
|
||||||
|
|
||||||
// calculate transformation
|
// calculate transformation
|
||||||
BRect bounds = view->Bounds();
|
BRect bounds = view->Bounds();
|
||||||
|
|||||||
Reference in New Issue
Block a user