Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

fix deterministic initialization (#2273)

otakutoe1f79e0948a8
diff --git a/toonz/sources/stdfx/iwa_particles.cpp b/toonz/sources/stdfx/iwa_particles.cpp
index d7b28b287..9f8910be7 100644
--- a/toonz/sources/stdfx/iwa_particles.cpp
+++ b/toonz/sources/stdfx/iwa_particles.cpp
@@ -232,9 +232,9 @@ void Iwa_Particle::create_Swing(const particles_values &values,
random.getFloat() * (ranges.rotsca_range)));
smperioda = changesigna;
}
- signx = random.getInt(0, 1) > 0 ? 1 : -1;
- signy = random.getInt(0, 1) > 0 ? 1 : -1;
- signa = random.getInt(0, 1) > 0 ? 1 : -1;
+ signx = random.getBool() ? 1 : -1;
+ signy = random.getBool() ? 1 : -1;
+ signa = random.getBool() ? 1 : -1;
}
/*-----------------------------------------------------------------*/
diff --git a/toonz/sources/stdfx/particles.cpp b/toonz/sources/stdfx/particles.cpp
index 2bb9666be..b2e4e6aaa 100644
--- a/toonz/sources/stdfx/particles.cpp
+++ b/toonz/sources/stdfx/particles.cpp
@@ -249,9 +249,9 @@ void Particle::create_Swing(const particles_values &values,
random.getFloat() * (ranges.rotsca_range)));
smperioda = changesigna;
}
- signx = random.getInt(0, 1) > 0 ? 1 : -1;
- signy = random.getInt(0, 1) > 0 ? 1 : -1;
- signa = random.getInt(0, 1) > 0 ? 1 : -1;
+ signx = random.getBool() ? 1 : -1;
+ signy = random.getBool() ? 1 : -1;
+ signa = random.getBool() ? 1 : -1;
}
/*-----------------------------------------------------------------*/