1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-13 10:08:31 +00:00

Compare commits

..

6 Commits

Author SHA1 Message Date
RobertBeekman
02843705a8
Merge pull request #226 from DarthAffe/SDK/ASUS
ASUS - Keep local arrays of lights in an attempt to fix crashes
2021-09-27 19:57:18 +02:00
Robert
21b2f774c4 Merge branch 'Development' into SDK/ASUS 2021-09-19 09:47:08 +02:00
Robert
ecf880d297 ASUS - Only keep local arrays of lights in an attempt to fix crashes 2021-09-03 21:57:11 +02:00
Robert
e73fb45503 Merge remote-tracking branch 'origin/SDK/ASUS' into SDK/ASUS 2021-09-01 20:18:53 +02:00
Robert
06f46811f4 ASUS - Keep local arrays of keys and lights in an attempt to fix crashes 2021-09-01 20:18:44 +02:00
Robert
7520147ff8 ASUS - Keep local arrays of keys and lights in an attempt to fix crashes 2021-07-26 09:12:29 +02:00

View File

@ -12,6 +12,8 @@ namespace RGB.NET.Devices.Asus
{
#region Properties & Fields
private readonly IAuraRgbLight[] _lights;
/// <summary>
/// The device to be updated.
/// </summary>
@ -30,6 +32,10 @@ namespace RGB.NET.Devices.Asus
: base(updateTrigger)
{
this.Device = device;
this._lights = new IAuraRgbLight[device.Lights.Count];
for (int i = 0; i < device.Lights.Count; i++)
_lights[i] = device.Lights[i];
}
#endregion
@ -59,7 +65,7 @@ namespace RGB.NET.Devices.Asus
}
else
{
IAuraRgbLight light = keyboard.Lights[id];
IAuraRgbLight light = _lights[id];
(_, byte r, byte g, byte b) = value.GetRGBBytes();
light.Red = r;
light.Green = g;
@ -72,7 +78,7 @@ namespace RGB.NET.Devices.Asus
foreach ((object key, Color value) in dataSet)
{
int index = (int)key;
IAuraRgbLight light = Device.Lights[index];
IAuraRgbLight light = _lights[index];
(_, byte r, byte g, byte b) = value.GetRGBBytes();
light.Red = r;