Move RTSSSharedMemoryNET to CommonHelpers

This commit is contained in:
Kamil Trzciński 2022-11-15 21:09:14 +01:00
parent f9572edc79
commit b442c6fadc
5 changed files with 37 additions and 8 deletions

View file

@ -12,10 +12,19 @@
<PackageReference Include="TaskScheduler" Version="2.10.1" />
</ItemGroup>
<ItemGroup>
<Reference Include="RTSSSharedMemoryNET">
<HintPath>RTSSSharedMemoryNET.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Update="inpoutx64.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="RTSSSharedMemoryNET.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

View file

@ -0,0 +1,26 @@
using RTSSSharedMemoryNET;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CommonHelpers
{
public static class OSDHelpers
{
public static uint OSDIndex(this OSD? osd)
{
if (osd is null)
return uint.MaxValue;
var osdSlot = typeof(OSD).GetField("m_osdSlot",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
var value = osdSlot.GetValue(osd);
if (value is null)
return uint.MaxValue;
return (uint)value;
}
}
}

View file

@ -33,7 +33,7 @@
<ItemGroup>
<Reference Include="RTSSSharedMemoryNET">
<HintPath>RTSSSharedMemoryNET.dll</HintPath>
<HintPath>..\CommonHelpers\RTSSSharedMemoryNET.dll</HintPath>
</Reference>
</ItemGroup>
@ -58,9 +58,6 @@
</ItemGroup>
<ItemGroup>
<None Update="RTSSSharedMemoryNET.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

View file

@ -35,11 +35,8 @@
<Reference Include="hidapi.net">
<HintPath>hidapi.net.dll</HintPath>
</Reference>
<Reference Include="neptune-hidapi.net">
<HintPath>NeptuneHid\neptune-hidapi.net.dll</HintPath>
</Reference>
<Reference Include="RTSSSharedMemoryNET">
<HintPath>..\PerformanceOverlay\RTSSSharedMemoryNET.dll</HintPath>
<HintPath>..\CommonHelpers\RTSSSharedMemoryNET.dll</HintPath>
</Reference>
</ItemGroup>