Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
NativeMethods.cs
Go to the documentation of this file.
1using System;
3
5
6internal class NativeMethods
7{
9 {
10 None,
12 Custom,
14 Static,
16 Wave,
20 }
21
23 {
24 public const int Rows = 6;
25
26 public const int Columns = 22;
27
28 public const int MaxKeys = 132;
29
30 public const uint KeyFlag = 16777216u;
31
32 public const uint ColorMask = 16777215u;
33
34 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 132)]
35 public readonly uint[] Color;
36
37 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 132)]
38 public readonly uint[] Key;
39
41 {
42 return new CustomKeyboardEffect(132);
43 }
44
45 private CustomKeyboardEffect(int size)
46 {
47 Color = new uint[size];
48 Key = new uint[size];
49 }
50 }
51
52 public enum MouseEffectType
53 {
54 None,
57 Custom,
60 Static,
61 Wave,
62 Custom2,
64 }
65
66 public struct CustomMouseEffect
67 {
68 public const int Rows = 9;
69
70 public const int Columns = 7;
71
72 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)]
73 public readonly uint[] Color;
74
75 public static CustomMouseEffect Create()
76 {
77 return new CustomMouseEffect(63);
78 }
79
80 private CustomMouseEffect(int size)
81 {
82 Color = new uint[size];
83 }
84 }
85
87 {
88 None,
89 Static,
92 Custom,
94 }
95
96 public struct CustomHeadsetEffect
97 {
98 public const int Leds = 5;
99
100 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
101 public readonly uint[] Color;
102
104 {
105 return new CustomHeadsetEffect(5);
106 }
107
108 private CustomHeadsetEffect(int size)
109 {
110 Color = new uint[size];
111 }
112 }
113
115 {
116 None,
117 Breathing,
118 Custom,
120 Static,
121 Wave,
122 Invalid
123 }
124
126 {
127 public const int Leds = 15;
128
129 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)]
130 public readonly uint[] Color;
131
133 {
134 return new CustomMousepadEffect(15);
135 }
136
137 private CustomMousepadEffect(int size)
138 {
139 Color = new uint[size];
140 }
141 }
142
144 {
145 None,
146 Breathing,
147 Custom,
148 Reactive,
150 Static,
151 Wave,
152 Invalid
153 }
154
155 public struct CustomKeypadEffect
156 {
157 public const int Rows = 4;
158
159 public const int Columns = 5;
160
161 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
162 public readonly uint[] Color;
163
165 {
166 return new CustomKeypadEffect(20);
167 }
168
169 private CustomKeypadEffect(int size)
170 {
171 Color = new uint[size];
172 }
173 }
174
176 {
177 None,
178 Custom,
179 Static,
180 Invalid
181 }
182
184 {
185 public const int Leds = 5;
186
187 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
188 public readonly uint[] Color;
189
191 {
192 return new CustomChromaLinkEffect(5);
193 }
194
195 private CustomChromaLinkEffect(int size)
196 {
197 Color = new uint[size];
198 }
199 }
200
201 public const string DLL_NAME = "RzChromaSDK64.dll";
202
203 [DllImport("RzChromaSDK64.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
204 public static extern RzResult Init();
205
206 [DllImport("RzChromaSDK64.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
207 public static extern RzResult UnInit();
208
209 [DllImport("RzChromaSDK64.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
210 public static extern RzResult CreateKeyboardEffect(KeyboardEffectType effect, ref CustomKeyboardEffect effectData, ref Guid effectId);
211
212 [DllImport("RzChromaSDK64.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
213 public static extern RzResult CreateMouseEffect(MouseEffectType effect, ref CustomMouseEffect effectData, ref Guid effectId);
214
215 [DllImport("RzChromaSDK64.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
216 public static extern RzResult CreateHeadsetEffect(HeadsetEffectType effect, ref CustomHeadsetEffect effectData, ref Guid effectId);
217
218 [DllImport("RzChromaSDK64.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
219 public static extern RzResult CreateMousepadEffect(MousepadEffectType effect, ref CustomMousepadEffect effectData, ref Guid effectId);
220
221 [DllImport("RzChromaSDK64.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
222 public static extern RzResult CreateKeypadEffect(KeypadEffectType effect, ref CustomKeypadEffect effectData, ref Guid effectId);
223
224 [DllImport("RzChromaSDK64.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
225 public static extern RzResult CreateChromaLinkEffect(ChromaLinkEffectType effect, ref CustomChromaLinkEffect effectData, ref Guid effectId);
226
227 [DllImport("RzChromaSDK64.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
228 public static extern RzResult DeleteEffect(Guid effectId);
229
230 [DllImport("RzChromaSDK64.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
231 public static extern RzResult SetEffect(Guid effectId);
232}
static RzResult DeleteEffect(Guid effectId)
static RzResult CreateKeypadEffect(KeypadEffectType effect, ref CustomKeypadEffect effectData, ref Guid effectId)
static RzResult SetEffect(Guid effectId)
static RzResult CreateKeyboardEffect(KeyboardEffectType effect, ref CustomKeyboardEffect effectData, ref Guid effectId)
static RzResult CreateMouseEffect(MouseEffectType effect, ref CustomMouseEffect effectData, ref Guid effectId)
static RzResult CreateChromaLinkEffect(ChromaLinkEffectType effect, ref CustomChromaLinkEffect effectData, ref Guid effectId)
static RzResult CreateHeadsetEffect(HeadsetEffectType effect, ref CustomHeadsetEffect effectData, ref Guid effectId)
static RzResult CreateMousepadEffect(MousepadEffectType effect, ref CustomMousepadEffect effectData, ref Guid effectId)