Added a layer of abstraction between RGB.NET and Artemis

This means Artemis can add extra functionality
It also avoid having to reference RGB.NET for basic rendering
Implemented rendering scaling
This commit is contained in:
SpoinkyNL committed 2019-10-30 23:20:06 +01:00
1 parent 498b6a6111
commit 8777e8975f
41 files changed
+725 -494

No files matched your search

@@ -0,0 +1,20 @@
using RGB.NET.Core;
namespace Artemis.Core.Extensions
{
public static class RgbDeviceExtensions
{
public static int GetDeviceHashCode(this IRGBDevice rgbDevice)
{
unchecked
{
var hashCode = rgbDevice.DeviceInfo.DeviceName?.GetHashCode() ?? 0;
hashCode = (hashCode * 397) ^ (rgbDevice.DeviceInfo.Manufacturer?.GetHashCode() ?? 0);
hashCode = (hashCode * 397) ^ (rgbDevice.DeviceInfo.Model?.GetHashCode() ?? 0);
hashCode = (hashCode * 397) ^ (int) rgbDevice.DeviceInfo.DeviceType;
hashCode = (hashCode * 397) ^ (int) rgbDevice.DeviceInfo.Lighting;
return hashCode;
}
}
}
}