Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f6ab77c

Browse files
committed
Build: avoid win32-incompatible functions
1 parent 3d17d95 commit f6ab77c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/path_converters.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -866,8 +866,10 @@ class Sketch
866866
if (m_has_last) {
867867
// We want the "cursor" along the sine wave to move at a
868868
// random rate.
869-
m_p += pow(m_randomness, drand48() * 2.0 - 1.0);
870-
double r = sin(m_p / (m_length / (M_PI * 2.0))) * m_scale;
869+
float _drand48 = rand() / float(RAND_MAX);
870+
float _M_PI = 3.14159265358979323846;
871+
m_p += pow(m_randomness, _drand48 * 2.0 - 1.0);
872+
double r = sin(m_p / (m_length / (_M_PI * 2.0))) * m_scale;
871873
double den = m_last_x - *x;
872874
double num = m_last_y - *y;
873875
double len = num*num + den*den;
@@ -891,8 +893,7 @@ class Sketch
891893
inline void
892894
rewind(unsigned path_id)
893895
{
894-
unsigned short seed[] = {0, 0, 0};
895-
seed48(seed);
896+
srand(0);
896897
m_has_last = false;
897898
m_p = 0.0;
898899
if (m_scale != 0.0) {

0 commit comments

Comments
 (0)