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

CoolerMaster - Fix slow device updates

This commit is contained in:
SpoinkyNL 2020-08-13 00:40:46 +02:00
parent 4927d76e21
commit 2d833fb800

View File

@ -13,6 +13,7 @@ namespace RGB.NET.Devices.CoolerMaster
#region Properties & Fields
private CoolerMasterDevicesIndexes _deviceIndex;
private _CoolerMasterColorMatrix _deviceMatrix;
#endregion
@ -27,6 +28,9 @@ namespace RGB.NET.Devices.CoolerMaster
: base(updateTrigger)
{
this._deviceIndex = deviceIndex;
this._deviceMatrix = new _CoolerMasterColorMatrix();
_deviceMatrix.KeyColor = new _CoolerMasterKeyColor[_CoolerMasterColorMatrix.ROWS, _CoolerMasterColorMatrix.COLUMNS];
}
#endregion
@ -39,10 +43,10 @@ namespace RGB.NET.Devices.CoolerMaster
foreach (KeyValuePair<object, Color> data in dataSet)
{
(int row, int column) = ((int, int))data.Key;
_CoolerMasterSDK.SetLedColor(row, column, data.Value.GetR(), data.Value.GetG(), data.Value.GetB(), _deviceIndex);
_deviceMatrix.KeyColor[row, column] = new _CoolerMasterKeyColor(data.Value.GetR(), data.Value.GetG(), data.Value.GetB());
}
_CoolerMasterSDK.RefreshLed(false, _deviceIndex);
_CoolerMasterSDK.SetAllLedColor(_deviceMatrix, _deviceIndex);
}
#endregion