terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
NativeInputDevice.cs
Go to the documentation of this file.
1using System;
4
5namespace InControl
6{
7 // Token: 0x0200003D RID: 61
9 {
10 // Token: 0x1700010A RID: 266
11 // (get) Token: 0x0600032D RID: 813 RVA: 0x000096EC File Offset: 0x000078EC
12 // (set) Token: 0x0600032E RID: 814 RVA: 0x00009700 File Offset: 0x00007900
13 public uint Handle
14 {
16 get
17 {
18 return this.<Handle>k__BackingField;
19 }
21 private set
22 {
24 }
25 }
26
27 // Token: 0x1700010B RID: 267
28 // (get) Token: 0x0600032F RID: 815 RVA: 0x00009714 File Offset: 0x00007914
29 // (set) Token: 0x06000330 RID: 816 RVA: 0x00009748 File Offset: 0x00007948
31 {
33 get
34 {
35 string serialNumber = this.<Info>k__BackingField.serialNumber;
36 string name = this.<Info>k__BackingField.name;
38 inputDeviceInfo.serialNumber = serialNumber;
40 return inputDeviceInfo;
41 }
43 private set
44 {
45 string serialNumber = value.serialNumber;
46 this.<Info>k__BackingField.serialNumber = serialNumber;
47 }
48 }
49
50 // Token: 0x06000331 RID: 817 RVA: 0x00009768 File Offset: 0x00007968
52 {
53 if (!true)
54 {
55 }
56 base..ctor();
57 }
58
59 // Token: 0x06000332 RID: 818 RVA: 0x00009780 File Offset: 0x00007980
61 {
62 int num = 1;
64 string serialNumber = deviceInfo.serialNumber;
66 this.<Info>k__BackingField.serialNumber = serialNumber;
67 this.<SortOrder>k__BackingField = num;
68 uint numAnalogs = this.<Info>k__BackingField.numAnalogs;
69 int num2;
71 int num3 = 20;
72 int num4 = Math.Min((int)numAnalogs, num3);
74 uint numButtons = this.<Info>k__BackingField.numButtons;
75 uint numAnalogs2 = this.<Info>k__BackingField.numAnalogs;
76 base.ClearInputState();
77 base.ClearControls();
80 string deviceName = inputDeviceProfile.deviceName;
81 this.<Name>k__BackingField = this;
82 string text2;
83 string text = text2.Trim();
85 this.<Name>k__BackingField = text;
87 if (inputDeviceProfile2.deviceNotes == null)
88 {
90 }
91 this.<Meta>k__BackingField = inputDeviceInfo2;
92 InputDeviceClass deviceClass = inputDeviceProfile2.deviceClass;
93 bool invert = inputDeviceProfile2.analogMappings.invert;
94 string deviceNotes = inputDeviceProfile2.deviceNotes;
95 float sensitivity = this.profile.sensitivity;
96 float lowerDeadZone = this.profile.lowerDeadZone;
98 float upperDeadZone = inputDeviceProfile3.upperDeadZone;
102 InputControlMapping[] analogMappings = this.profile.analogMappings;
103 }
104
105 // Token: 0x06000333 RID: 819 RVA: 0x00009950 File Offset: 0x00007B50
107 {
108 string serialNumber = deviceInfo.serialNumber;
110 this.Initialize(deviceHandle, deviceInfo, inputDeviceProfile);
111 }
112
113 // Token: 0x06000334 RID: 820 RVA: 0x00009974 File Offset: 0x00007B74
114 public override void Update(ulong updateTick, float deltaTime)
115 {
116 int num = this.skipUpdateFrames;
118 }
119
120 // Token: 0x06000335 RID: 821 RVA: 0x00009A1C File Offset: 0x00007C1C
121 public override bool ReadRawButtonState(int index)
122 {
123 /*
124An exception occurred when decompiling this method (06000335)
125
126ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean InControl.NativeInputDevice::ReadRawButtonState(System.Int32)
127
128 ---> System.Exception: Basic block has to end with unconditional control flow.
129{
130 Block_0:
131 stloc:int16[](var_0_06, ldfld:int16[](NativeInputDevice::buttons, ldloc:NativeInputDevice(this)))
132}
133
134 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
135 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
136 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
137 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
138 --- End of inner exception stack trace ---
139 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
140 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
141*/;
142 }
143
144 // Token: 0x06000336 RID: 822 RVA: 0x00009A34 File Offset: 0x00007C34
145 public override float ReadRawAnalogValue(int index)
146 {
147 /*
148An exception occurred when decompiling this method (06000336)
149
150ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Single InControl.NativeInputDevice::ReadRawAnalogValue(System.Int32)
151
152 ---> System.Exception: Basic block has to end with unconditional control flow.
153{
154 Block_0:
155 stloc:int16[](var_0_06, ldfld:int16[](NativeInputDevice::analogs, ldloc:NativeInputDevice(this)))
156}
157
158 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
159 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
160 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
161 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
162 --- End of inner exception stack trace ---
163 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
164 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
165*/;
166 }
167
168 // Token: 0x06000337 RID: 823 RVA: 0x000025E1 File Offset: 0x000007E1
169 private static byte FloatToByte(float value)
170 {
171 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
172 }
173
174 // Token: 0x06000338 RID: 824 RVA: 0x00009A48 File Offset: 0x00007C48
175 public override void Vibrate(float leftMotor, float rightMotor)
176 {
177 }
178
179 // Token: 0x06000339 RID: 825 RVA: 0x00009A58 File Offset: 0x00007C58
180 public override void SetLightColor(float red, float green, float blue)
181 {
182 }
183
184 // Token: 0x0600033A RID: 826 RVA: 0x00009A68 File Offset: 0x00007C68
185 public override void SetLightFlash(float flashOnDuration, float flashOffDuration)
186 {
187 }
188
189 // Token: 0x0600033B RID: 827 RVA: 0x00009A78 File Offset: 0x00007C78
191 {
192 string serialNumber = this.<Info>k__BackingField.serialNumber;
193 string name = this.<Info>k__BackingField.name;
194 string serialNumber2 = deviceInfo.serialNumber;
195 bool flag;
196 return flag;
197 }
198
199 // Token: 0x0600033C RID: 828 RVA: 0x00009AA8 File Offset: 0x00007CA8
201 {
202 string serialNumber = this.<Info>k__BackingField.serialNumber;
203 string name = this.<Info>k__BackingField.name;
204 string serialNumber2 = deviceInfo.serialNumber;
205 bool flag;
206 return flag;
207 }
208
209 // Token: 0x0600033D RID: 829 RVA: 0x00009AD8 File Offset: 0x00007CD8
211 {
212 string serialNumber = this.<Info>k__BackingField.serialNumber;
213 string name = this.<Info>k__BackingField.name;
214 string serialNumber2 = deviceInfo.serialNumber;
215 bool flag;
216 return flag;
217 }
218
219 // Token: 0x0600033E RID: 830 RVA: 0x00009B08 File Offset: 0x00007D08
221 {
222 string serialNumber = this.<Info>k__BackingField.serialNumber;
223 string name = this.<Info>k__BackingField.name;
224 string serialNumber2 = deviceInfo.serialNumber;
225 bool flag;
226 return flag;
227 }
228
229 // Token: 0x0600033F RID: 831 RVA: 0x00009B38 File Offset: 0x00007D38
231 {
232 string serialNumber = this.<Info>k__BackingField.serialNumber;
233 string name = this.<Info>k__BackingField.name;
234 string serialNumber2 = deviceInfo.serialNumber;
235 bool flag;
236 return flag;
237 }
238
239 // Token: 0x1700010C RID: 268
240 // (get) Token: 0x06000340 RID: 832 RVA: 0x00009B68 File Offset: 0x00007D68
241 public override bool IsSupportedOnThisPlatform
242 {
243 get
244 {
246 return inputDeviceProfile == null || inputDeviceProfile.IsSupportedOnThisPlatform;
247 }
248 }
249
250 // Token: 0x1700010D RID: 269
251 // (get) Token: 0x06000341 RID: 833 RVA: 0x00009B88 File Offset: 0x00007D88
252 public override bool IsKnown
253 {
254 get
255 {
256 /*
257An exception occurred when decompiling this method (06000341)
258
259ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean InControl.NativeInputDevice::get_IsKnown()
260
261 ---> System.Exception: Basic block has to end with unconditional control flow.
262{
263 Block_0:
264 stloc:InputDeviceProfile(var_0_06, ldfld:InputDeviceProfile(NativeInputDevice::profile, ldloc:NativeInputDevice(this)))
265}
266
267 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
268 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
269 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
270 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
271 --- End of inner exception stack trace ---
272 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
273 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
274*/;
275 }
276 }
277
278 // Token: 0x1700010E RID: 270
279 // (get) Token: 0x06000342 RID: 834 RVA: 0x00009B9C File Offset: 0x00007D9C
280 public override int NumUnknownButtons
281 {
282 get
283 {
284 return this.numUnknownButtons;
285 }
286 }
287
288 // Token: 0x1700010F RID: 271
289 // (get) Token: 0x06000343 RID: 835 RVA: 0x00009BB0 File Offset: 0x00007DB0
290 public override int NumUnknownAnalogs
291 {
292 get
293 {
294 return this.numUnknownAnalogs;
295 }
296 }
297
298 // Token: 0x040002D0 RID: 720
299 private const int maxUnknownButtons = 20;
300
301 // Token: 0x040002D1 RID: 721
302 private const int maxUnknownAnalogs = 20;
303
304 // Token: 0x040002D2 RID: 722
306 private uint <Handle>k__BackingField;
307
308 // Token: 0x040002D3 RID: 723
310 private InputDeviceInfo <Info>k__BackingField;
311
312 // Token: 0x040002D4 RID: 724
313 private short[] buttons;
314
315 // Token: 0x040002D5 RID: 725
316 private short[] analogs;
317
318 // Token: 0x040002D6 RID: 726
320
321 // Token: 0x040002D7 RID: 727
322 private int skipUpdateFrames;
323
324 // Token: 0x040002D8 RID: 728
325 private int numUnknownButtons;
326
327 // Token: 0x040002D9 RID: 729
328 private int numUnknownAnalogs;
329 }
330}
class f__AnonymousType0<< Count > j__TPar
InputControlMapping[] analogMappings
void Initialize(uint deviceHandle, InputDeviceInfo deviceInfo)
InputDeviceInfo< Info > k__BackingField
bool HasSameProductID(InputDeviceInfo deviceInfo)
bool HasSameVendorID(InputDeviceInfo deviceInfo)
bool HasSameLocation(InputDeviceInfo deviceInfo)
bool HasSameVersionNumber(InputDeviceInfo deviceInfo)
bool HasSameSerialNumber(InputDeviceInfo deviceInfo)
override void SetLightFlash(float flashOnDuration, float flashOffDuration)
static byte FloatToByte(float value)
override bool ReadRawButtonState(int index)
override float ReadRawAnalogValue(int index)
override void SetLightColor(float red, float green, float blue)
override void Vibrate(float leftMotor, float rightMotor)
void Initialize(uint deviceHandle, InputDeviceInfo deviceInfo, InputDeviceProfile deviceProfile)
override void Update(ulong updateTick, float deltaTime)
static byte Min(byte val1, byte val2)
Definition Math.cs:152