Compare commits
2 Commits
Canary-1.2
...
Canary-1.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b6afa0ea2 | ||
|
|
3541e282ea |
@@ -5,18 +5,30 @@ namespace Ryujinx.Common.Utilities
|
|||||||
{
|
{
|
||||||
public class Rainbow
|
public class Rainbow
|
||||||
{
|
{
|
||||||
public const float Speed = 1;
|
public static float Speed { get; set; } = 1;
|
||||||
|
|
||||||
public static Color Color { get; private set; } = Color.Blue;
|
public static Color Color { get; private set; } = Color.Blue;
|
||||||
|
|
||||||
|
private static float _lastHue;
|
||||||
|
|
||||||
public static void Tick()
|
public static void Tick()
|
||||||
{
|
{
|
||||||
|
float currentHue = Color.GetHue();
|
||||||
|
float nextHue = currentHue;
|
||||||
|
|
||||||
|
if (currentHue >= 360)
|
||||||
|
nextHue = 0;
|
||||||
|
else
|
||||||
|
nextHue += Speed;
|
||||||
|
|
||||||
Color = HsbToRgb(
|
Color = HsbToRgb(
|
||||||
(Color.GetHue() + Speed) / 360,
|
nextHue / 360,
|
||||||
1,
|
1,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
|
|
||||||
|
_lastHue = currentHue;
|
||||||
|
|
||||||
RainbowColorUpdated?.Invoke(Color.ToArgb());
|
RainbowColorUpdated?.Invoke(Color.ToArgb());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -226,6 +226,13 @@ namespace Ryujinx.Input.SDL2
|
|||||||
|
|
||||||
private static Vector3 GsToMs2(Vector3 gs) => gs / SDL_STANDARD_GRAVITY;
|
private static Vector3 GsToMs2(Vector3 gs) => gs / SDL_STANDARD_GRAVITY;
|
||||||
|
|
||||||
|
private void RainbowColorChanged(int packedRgb)
|
||||||
|
{
|
||||||
|
if (!_configuration.Led.UseRainbow) return;
|
||||||
|
|
||||||
|
SetLed((uint)packedRgb);
|
||||||
|
}
|
||||||
|
|
||||||
public void SetConfiguration(InputConfig configuration)
|
public void SetConfiguration(InputConfig configuration)
|
||||||
{
|
{
|
||||||
lock (_userMappingLock)
|
lock (_userMappingLock)
|
||||||
@@ -237,10 +244,12 @@ namespace Ryujinx.Input.SDL2
|
|||||||
if (_configuration.Led.TurnOffLed)
|
if (_configuration.Led.TurnOffLed)
|
||||||
(this as IGamepad).ClearLed();
|
(this as IGamepad).ClearLed();
|
||||||
else if (_configuration.Led.UseRainbow)
|
else if (_configuration.Led.UseRainbow)
|
||||||
Rainbow.RainbowColorUpdated += clr => SetLed((uint)clr);
|
Rainbow.RainbowColorUpdated += RainbowColorChanged;
|
||||||
else
|
else
|
||||||
SetLed(_configuration.Led.LedColor);
|
SetLed(_configuration.Led.LedColor);
|
||||||
|
|
||||||
|
if (!_configuration.Led.UseRainbow)
|
||||||
|
Rainbow.RainbowColorUpdated -= RainbowColorChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
_buttonsUserMapping.Clear();
|
_buttonsUserMapping.Clear();
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ namespace Ryujinx.Ava
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger.Info?.Print(LogClass.Application, "Up to date.");
|
||||||
|
|
||||||
_running = false;
|
_running = false;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -189,6 +191,8 @@ namespace Ryujinx.Ava
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger.Info?.Print(LogClass.Application, "Up to date.");
|
||||||
|
|
||||||
_running = false;
|
_running = false;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user