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

Merge pull request #147 from DarthAffe/SDK/CoolerMaster

CoolerMaster - Fix slow device updates
This commit is contained in:
DarthAffe 2020-08-13 10:51:14 +02:00 committed by GitHub
commit 33f896e17d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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