Add ParticleSystem, fix incorrect Argb conversion in Color, remove byte casting in LerpColor, update TestGame to demostrate particle system.

This commit is contained in:
2024-10-14 22:05:47 +02:00
parent e676e3d13d
commit a1d282908a
6 changed files with 247 additions and 216 deletions

View File

@@ -37,21 +37,18 @@ namespace Voile
public float R { get; set; }
public float G { get; set; }
public float B { get; set; }
public float A { get; set; }
public float A { get; set; } = 1.0f;
public int Argb
{
get
{
int c = (ushort)Math.Round(A * 255f);
c <<= 8;
c |= (ushort)Math.Round(R * 255f);
c <<= 8;
c |= (ushort)Math.Round(G * 255f);
c <<= 8;
c |= (ushort)Math.Round(B * 255f);
int a = (int)Math.Round(A * 255f) << 24;
int r = (int)Math.Round(R * 255f) << 16;
int g = (int)Math.Round(G * 255f) << 8;
int b = (int)Math.Round(B * 255f);
return c;
return a | r | g | b;
}
}