diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs | 435 |
1 files changed, 435 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs new file mode 100644 index 0000000..68ecdca --- /dev/null +++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_OPCODE_IL_processor.cs | |||
@@ -0,0 +1,435 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | /* Original code: Tedd Hansen */ | ||
29 | using System; | ||
30 | using System.Reflection; | ||
31 | using System.Reflection.Emit; | ||
32 | using OpenSim.Region.ScriptEngine.Common; | ||
33 | |||
34 | namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO | ||
35 | { | ||
36 | internal partial class LSO_Parser | ||
37 | { | ||
38 | //internal Stack<Type> ILStack = new Stack<Type>(); | ||
39 | //LSO_Enums MyLSO_Enums = new LSO_Enums(); | ||
40 | |||
41 | internal bool LSL_PROCESS_OPCODE(ILGenerator il) | ||
42 | { | ||
43 | byte bp1; | ||
44 | UInt32 u32p1; | ||
45 | float fp1; | ||
46 | UInt16 opcode = br_read(1)[0]; | ||
47 | Common.SendToDebug("OPCODE: " + ((LSO_Enums.Operation_Table) opcode).ToString()); | ||
48 | string idesc = ((LSO_Enums.Operation_Table) opcode).ToString(); | ||
49 | switch ((LSO_Enums.Operation_Table) opcode) | ||
50 | { | ||
51 | /*************** | ||
52 | * IMPLEMENTED * | ||
53 | ***************/ | ||
54 | case LSO_Enums.Operation_Table.NOOP: | ||
55 | break; | ||
56 | case LSO_Enums.Operation_Table.PUSHSP: | ||
57 | // Push Stack Top (Memory Address) to stack | ||
58 | Common.SendToDebug("Instruction " + idesc); | ||
59 | Common.SendToDebug("Instruction " + idesc + | ||
60 | ": Description: Pushing Stack Top (Memory Address from header) to stack"); | ||
61 | IL_Push(il, (UInt32) myHeader.SP); | ||
62 | break; | ||
63 | // BYTE | ||
64 | case LSO_Enums.Operation_Table.PUSHARGB: | ||
65 | Common.SendToDebug("Param1: " + br_read(1)[0]); | ||
66 | break; | ||
67 | // INTEGER | ||
68 | case LSO_Enums.Operation_Table.PUSHARGI: | ||
69 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | ||
70 | Common.SendToDebug("Instruction " + idesc + ", Param1: " + u32p1); | ||
71 | IL_Push(il, u32p1); | ||
72 | break; | ||
73 | // FLOAT | ||
74 | case LSO_Enums.Operation_Table.PUSHARGF: | ||
75 | fp1 = BitConverter.ToUInt32(br_read(4), 0); | ||
76 | Common.SendToDebug("Instruction " + idesc + ", Param1: " + fp1); | ||
77 | IL_Push(il, fp1); | ||
78 | break; | ||
79 | // STRING | ||
80 | case LSO_Enums.Operation_Table.PUSHARGS: | ||
81 | string s = Read_String(); | ||
82 | Common.SendToDebug("Instruction " + idesc + ", Param1: " + s); | ||
83 | IL_Debug(il, "OPCODE: " + idesc + ":" + s); | ||
84 | IL_Push(il, s); | ||
85 | break; | ||
86 | // VECTOR z,y,x | ||
87 | case LSO_Enums.Operation_Table.PUSHARGV: | ||
88 | LSO_Enums.Vector v = new LSO_Enums.Vector(); | ||
89 | v.Z = BitConverter.ToUInt32(br_read(4), 0); | ||
90 | v.Y = BitConverter.ToUInt32(br_read(4), 0); | ||
91 | v.X = BitConverter.ToUInt32(br_read(4), 0); | ||
92 | Common.SendToDebug("Param1 Z: " + v.Z); | ||
93 | Common.SendToDebug("Param1 Y: " + v.Y); | ||
94 | Common.SendToDebug("Param1 X: " + v.X); | ||
95 | IL_Push(il, v); | ||
96 | break; | ||
97 | // ROTATION s,z,y,x | ||
98 | case LSO_Enums.Operation_Table.PUSHARGQ: | ||
99 | LSO_Enums.Rotation r = new LSO_Enums.Rotation(); | ||
100 | r.S = BitConverter.ToUInt32(br_read(4), 0); | ||
101 | r.Z = BitConverter.ToUInt32(br_read(4), 0); | ||
102 | r.Y = BitConverter.ToUInt32(br_read(4), 0); | ||
103 | r.X = BitConverter.ToUInt32(br_read(4), 0); | ||
104 | Common.SendToDebug("Param1 S: " + r.S); | ||
105 | Common.SendToDebug("Param1 Z: " + r.Z); | ||
106 | Common.SendToDebug("Param1 Y: " + r.Y); | ||
107 | Common.SendToDebug("Param1 X: " + r.X); | ||
108 | IL_Push(il, r); | ||
109 | break; | ||
110 | |||
111 | case LSO_Enums.Operation_Table.PUSHE: | ||
112 | IL_Push(il, (UInt32) 0); | ||
113 | break; | ||
114 | |||
115 | case LSO_Enums.Operation_Table.PUSHARGE: | ||
116 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | ||
117 | Common.SendToDebug("Param1: " + u32p1); | ||
118 | //IL_Push(il, new string(" ".ToCharArray()[0], Convert.ToInt32(u32p1))); | ||
119 | IL_Push(il, u32p1); | ||
120 | break; | ||
121 | // BYTE | ||
122 | case LSO_Enums.Operation_Table.ADD: | ||
123 | case LSO_Enums.Operation_Table.SUB: | ||
124 | case LSO_Enums.Operation_Table.MUL: | ||
125 | case LSO_Enums.Operation_Table.DIV: | ||
126 | case LSO_Enums.Operation_Table.EQ: | ||
127 | case LSO_Enums.Operation_Table.NEQ: | ||
128 | case LSO_Enums.Operation_Table.LEQ: | ||
129 | case LSO_Enums.Operation_Table.GEQ: | ||
130 | case LSO_Enums.Operation_Table.LESS: | ||
131 | case LSO_Enums.Operation_Table.GREATER: | ||
132 | case LSO_Enums.Operation_Table.NEG: | ||
133 | case LSO_Enums.Operation_Table.MOD: | ||
134 | bp1 = br_read(1)[0]; | ||
135 | Common.SendToDebug("Param1: " + bp1); | ||
136 | IL_CallBaseFunction(il, idesc, (UInt32) bp1); | ||
137 | break; | ||
138 | |||
139 | // NO ARGUMENTS | ||
140 | case LSO_Enums.Operation_Table.BITAND: | ||
141 | case LSO_Enums.Operation_Table.BITOR: | ||
142 | case LSO_Enums.Operation_Table.BITXOR: | ||
143 | case LSO_Enums.Operation_Table.BOOLAND: | ||
144 | case LSO_Enums.Operation_Table.BOOLOR: | ||
145 | case LSO_Enums.Operation_Table.BITNOT: | ||
146 | case LSO_Enums.Operation_Table.BOOLNOT: | ||
147 | IL_CallBaseFunction(il, idesc); | ||
148 | break; | ||
149 | // SHORT | ||
150 | case LSO_Enums.Operation_Table.CALLLIB_TWO_BYTE: | ||
151 | // TODO: What is size of short? | ||
152 | UInt16 U16p1 = BitConverter.ToUInt16(br_read(2), 0); | ||
153 | Common.SendToDebug("Instruction " + idesc + ": Builtin Command: " + | ||
154 | ((LSO_Enums.BuiltIn_Functions) U16p1).ToString()); | ||
155 | //Common.SendToDebug("Param1: " + U16p1); | ||
156 | string fname = ((LSO_Enums.BuiltIn_Functions) U16p1).ToString(); | ||
157 | |||
158 | bool cmdFound = false; | ||
159 | foreach (MethodInfo mi in typeof (LSL_BuiltIn_Commands_Interface).GetMethods()) | ||
160 | { | ||
161 | // Found command | ||
162 | if (mi.Name == fname) | ||
163 | { | ||
164 | il.Emit(OpCodes.Ldarg_0); | ||
165 | il.Emit(OpCodes.Call, typeof (LSL_BaseClass).GetMethod("GetLSL_BuiltIn", new Type[] {})); | ||
166 | // Pop required number of items from my stack to .Net stack | ||
167 | IL_PopToStack(il, mi.GetParameters().Length); | ||
168 | il.Emit(OpCodes.Callvirt, mi); | ||
169 | cmdFound = true; | ||
170 | break; | ||
171 | } | ||
172 | } | ||
173 | if (cmdFound == false) | ||
174 | { | ||
175 | Common.SendToDebug("ERROR: UNABLE TO LOCATE OPCODE " + idesc + " IN BASECLASS"); | ||
176 | } | ||
177 | |||
178 | break; | ||
179 | |||
180 | // RETURN | ||
181 | case LSO_Enums.Operation_Table.RETURN: | ||
182 | |||
183 | Common.SendToDebug("OPCODE: RETURN"); | ||
184 | return true; | ||
185 | |||
186 | case LSO_Enums.Operation_Table.POP: | ||
187 | case LSO_Enums.Operation_Table.POPS: | ||
188 | case LSO_Enums.Operation_Table.POPL: | ||
189 | case LSO_Enums.Operation_Table.POPV: | ||
190 | case LSO_Enums.Operation_Table.POPQ: | ||
191 | // Pops a specific datatype from the stack | ||
192 | // We just ignore the datatype for now | ||
193 | IL_Pop(il); | ||
194 | break; | ||
195 | |||
196 | // LONG | ||
197 | case LSO_Enums.Operation_Table.STORE: | ||
198 | case LSO_Enums.Operation_Table.STORES: | ||
199 | case LSO_Enums.Operation_Table.STOREL: | ||
200 | case LSO_Enums.Operation_Table.STOREV: | ||
201 | case LSO_Enums.Operation_Table.STOREQ: | ||
202 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | ||
203 | Common.SendToDebug("Param1: " + u32p1.ToString()); | ||
204 | IL_CallBaseFunction(il, "StoreToLocal", u32p1); | ||
205 | break; | ||
206 | |||
207 | case LSO_Enums.Operation_Table.STOREG: | ||
208 | case LSO_Enums.Operation_Table.STOREGS: | ||
209 | case LSO_Enums.Operation_Table.STOREGL: | ||
210 | case LSO_Enums.Operation_Table.STOREGV: | ||
211 | case LSO_Enums.Operation_Table.STOREGQ: | ||
212 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | ||
213 | Common.SendToDebug("Param1: " + u32p1.ToString()); | ||
214 | IL_CallBaseFunction(il, "StoreToGlobal", u32p1); | ||
215 | break; | ||
216 | |||
217 | case LSO_Enums.Operation_Table.LOADP: | ||
218 | case LSO_Enums.Operation_Table.LOADSP: | ||
219 | case LSO_Enums.Operation_Table.LOADLP: | ||
220 | case LSO_Enums.Operation_Table.LOADVP: | ||
221 | case LSO_Enums.Operation_Table.LOADQP: | ||
222 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | ||
223 | Common.SendToDebug("Param1: " + u32p1.ToString()); | ||
224 | IL_CallBaseFunction(il, "StoreToLocal", u32p1); | ||
225 | IL_Pop(il); | ||
226 | break; | ||
227 | |||
228 | case LSO_Enums.Operation_Table.LOADGP: | ||
229 | case LSO_Enums.Operation_Table.LOADGSP: | ||
230 | case LSO_Enums.Operation_Table.LOADGLP: | ||
231 | case LSO_Enums.Operation_Table.LOADGVP: | ||
232 | case LSO_Enums.Operation_Table.LOADGQP: | ||
233 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | ||
234 | Common.SendToDebug("Param1: " + u32p1.ToString()); | ||
235 | IL_CallBaseFunction(il, "StoreToStatic", u32p1 - 6 + myHeader.GVR); | ||
236 | IL_Pop(il); | ||
237 | break; | ||
238 | |||
239 | // PUSH FROM LOCAL FRAME | ||
240 | case LSO_Enums.Operation_Table.PUSH: | ||
241 | case LSO_Enums.Operation_Table.PUSHS: | ||
242 | case LSO_Enums.Operation_Table.PUSHL: | ||
243 | case LSO_Enums.Operation_Table.PUSHV: | ||
244 | case LSO_Enums.Operation_Table.PUSHQ: | ||
245 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | ||
246 | Common.SendToDebug("Param1: " + u32p1.ToString()); | ||
247 | IL_CallBaseFunction(il, "GetFromLocal", u32p1); | ||
248 | |||
249 | break; | ||
250 | |||
251 | // PUSH FROM STATIC FRAME | ||
252 | case LSO_Enums.Operation_Table.PUSHG: | ||
253 | case LSO_Enums.Operation_Table.PUSHGS: | ||
254 | case LSO_Enums.Operation_Table.PUSHGL: | ||
255 | case LSO_Enums.Operation_Table.PUSHGV: | ||
256 | case LSO_Enums.Operation_Table.PUSHGQ: | ||
257 | u32p1 = BitConverter.ToUInt32(br_read(4), 0); | ||
258 | Common.SendToDebug("Param1: " + u32p1.ToString()); | ||
259 | IL_CallBaseFunction(il, "GetFromStatic", u32p1 - 6 + myHeader.GVR); | ||
260 | break; | ||
261 | |||
262 | |||
263 | /*********************** | ||
264 | * NOT IMPLEMENTED YET * | ||
265 | ***********************/ | ||
266 | |||
267 | |||
268 | case LSO_Enums.Operation_Table.POPIP: | ||
269 | case LSO_Enums.Operation_Table.POPSP: | ||
270 | case LSO_Enums.Operation_Table.POPSLR: | ||
271 | case LSO_Enums.Operation_Table.POPARG: | ||
272 | case LSO_Enums.Operation_Table.POPBP: | ||
273 | //Common.SendToDebug("Instruction " + idesc + ": Ignored"); | ||
274 | Common.SendToDebug("Instruction " + idesc + | ||
275 | ": Description: Drop x bytes from the stack (TODO: Only popping 1)"); | ||
276 | //Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); | ||
277 | IL_Pop(il); | ||
278 | break; | ||
279 | |||
280 | |||
281 | // None | ||
282 | case LSO_Enums.Operation_Table.PUSHIP: | ||
283 | // PUSH INSTRUCTION POINTER | ||
284 | break; | ||
285 | case LSO_Enums.Operation_Table.PUSHBP: | ||
286 | |||
287 | case LSO_Enums.Operation_Table.PUSHEV: | ||
288 | break; | ||
289 | case LSO_Enums.Operation_Table.PUSHEQ: | ||
290 | break; | ||
291 | |||
292 | |||
293 | // LONG | ||
294 | case LSO_Enums.Operation_Table.JUMP: | ||
295 | Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); | ||
296 | break; | ||
297 | // BYTE, LONG | ||
298 | case LSO_Enums.Operation_Table.JUMPIF: | ||
299 | case LSO_Enums.Operation_Table.JUMPNIF: | ||
300 | Common.SendToDebug("Param1: " + br_read(1)[0]); | ||
301 | Common.SendToDebug("Param2: " + BitConverter.ToUInt32(br_read(4), 0)); | ||
302 | break; | ||
303 | // LONG | ||
304 | case LSO_Enums.Operation_Table.STATE: | ||
305 | bp1 = br_read(1)[0]; | ||
306 | //il.Emit(OpCodes.Ld); // Load local variable 0 onto stack | ||
307 | //il.Emit(OpCodes.Ldc_I4, 0); // Push index position | ||
308 | //il.Emit(OpCodes.Ldstr, EventList[p1]); // Push value | ||
309 | //il.Emit(OpCodes.Stelem_Ref); // Perform array[index] = value | ||
310 | break; | ||
311 | case LSO_Enums.Operation_Table.CALL: | ||
312 | Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); | ||
313 | Common.SendToDebug("ERROR: Function CALL not implemented yet."); | ||
314 | break; | ||
315 | // BYTE | ||
316 | case LSO_Enums.Operation_Table.CAST: | ||
317 | bp1 = br_read(1)[0]; | ||
318 | Common.SendToDebug("Instruction " + idesc + ": Cast to type: " + | ||
319 | ((LSO_Enums.OpCode_Cast_TypeDefs) bp1)); | ||
320 | Common.SendToDebug("Param1: " + bp1); | ||
321 | switch ((LSO_Enums.OpCode_Cast_TypeDefs) bp1) | ||
322 | { | ||
323 | case LSO_Enums.OpCode_Cast_TypeDefs.String: | ||
324 | Common.SendToDebug("Instruction " + idesc + ": il.Emit(OpCodes.Box, ILStack.Pop());"); | ||
325 | break; | ||
326 | default: | ||
327 | Common.SendToDebug("Instruction " + idesc + ": Unknown cast type!"); | ||
328 | break; | ||
329 | } | ||
330 | break; | ||
331 | // LONG | ||
332 | case LSO_Enums.Operation_Table.STACKTOS: | ||
333 | case LSO_Enums.Operation_Table.STACKTOL: | ||
334 | Common.SendToDebug("Param1: " + BitConverter.ToUInt32(br_read(4), 0)); | ||
335 | break; | ||
336 | // BYTE | ||
337 | case LSO_Enums.Operation_Table.PRINT: | ||
338 | case LSO_Enums.Operation_Table.CALLLIB: | ||
339 | Common.SendToDebug("Param1: " + br_read(1)[0]); | ||
340 | break; | ||
341 | } | ||
342 | return false; | ||
343 | } | ||
344 | |||
345 | private void IL_PopToStack(ILGenerator il) | ||
346 | { | ||
347 | IL_PopToStack(il, 1); | ||
348 | } | ||
349 | |||
350 | private void IL_PopToStack(ILGenerator il, int count) | ||
351 | { | ||
352 | Common.SendToDebug("IL_PopToStack();"); | ||
353 | for (int i = 0; i < count; i++) | ||
354 | { | ||
355 | IL_CallBaseFunction(il, "POPToStack"); | ||
356 | //il.Emit(OpCodes.Ldarg_0); | ||
357 | //il.Emit(OpCodes.Call, | ||
358 | // typeof(LSL_BaseClass).GetMethod("POPToStack", | ||
359 | // new Type[] { })); | ||
360 | } | ||
361 | } | ||
362 | |||
363 | private void IL_Pop(ILGenerator il) | ||
364 | { | ||
365 | Common.SendToDebug("IL_Pop();"); | ||
366 | IL_CallBaseFunction(il, "POP"); | ||
367 | } | ||
368 | |||
369 | private void IL_Debug(ILGenerator il, string text) | ||
370 | { | ||
371 | il.Emit(OpCodes.Ldstr, text); | ||
372 | il.Emit(OpCodes.Call, typeof (Common).GetMethod("SendToDebug", | ||
373 | new Type[] {typeof (string)} | ||
374 | )); | ||
375 | } | ||
376 | |||
377 | private void IL_CallBaseFunction(ILGenerator il, string methodname) | ||
378 | { | ||
379 | il.Emit(OpCodes.Ldarg_0); | ||
380 | il.Emit(OpCodes.Call, typeof (LSL_BaseClass).GetMethod(methodname, new Type[] {})); | ||
381 | } | ||
382 | |||
383 | private void IL_CallBaseFunction(ILGenerator il, string methodname, object data) | ||
384 | { | ||
385 | il.Emit(OpCodes.Ldarg_0); | ||
386 | if (data.GetType() == typeof (string)) | ||
387 | il.Emit(OpCodes.Ldstr, (string) data); | ||
388 | if (data.GetType() == typeof (UInt32)) | ||
389 | il.Emit(OpCodes.Ldc_I4, (UInt32) data); | ||
390 | il.Emit(OpCodes.Call, typeof (LSL_BaseClass).GetMethod(methodname, new Type[] {data.GetType()})); | ||
391 | } | ||
392 | |||
393 | private void IL_Push(ILGenerator il, object data) | ||
394 | { | ||
395 | il.Emit(OpCodes.Ldarg_0); | ||
396 | Common.SendToDebug("PUSH datatype: " + data.GetType()); | ||
397 | |||
398 | IL_PushDataTypeToILStack(il, data); | ||
399 | |||
400 | il.Emit(OpCodes.Call, typeof (LSL_BaseClass).GetMethod("PUSH", new Type[] {data.GetType()})); | ||
401 | } | ||
402 | |||
403 | private void IL_PushDataTypeToILStack(ILGenerator il, object data) | ||
404 | { | ||
405 | if (data.GetType() == typeof (UInt16)) | ||
406 | { | ||
407 | il.Emit(OpCodes.Ldc_I4, (UInt16) data); | ||
408 | il.Emit(OpCodes.Box, data.GetType()); | ||
409 | } | ||
410 | if (data.GetType() == typeof (UInt32)) | ||
411 | { | ||
412 | il.Emit(OpCodes.Ldc_I4, (UInt32) data); | ||
413 | il.Emit(OpCodes.Box, data.GetType()); | ||
414 | } | ||
415 | if (data.GetType() == typeof (Int32)) | ||
416 | { | ||
417 | il.Emit(OpCodes.Ldc_I4, (Int32) data); | ||
418 | il.Emit(OpCodes.Box, data.GetType()); | ||
419 | } | ||
420 | if (data.GetType() == typeof (float)) | ||
421 | { | ||
422 | il.Emit(OpCodes.Ldc_I4, (float) data); | ||
423 | il.Emit(OpCodes.Box, data.GetType()); | ||
424 | } | ||
425 | if (data.GetType() == typeof (string)) | ||
426 | il.Emit(OpCodes.Ldstr, (string) data); | ||
427 | //if (data.GetType() == typeof(LSO_Enums.Rotation)) | ||
428 | // il.Emit(OpCodes.Ldobj, (LSO_Enums.Rotation)data); | ||
429 | //if (data.GetType() == typeof(LSO_Enums.Vector)) | ||
430 | // il.Emit(OpCodes.Ldobj, (LSO_Enums.Vector)data); | ||
431 | //if (data.GetType() == typeof(LSO_Enums.Key)) | ||
432 | // il.Emit(OpCodes.Ldobj, (LSO_Enums.Key)data); | ||
433 | } | ||
434 | } | ||
435 | } \ No newline at end of file | ||