Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
RazerMousepad.cs
Go to the documentation of this file.
1
using
Microsoft.Xna.Framework
;
2
3
namespace
ReLogic.Peripherals.RGB.Razer
;
4
5
internal
class
RazerMousepad
:
RgbDevice
6
{
7
private
NativeMethods.CustomMousepadEffect
_effect
=
NativeMethods
.
CustomMousepadEffect
.
Create
();
8
9
private
readonly
EffectHandle
_handle
=
new
EffectHandle
();
10
11
public
RazerMousepad
(
DeviceColorProfile
colorProfile)
12
: base(
RgbDeviceVendor
.Razer,
RgbDeviceType
.
Mousepad
,
Fragment
.FromCustom(
CreatePositionList
()), colorProfile)
13
{
14
}
15
16
private
static
Point
[]
CreatePositionList
()
17
{
18
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
19
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
20
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
21
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
22
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
23
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
24
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
25
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
26
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
27
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
28
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
29
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
30
Point
[] array = (
Point
[])(
object
)
new
Point
[15];
31
Point
point =
default
(
Point
);
32
((
Point
)(ref point))._002Ector(26, 0);
33
for
(
int
i = 0; i < 5; i++)
34
{
35
array[i] =
new
Point
(point.
X
, point.
Y
+ i);
36
array[14 - i] =
new
Point
(point.
X
+ 6, point.
Y
+ i);
37
}
38
for
(
int
j = 5; j < 10; j++)
39
{
40
array[j] =
new
Point
(j - 5 + point.
X
+ 1, point.
Y
+ 5);
41
}
42
return
array;
43
}
44
45
public
override
void
Present
()
46
{
47
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
48
for
(
int
i = 0; i < base.LedCount; i++)
49
{
50
_effect
.Color[i] =
RazerHelper
.
Vector4ToDeviceColor
(
GetProcessedLedColor
(i));
51
}
52
_handle
.
SetAsMousepadEffect
(ref
_effect
);
53
_handle
.
Apply
();
54
}
55
}
ReLogic.Peripherals.RGB.DeviceColorProfile
Definition
DeviceColorProfile.cs:7
ReLogic.Peripherals.RGB.Fragment
Definition
Fragment.cs:7
ReLogic.Peripherals.RGB.Razer.EffectHandle.Apply
void Apply()
Definition
EffectHandle.cs:54
ReLogic.Peripherals.RGB.Razer.EffectHandle.SetAsMousepadEffect
void SetAsMousepadEffect(ref NativeMethods.CustomMousepadEffect effect)
Definition
EffectHandle.cs:27
ReLogic.Peripherals.RGB.Razer.EffectHandle
Definition
EffectHandle.cs:6
ReLogic.Peripherals.RGB.Razer.NativeMethods
Definition
NativeMethods.cs:7
ReLogic.Peripherals.RGB.Razer.RazerHelper.Vector4ToDeviceColor
static uint Vector4ToDeviceColor(Vector4 color)
Definition
RazerHelper.cs:7
ReLogic.Peripherals.RGB.Razer.RazerHelper
Definition
RazerHelper.cs:6
ReLogic.Peripherals.RGB.Razer.RazerMousepad.CreatePositionList
static Point[] CreatePositionList()
Definition
RazerMousepad.cs:16
ReLogic.Peripherals.RGB.Razer.RazerMousepad._handle
readonly EffectHandle _handle
Definition
RazerMousepad.cs:9
ReLogic.Peripherals.RGB.Razer.RazerMousepad.RazerMousepad
RazerMousepad(DeviceColorProfile colorProfile)
Definition
RazerMousepad.cs:11
ReLogic.Peripherals.RGB.Razer.RazerMousepad.Present
override void Present()
Definition
RazerMousepad.cs:45
ReLogic.Peripherals.RGB.Razer.RazerMousepad._effect
NativeMethods.CustomMousepadEffect _effect
Definition
RazerMousepad.cs:7
ReLogic.Peripherals.RGB.Razer.RazerMousepad
Definition
RazerMousepad.cs:6
ReLogic.Peripherals.RGB.RgbDevice.GetProcessedLedColor
Vector4 GetProcessedLedColor(int index)
Definition
RgbDevice.cs:37
ReLogic.Peripherals.RGB.RgbDevice
Definition
RgbDevice.cs:7
Microsoft.Xna.Framework
Definition
AlphaTestEffect.cs:1
ReLogic.Peripherals.RGB.Razer
Definition
EffectHandle.cs:3
ReLogic.Peripherals.RGB.RgbDeviceVendor
RgbDeviceVendor
Definition
RgbDeviceVendor.cs:4
ReLogic.Peripherals.RGB.RgbDeviceType
RgbDeviceType
Definition
RgbDeviceType.cs:4
ReLogic.Peripherals.RGB.RgbDeviceType.Mousepad
@ Mousepad
Microsoft.Xna.Framework.Point.X
int X
Definition
Point.cs:14
Microsoft.Xna.Framework.Point.Y
int Y
Definition
Point.cs:17
Microsoft.Xna.Framework.Point
Definition
Point.cs:12
ReLogic.Peripherals.RGB.Razer.NativeMethods.CustomMousepadEffect.Create
static CustomMousepadEffect Create()
Definition
NativeMethods.cs:132
ReLogic.Peripherals.RGB.Razer.NativeMethods.CustomMousepadEffect
Definition
NativeMethods.cs:126
source
ReLogic
ReLogic.Peripherals.RGB.Razer
RazerMousepad.cs
Generated by
1.10.0