daily update on 20240513 by nitload youmu, instancing render added
This commit is contained in:
@@ -44,13 +44,7 @@ namespace StgSharp.Math
|
||||
public static unsafe partial class Scaler
|
||||
{
|
||||
|
||||
internal static float currentSeed
|
||||
#if DEBUG
|
||||
= 0.5f;
|
||||
#else
|
||||
= Abs(System.DateTime.UtcNow.GetHashCode());
|
||||
#endif
|
||||
|
||||
private static byte[] randomSeed;
|
||||
|
||||
/// <summary>
|
||||
/// returns a random float number between 0 and 1.
|
||||
@@ -82,8 +76,6 @@ namespace StgSharp.Math
|
||||
|
||||
}
|
||||
|
||||
private static byte[] randomSeed;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -94,13 +86,13 @@ namespace StgSharp.Math
|
||||
,INumber
|
||||
#endif
|
||||
{
|
||||
if (randomSeed==null)
|
||||
if (randomSeed == null)
|
||||
{
|
||||
randomSeed = new byte[64];
|
||||
var originSeed =
|
||||
$"{(Assembly.GetEntryAssembly()==null? Assembly.GetAssembly(typeof(StgSharp))!:
|
||||
Assembly.GetEntryAssembly())}" +
|
||||
$"{DateTime.UtcNow.ToString("o")}";
|
||||
string originSeed =
|
||||
($"{((Assembly.GetEntryAssembly() == null) ? (Assembly.GetAssembly(typeof(StgSharp))!) :
|
||||
Assembly.GetEntryAssembly())}") +
|
||||
($"{DateTime.UtcNow.ToString("o")}");
|
||||
using (SHA256 sha = SHA256.Create())
|
||||
{
|
||||
randomSeed = sha.ComputeHash(Encoding.UTF8.GetBytes(originSeed));
|
||||
@@ -131,5 +123,13 @@ namespace StgSharp.Math
|
||||
return *(int*)&seedValue;
|
||||
}
|
||||
|
||||
internal static float currentSeed
|
||||
#if DEBUG
|
||||
= 0.5f;
|
||||
#else
|
||||
= Abs(System.DateTime.UtcNow.GetHashCode());
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user