Reference local build of RGB.NET

Rewrote UI LED-rendering, performance needs some work
This commit is contained in:
SpoinkyNL committed 2019-08-19 22:03:37 +02:00
1 parent f0db2d7942
commit b3e035cfb3
20 files changed
+169 -132

No files matched your search

@@ -39,7 +39,8 @@
<HintPath>..\packages\QRCoder.1.3.5\lib\net40\QRCoder.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Core, Version=0.1.25.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Core.0.1.25\lib\net45\RGB.NET.Core.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\RGB.NET\bin\net45\RGB.NET.Core.dll</HintPath>
</Reference>
<Reference Include="Stylet, Version=1.1.17.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Stylet.1.1.17\lib\net45\Stylet.dll</HintPath>
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Drawing;
using Artemis.Core;
using Artemis.Core.Extensions;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces;
@@ -57,12 +58,12 @@ namespace Artemis.Plugins.Modules.General
public override void Render(double deltaTime, RGBSurface surface, Graphics graphics)
{
_circlePosition += deltaTime * 200;
if (_circlePosition > 500)
_circlePosition = -200;
var rect = new Rectangle((int) _circlePosition * 4, 0 , 200, 200);
graphics.FillEllipse(new SolidBrush(Color.Blue), rect);
return;
// _circlePosition += deltaTime * 200;
// if (_circlePosition > 500)
// _circlePosition = -200;
// var rect = new Rectangle((int) _circlePosition * 4, 0 , 200, 200);
// graphics.FillEllipse(new SolidBrush(Color.Blue), rect);
// return;
// Lets do this in the least performant way possible
foreach (var surfaceLed in _surface.Leds)
@@ -71,7 +72,7 @@ namespace Artemis.Plugins.Modules.General
continue;
var brush = new SolidBrush(_colors[surfaceLed]);
var rectangle = new Rectangle((int) surfaceLed.LedRectangle.X, (int) surfaceLed.LedRectangle.Y, (int) surfaceLed.LedRectangle.Width, (int) surfaceLed.LedRectangle.Height);
var rectangle = surfaceLed.AbsoluteLedRectangle.ToDrawingRectangle();
graphics.FillRectangle(brush, rectangle);
UpdateLedColor(surfaceLed, deltaTime);
}
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="QRCoder" version="1.3.5" targetFramework="net461" />
<package id="RGB.NET.Core" version="0.1.25" targetFramework="net472" />
<package id="Stylet" version="1.1.17" targetFramework="net461" />
<package id="System.Drawing.Common" version="4.5.0" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />