28.10.2020
SM.Core: + Particle System + scriptable system for scripts ~ Moved Texts- and Particles-namespace to SM.Base.Drawing ~ Changed how you tell the stopwatch to pause. (From method to property) ~ Fixed Randomize.GetFloat(min, max) ~ Now automaticly adds the DrawingBase.Transformation to DrawContext.ModelMatrix. No need to change DrawContext.Instances[0], anymore. SM.OGL: + "one-file-shader"-support SM2D: + DrawParticles (Control for Texture and Color not there yet) ~ Changed coordnate system to upper-right as (1,1) ~ Changed default shader to "one-file-shader"
This commit is contained in:
parent
03b3942732
commit
beb9c19081
45 changed files with 580 additions and 190 deletions
|
|
@ -1,6 +1,9 @@
|
|||
#region usings
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
@ -9,7 +12,7 @@ namespace SM.Utility
|
|||
/// <summary>
|
||||
/// A global helper class for randomization.
|
||||
/// </summary>
|
||||
public class Randomize
|
||||
public static class Randomize
|
||||
{
|
||||
/// <summary>
|
||||
/// The randomizer.
|
||||
|
|
@ -78,7 +81,12 @@ namespace SM.Utility
|
|||
/// </summary>
|
||||
public static float GetFloat(float min, float max)
|
||||
{
|
||||
return (float) Randomizer.NextDouble() * max + min;
|
||||
return (float) Randomizer.NextDouble() * (max - min) + min;
|
||||
}
|
||||
|
||||
public static TSource GetRandomItem<TSource>(this IList<TSource> list)
|
||||
{
|
||||
return list[GetInt(0, list.Count - 1)];
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue