mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Referencing to own CUE build for now
Fixed mousemat color processing
This commit is contained in:
parent
4b994ee061
commit
694ab834bd
@ -153,7 +153,7 @@
|
||||
</Reference>
|
||||
<Reference Include="CUE.NET, Version=1.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\CUE.NET\bin\CUE.NET.dll</HintPath>
|
||||
<HintPath>lib\CUE.NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="DeltaCompressionDotNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d14d6e5194e7f4a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.dll</HintPath>
|
||||
|
||||
@ -45,38 +45,38 @@ namespace Artemis.DeviceProviders.Corsair
|
||||
if (bitmap.Width != bitmap.Height)
|
||||
throw new ArgumentException("Bitmap must be a perfect square");
|
||||
|
||||
var yStep = (double) bitmap.Width/5;
|
||||
var xStep = (double) bitmap.Width/7;
|
||||
var yStep = (double) bitmap.Width/4;
|
||||
var xStep = (double) bitmap.Width/6;
|
||||
|
||||
// This approach will break if any mousemats with different LED amounts are released, for now it will do.
|
||||
using (bitmap)
|
||||
{
|
||||
var ledIndex = 1;
|
||||
var ledIndex = 0;
|
||||
// Color each LED according to one of the pixels
|
||||
foreach (var corsairLed in CueSDK.MousematSDK.Leds.OrderBy(l => l.ToString()))
|
||||
{
|
||||
Color col;
|
||||
// Left side
|
||||
if (ledIndex < 6)
|
||||
if (ledIndex < 5)
|
||||
{
|
||||
col = ledIndex != 5
|
||||
? bitmap.GetPixel(0, (int) (ledIndex*yStep + yStep/2))
|
||||
col = ledIndex == 0
|
||||
? bitmap.GetPixel(0, (int) (ledIndex*yStep))
|
||||
: bitmap.GetPixel(0, (int) (ledIndex*yStep) - 1);
|
||||
}
|
||||
// Bottom
|
||||
else if (ledIndex < 11)
|
||||
else if (ledIndex < 10)
|
||||
{
|
||||
// Start at index 2 because the corner belongs to the left side
|
||||
// Start at index 1 because the corner belongs to the left side
|
||||
var zoneIndex = ledIndex - 4;
|
||||
col = bitmap.GetPixel((int) (zoneIndex*xStep + xStep/2), 0);
|
||||
col = bitmap.GetPixel((int) (zoneIndex*xStep), 39);
|
||||
}
|
||||
// Right side
|
||||
else
|
||||
{
|
||||
var zoneIndex = ledIndex - 10;
|
||||
col = zoneIndex != 5
|
||||
? bitmap.GetPixel(0, bitmap.Height - ((int) (zoneIndex*yStep + yStep/2)))
|
||||
: bitmap.GetPixel(0, bitmap.Height - ((int) (zoneIndex*yStep) - 1));
|
||||
col = zoneIndex == 4
|
||||
? bitmap.GetPixel(39, 40 - (int) (zoneIndex*yStep))
|
||||
: bitmap.GetPixel(39, 39 - (int) (zoneIndex*yStep));
|
||||
}
|
||||
|
||||
corsairLed.Color = col;
|
||||
|
||||
@ -6,6 +6,7 @@ using Artemis.Managers;
|
||||
using Artemis.Models;
|
||||
using Artemis.Modules.Games.WoW.Data;
|
||||
using Artemis.Profiles.Layers.Models;
|
||||
using Artemis.Settings;
|
||||
using Artemis.Utilities.Memory;
|
||||
using Process.NET;
|
||||
|
||||
@ -22,7 +23,12 @@ namespace Artemis.Modules.Games.WoW
|
||||
Name = "WoW";
|
||||
ProcessName = "Wow-64";
|
||||
Scale = 4;
|
||||
Enabled = Settings.Enabled;
|
||||
|
||||
// Currently WoW is locked behind a hidden trigger (obviously not that hidden if you're reading this)
|
||||
// It is using memory reading and lets first try to contact Blizzard
|
||||
var settings = SettingsProvider.Load<GeneralSettings>();
|
||||
Enabled = settings.GamestatePort == 62575 && Settings.Enabled;
|
||||
|
||||
Initialized = false;
|
||||
|
||||
// TODO: Retrieve from GitHub
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
using System.Linq;
|
||||
using Artemis.DAL;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Modules.Effects.ProfilePreview;
|
||||
using Artemis.Modules.Games.WoW;
|
||||
using Artemis.Settings;
|
||||
using Artemis.ViewModels.Abstract;
|
||||
|
||||
namespace Artemis.ViewModels
|
||||
@ -23,8 +26,14 @@ namespace Artemis.ViewModels
|
||||
{
|
||||
base.OnActivate();
|
||||
|
||||
var settings = SettingsProvider.Load<GeneralSettings>();
|
||||
foreach (var gameViewModel in _gameViewModels.OrderBy(g => g.DisplayName))
|
||||
{
|
||||
if (settings.GamestatePort != 62575 && gameViewModel is WoWViewModel)
|
||||
continue;
|
||||
|
||||
ActivateItem(gameViewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Artemis/Artemis/lib/CUE.NET.dll
Normal file
BIN
Artemis/Artemis/lib/CUE.NET.dll
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user