-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExpressions.js
3867 lines (3639 loc) · 71.8 KB
/
Expressions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// CExp object
// -------------------------------------------------------------
/* Copyright (c) 1996-2012 Clickteam
*
* This source code is part of the HTML5 exporter for Clickteam Multimedia Fusion 2.
*
* Permission is hereby granted to any person obtaining a legal copy
* of Clickteam Multimedia Fusion 2 to use or modify this source code for
* debugging, optimizing, or customizing applications created with
* Clickteam Multimedia Fusion 2.
* Any other use of this source code is prohibited.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
CExp.EXP_EXTGETFRICTION = (35 << 8);
CExp.EXP_EXTGETRESTITUTION = (36 << 8);
CExp.EXP_EXTGETDENSITY = (37 << 8);
CExp.EXP_EXTGETVELOCITY = (38 << 8);
CExp.EXP_EXTGETANGLE = (39 << 8);
CExp.EXP_EXTGETMASS = (42 << 8);
CExp.EXP_EXTGETANGULARVELOCITY = (43 << 8);
CExp.EXP_STRING = ((3 << 16) | 0xFFFF);
CExp.EXP_LONG = ((0 << 16) | 0xFFFF);
CExp.EXP_DOUBLE = ((23 << 16) | 0xFFFF);
CExp.create = function (file)
{
var debut = file.getFilePointer();
var exp = null;
var c = file.readAInt();
switch (c)
{
case 0x00000000:
exp = new EXP_ZERO();
break;
case 0x00020000:
exp = new EXP_PLUS();
break;
case 0x00040000:
exp = new EXP_MINUS();
break;
case 0x00060000:
exp = new EXP_MULT();
break;
case 0x00080000:
exp = new EXP_DIV();
break;
case 0x000A0000:
exp = new EXP_MOD();
break;
case 0x000C0000:
exp = new EXP_POW();
break;
case 0x000E0000:
exp = new EXP_AND();
break;
case 0x00100000:
exp = new EXP_OR();
break;
case 0x00120000:
exp = new EXP_XOR();
break;
case ((0 << 16) | 0xFFFF):
exp = new EXP_LONG();
break;
case ((1 << 16) | 0xFFFF):
exp = new EXP_RANDOM();
break;
case ((2 << 16) | 0xFFFF):
exp = new EXP_VARGLO();
break;
case ((3 << 16) | 0xFFFF):
exp = new EXP_STRING();
break;
case ((4 << 16) | 0xFFFF):
exp = new EXP_STR();
break;
case ((5 << 16) | 0xFFFF):
exp = new EXP_VAL();
break;
case ((6 << 16) | 0xFFFF):
case ((7 << 16) | 0xFFFF):
case ((8 << 16) | 0xFFFF):
case ((9 << 16) | 0xFFFF):
exp = new EXP_EMPTY();
break;
case ((10 << 16) | 0xFFFF):
exp = new EXP_SIN();
break;
case ((11 << 16) | 0xFFFF):
exp = new EXP_COS();
break;
case ((12 << 16) | 0xFFFF):
exp = new EXP_TAN();
break;
case ((13 << 16) | 0xFFFF):
exp = new EXP_SQR();
break;
case ((14 << 16) | 0xFFFF):
exp = new EXP_LOG();
break;
case ((15 << 16) | 0xFFFF):
exp = new EXP_LN();
break;
case ((16 << 16) | 0xFFFF):
exp = new EXP_HEX();
break;
case ((17 << 16) | 0xFFFF):
exp = new EXP_BIN();
break;
case ((18 << 16) | 0xFFFF):
exp = new EXP_EXP();
break;
case ((19 << 16) | 0xFFFF):
exp = new EXP_LEFT();
break;
case ((20 << 16) | 0xFFFF):
exp = new EXP_RIGHT();
break;
case ((21 << 16) | 0xFFFF):
exp = new EXP_MID();
break;
case ((22 << 16) | 0xFFFF):
exp = new EXP_LEN();
break;
case ((23 << 16) | 0xFFFF):
exp = new EXP_DOUBLE();
break;
case ((24 << 16) | 0xFFFF):
exp = new EXP_VARGLONAMED();
break;
case ((28 << 16) | 0xFFFF):
exp = new EXP_INT();
break;
case ((29 << 16) | 0xFFFF):
exp = new EXP_ABS();
break;
case ((30 << 16) | 0xFFFF):
exp = new EXP_CEIL();
break;
case ((31 << 16) | 0xFFFF):
exp = new EXP_FLOOR();
break;
case ((32 << 16) | 0xFFFF):
exp = new EXP_ACOS();
break;
case ((33 << 16) | 0xFFFF):
exp = new EXP_ASIN();
break;
case ((34 << 16) | 0xFFFF):
exp = new EXP_ATAN();
break;
case ((35 << 16) | 0xFFFF):
exp = new EXP_NOT();
break;
case ((40 << 16) | 0xFFFF):
exp = new EXP_MIN();
break;
case ((41 << 16) | 0xFFFF):
exp = new EXP_MAX();
break;
case ((42 << 16) | 0xFFFF):
exp = new EXP_GETRGB();
break;
case ((43 << 16) | 0xFFFF):
exp = new EXP_GETRED();
break;
case ((44 << 16) | 0xFFFF):
exp = new EXP_GETGREEN();
break;
case ((45 << 16) | 0xFFFF):
exp = new EXP_GETBLUE();
break;
case ((46 << 16) | 0xFFFF):
exp = new EXP_LOOPINDEX();
break;
case ((47 << 16) | 0xFFFF):
exp = new EXP_NEWLINE();
break;
case ((48 << 16) | 0xFFFF):
exp = new EXP_ROUND();
break;
case ((49 << 16) | 0xFFFF):
exp = new EXP_STRINGGLO();
break;
case ((50 << 16) | 0xFFFF):
exp = new EXP_STRINGGLONAMED();
break;
case ((51 << 16) | 0xFFFF):
exp = new EXP_LOWER();
break;
case ((52 << 16) | 0xFFFF):
exp = new EXP_UPPER();
break;
case ((53 << 16) | 0xFFFF):
exp = new EXP_FIND();
break;
case ((54 << 16) | 0xFFFF):
exp = new EXP_REVERSEFIND();
break;
case ((58 << 16) | 0xFFFF):
exp = new EXP_FLOATTOSTRING();
break;
case ((59 << 16) | 0xFFFF):
exp = new EXP_ATAN2();
break;
case ((60 << 16) | 0xFFFF):
exp = new EXP_ZERO();
break;
case ((61 << 16) | 0xFFFF):
exp = new EXP_EMPTY();
break;
case ((62 << 16) | 0xFFFF):
exp = new EXP_DISTANCE();
break;
case ((63 << 16) | 0xFFFF):
exp = new EXP_ANGLE();
break;
case ((64 << 16) | 0xFFFF):
exp = new EXP_RANGE();
break;
case ((65 << 16) | 0xFFFF):
exp = new EXP_RANDOMRANGE();
break;
case ((67 << 16) | 0xFFFF):
exp = new EXP_RUNTIMENAME();
break;
case ((-1 << 16) | 0xFFFF):
exp = new EXP_PARENTH1();
break;
case ((-2 << 16) | 0xFFFF):
exp = new EXP_PARENTH2();
break;
case ((-3 << 16) | 0xFFFF):
exp = new EXP_VIRGULE();
break;
case ((0 << 16) | 0xFFFE):
exp = new EXP_GETSAMPLEMAINVOL();
break;
case ((1 << 16) | 0xFFFE):
exp = new EXP_GETSAMPLEVOL();
break;
case ((2 << 16) | 0xFFFE):
exp = new EXP_GETCHANNELVOL();
break;
case ((3 << 16) | 0xFFFE):
exp = new EXP_ZERO();
break;
case ((4 << 16) | 0xFFFE):
exp = new EXP_GETSAMPLEPAN();
break;
case ((5 << 16) | 0xFFFE):
exp = new EXP_GETCHANNELPAN();
break;
case ((6 << 16) | 0xFFFE):
exp = new EXP_GETSAMPLEPOS();
break;
case ((7 << 16) | 0xFFFE):
exp = new EXP_GETCHANNELPOS();
break;
case ((8 << 16) | 0xFFFE):
exp = new EXP_GETSAMPLEDUR();
break;
case ((9 << 16) | 0xFFFE):
exp = new EXP_GETCHANNELDUR();
break;
case ((10 << 16) | 0xFFFE):
exp = new EXP_GETSAMPLEFREQ();
break;
case ((11 << 16) | 0xFFFE):
exp = new EXP_GETCHANNELFREQ();
break;
case ((12 << 16) | 0xFFFE):
exp = new EXP_GETCHANNELSNDNAME();
break;
case ((0 << 16) | 0xFFFD):
exp = new EXP_GAMLEVEL();
break;
case ((1 << 16) | 0xFFFD):
exp = new EXP_GAMNPLAYER();
break;
case ((2 << 16) | 0xFFFD):
exp = new EXP_PLAYXLEFT();
break;
case ((3 << 16) | 0xFFFD):
exp = new EXP_PLAYXRIGHT();
break;
case ((4 << 16) | 0xFFFD):
exp = new EXP_PLAYYTOP();
break;
case ((5 << 16) | 0xFFFD):
exp = new EXP_PLAYYBOTTOM();
break;
case ((6 << 16) | 0xFFFD):
exp = new EXP_PLAYWIDTH();
break;
case ((7 << 16) | 0xFFFD):
exp = new EXP_PLAYHEIGHT();
break;
case ((8 << 16) | 0xFFFD):
exp = new EXP_GAMLEVELNEW();
break;
case ((9 << 16) | 0xFFFD):
exp = new EXP_GETCOLLISIONMASK();
break;
case ((10 << 16) | 0xFFFD):
exp = new EXP_FRAMERATE();
break;
case ((11 << 16) | 0xFFFD):
exp = new EXP_GETVIRTUALWIDTH();
break;
case ((12 << 16) | 0xFFFD):
exp = new EXP_GETVIRTUALHEIGHT();
break;
case ((13 << 16) | 0xFFFD):
exp = new EXP_GETFRAMEBKDCOLOR();
break;
case ((14 << 16) | 0xFFFD):
exp = new EXP_ZERO();
break;
case ((15 << 16) | 0xFFFD):
exp = new EXP_ZERO();
break;
case ((16 << 16) | 0xFFFD):
exp = new EXP_FRAMEALPHACOEF();
break;
case ((17 << 16) | 0xFFFD):
exp = new EXP_FRAMERGBCOEF();
break;
case ((18 << 16) | 0xFFFD):
exp = new EXP_ZERO();
break;
case ((0 << 16) | 0xFFFC):
exp = new EXP_TIMVALUE();
break;
case ((1 << 16) | 0xFFFC):
exp = new EXP_TIMCENT();
break;
case ((2 << 16) | 0xFFFC):
exp = new EXP_TIMSECONDS();
break;
case ((3 << 16) | 0xFFFC):
exp = new EXP_TIMHOURS();
break;
case ((4 << 16) | 0xFFFC):
exp = new EXP_TIMMINITS();
break;
case ((5 << 16) | 0xFFFC):
exp = new EXP_EVENTAFTER();
break;
case ((0 << 16) | 0xFFFA):
exp = new EXP_XMOUSE();
break;
case ((1 << 16) | 0xFFFA):
exp = new EXP_YMOUSE();
break;
case ((2 << 16) | 0xFFFA):
exp = new EXP_MOUSEWHEELDELTA();
break;
case ((0 << 16) | 0xFFF9):
exp = new EXP_PLASCORE();
break;
case ((1 << 16) | 0xFFF9):
exp = new EXP_PLALIVES();
break;
case ((2 << 16) | 0xFFF9):
exp = new EXP_GETINPUT();
break;
case ((3 << 16) | 0xFFF9):
exp = new EXP_GETINPUTKEY();
break;
case ((4 << 16) | 0xFFF9):
exp = new EXP_GETPLAYERNAME();
break;
case ((0 << 16) | 0xFFFB):
exp = new EXP_CRENUMBERALL();
break;
case (( (80 + 0) << 16) | 3):
exp = new EXP_STRNUMBER();
break;
case (( (80 + 1) << 16) | 3):
exp = new EXP_STRGETCURRENT();
break;
case (( (80 + 2) << 16) | 3):
exp = new EXP_STRGETNUMBER();
break;
case (( (80 + 3) << 16) | 3):
exp = new EXP_STRGETNUMERIC();
break;
case (( (80 + 4) << 16) | 3):
exp = new EXP_STRGETNPARA();
break;
case ((80 + 0) << 16 | 2):
exp = new EXP_GETRGBAT();
break;
case ((80 + 1) << 16 | 2):
exp = new EXP_GETSCALEX();
break;
case ((80 + 2) << 16 | 2):
exp = new EXP_GETSCALEY();
break;
case ((80 + 3) << 16 | 2):
exp = new EXP_GETANGLE();
break;
case (( (80 + 0) << 16) | 7):
exp = new EXP_CVALUE();
break;
case (( (80 + 1) << 16) | 7):
exp = new EXP_CGETMIN();
break;
case (( (80 + 2) << 16) | 7):
exp = new EXP_CGETMAX();
break;
case (( (80 + 3) << 16) | 7):
exp = new EXP_CGETCOLOR1();
break;
case (( (80 + 4) << 16) | 7):
exp = new EXP_CGETCOLOR2();
break;
case (((80 + 0) << 16) | 9):
exp = new EXP_CCAGETFRAMENUMBER();
break;
case (((80 + 1) << 16) | 9):
exp = new EXP_CCAGETGLOBALVALUE();
break;
case (((80 + 2) << 16) | 9):
exp = new EXP_CCAGETGLOBALSTRING();
break;
default:
switch (c & 0xFFFF0000)
{
case ( 1 << 16):
exp = new EXP_EXTYSPR();
break;
case ( 2 << 16):
exp = new EXP_EXTISPR();
break;
case ( 3 << 16):
exp = new EXP_EXTSPEED();
break;
case ( 4 << 16):
exp = new EXP_EXTACC();
break;
case ( 5 << 16):
exp = new EXP_EXTDEC();
break;
case ( 6 << 16):
exp = new EXP_EXTDIR();
break;
case ( 7 << 16):
exp = new EXP_EXTXLEFT();
break;
case ( 8 << 16):
exp = new EXP_EXTXRIGHT();
break;
case ( 9 << 16):
exp = new EXP_EXTYTOP();
break;
case (10 << 16):
exp = new EXP_EXTYBOTTOM();
break;
case (11 << 16):
exp = new EXP_EXTXSPR();
break;
case (12 << 16):
exp = new EXP_EXTIDENTIFIER();
break;
case (13 << 16):
exp = new EXP_EXTFLAG();
break;
case (14 << 16):
exp = new EXP_EXTNANI();
break;
case (15 << 16):
exp = new EXP_EXTNOBJECTS();
break;
case (16 << 16):
exp = new EXP_EXTVAR();
break;
case (17 << 16):
exp = new EXP_EXTGETSEMITRANSPARENCY();
break;
case (18 << 16):
exp = new EXP_EXTNMOVE();
break;
case (19 << 16):
exp = new EXP_EXTVARSTRING();
break;
case (20 << 16):
exp = new EXP_EXTGETFONTNAME();
break;
case (21 << 16):
exp = new EXP_EXTGETFONTSIZE();
break;
case (22 << 16):
exp = new EXP_EXTGETFONTCOLOR();
break;
case (23 << 16):
exp = new EXP_EXTGETLAYER();
break;
case (24 << 16):
exp = new EXP_EXTGETGRAVITY();
break;
case (25 << 16):
exp = new EXP_EXTXAP();
break;
case (26 << 16):
exp = new EXP_EXTYAP();
break;
case (27 << 16):
exp = new EXP_EXTALPHACOEF();
break;
case (28 << 16):
exp = new EXP_EXTRGBCOEF();
break;
case (29 << 16):
exp = new EXP_ZERO();
break;
case (30 << 16):
exp = new EXP_EXTVARBYINDEX();
break;
case (31 << 16):
exp = new EXP_EXTVARSTRINGBYINDEX();
break;
case (32 << 16):
exp = new EXP_EXTDISTANCE();
break;
case (33 << 16):
exp = new EXP_EXTANGLE();
break;
case (34 << 16):
exp = new EXP_EXTLOOPINDEX();
break;
case (35 << 16):
exp = new EXP_EXTGETFRICTION();
break;
case (36 << 16):
exp = new EXP_EXTGETRESTITUTION();
break;
case (37 << 16):
exp = new EXP_EXTGETDENSITY();
break;
case (38 << 16):
exp = new EXP_EXTGETVELOCITY();
break;
case (39 << 16):
exp = new EXP_EXTGETANGLE();
break;
case (40 << 16):
exp = new EXP_EXTWIDTH();
break;
case (41 << 16):
exp = new EXP_EXTHEIGHT();
break;
case (42 << 16):
exp = new EXP_EXTGETMASS();
break;
case (43 << 16):
exp = new EXP_EXTGETANGULARVELOCITY();
break;
case (44 << 16):
exp = new EXP_EXTGETNAME();
break;
case (45 << 16):
exp = new EXP_NUMBEROFSELECTED();
break;
case (46 << 16):
exp = new EXP_EXTINSTANCEDATA();
break;
default:
exp = new CExpExtension();
break;
}
}
if (exp != null)
{
exp.code = c;
if (c != 0x00000000)
{
var size = file.readAShort();
var type;
switch (c)
{
case ((3 << 16) | 0xFFFF):
exp.string = file.readAString();
break;
case ((0 << 16) | 0xFFFF):
exp.value = file.readAInt();
break;
case ((23 << 16) | 0xFFFF):
exp.value = file.readADouble();
break;
case ((24 << 16) | 0xFFFF):
file.skipBytes(4);
exp.number = file.readAShort();
break;
case ((50 << 16) | 0xFFFF):
file.skipBytes(4);
exp.number = file.readAShort();
break;
default:
type = c & 0xFFFF;
if ((type & 0x8000) != 0)
type = type - 65536;
if (type >= 2 || type == COI.OBJ_PLAYER)
{
exp.oi = file.readShort();
exp.oiList = file.readShort();
switch (c & 0xFFFF0000)
{
case (16 << 16): // EXP_EXTVAR
exp.number = file.readAShort();
break;
case (19 << 16): // EXP_EXTVARSTRING
exp.number = file.readAShort();
break;
default:
break;
}
}
}
file.seek(debut + size);
}
}
return exp;
}
function CExp()
{
}
function EXP_EMPTY()
{
}
EXP_EMPTY.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4Results[rhPtr.rh4PosPile] = "";
}
}
function EXP_ZERO()
{
}
EXP_ZERO.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4Results[rhPtr.rh4PosPile] = 0;
}
}
function EXP_LONG()
{
}
EXP_LONG.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4Results[rhPtr.rh4PosPile] = this.value;
}
}
function EXP_DOUBLE()
{
}
EXP_DOUBLE.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4Results[rhPtr.rh4PosPile] = this.value;
rhPtr.flagFloat = true;
}
}
function EXP_EXTVAR()
{
}
EXP_EXTVAR.prototype =
{
evaluate: function (rhPtr)
{
var pHo = rhPtr.rhEvtProg.get_ExpressionObjects(this.oiList);
if (pHo == null)
{
rhPtr.rh4Results[rhPtr.rh4PosPile] = 0;
return;
}
var value;
if (pHo.rov != null)
value = pHo.rov.getValue(this.number);
else
value = 0;
if (!CServices.isInt(value))
rhPtr.flagFloat = true;
rhPtr.rh4Results[rhPtr.rh4PosPile] = value;
}
}
function EXP_EXTVARSTRING()
{
}
EXP_EXTVARSTRING.prototype =
{
evaluate: function (rhPtr)
{
var pHo = rhPtr.rhEvtProg.get_ExpressionObjects(this.oiList);
if (pHo == null)
{
rhPtr.rh4Results[rhPtr.rh4PosPile] = "";
return;
}
rhPtr.rh4Results[rhPtr.rh4PosPile] = pHo.rov.getString(this.number);
}
}
function EXP_STRINGGLONAMED()
{
}
EXP_STRINGGLONAMED.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4Results[rhPtr.rh4PosPile] = rhPtr.rhApp.getGlobalStringAt(this.number);
}
}
function EXP_VARGLONAMED()
{
}
EXP_VARGLONAMED.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4Results[rhPtr.rh4PosPile] = rhPtr.rhApp.getGlobalValueAt(this.number);
}
}
function EXP_STRING()
{
}
EXP_STRING.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4Results[rhPtr.rh4PosPile] = this.string;
}
}
function EXP_EXTVARBYINDEX()
{
}
EXP_EXTVARBYINDEX.prototype =
{
evaluate: function (rhPtr)
{
var pHo = rhPtr.rhEvtProg.get_ExpressionObjects(this.oiList);
rhPtr.rh4CurToken++;
var number = rhPtr.get_ExpressionInt();
if (pHo != null && pHo.rov != null)
{
if (number >= 0 && number < pHo.rov.rvValues.length)
{
var value = pHo.rov.getValue(number);
if (!CServices.isInt(value))
rhPtr.flagFloat = true;
rhPtr.rh4Results[rhPtr.rh4PosPile] = value;
return;
}
}
rhPtr.rh4Results[rhPtr.rh4PosPile] = 0;
}
}
function EXP_EXTVARSTRINGBYINDEX()
{
}
EXP_EXTVARSTRINGBYINDEX.prototype =
{
evaluate: function (rhPtr)
{
var pHo = rhPtr.rhEvtProg.get_ExpressionObjects(this.oiList);
rhPtr.rh4CurToken++;
var number = rhPtr.get_ExpressionInt();
if (pHo != null && pHo.rov != null)
{
if (number >= 0 && number < pHo.rov.rvStrings.length)
{
rhPtr.rh4Results[rhPtr.rh4PosPile] = pHo.rov.getString(number);
return;
}
}
rhPtr.rh4Results[rhPtr.rh4PosPile] = "";
}
}
// CUT
// System object
// ---------------------------------------------------------------
function EXP_DISTANCE()
{
}
EXP_DISTANCE.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4CurToken++;
var x1 = rhPtr.getExpression();
rhPtr.rh4CurToken++;
var y1 = rhPtr.getExpression();
rhPtr.rh4CurToken++;
var x2 = rhPtr.getExpression();
rhPtr.rh4CurToken++;
var y2 = rhPtr.getExpression();
var deltaX = x2 - x1;
var deltaY = y2 - y1;
rhPtr.rh4Results[rhPtr.rh4PosPile] = CServices.approximateInt(Math.sqrt(deltaX * deltaX + deltaY * deltaY));
}
}
// CUT
function EXP_ANGLE()
{
}
EXP_ANGLE.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4CurToken++;
var x1 = rhPtr.getExpression();
rhPtr.rh4CurToken++;
var y1 = rhPtr.getExpression();
var angle = Math.atan2(-y1, x1) * 180.0 / 3.141592653589;
if (angle < 0)
angle = 360 + angle;
rhPtr.rh4Results[rhPtr.rh4PosPile] = CServices.approximateInt(angle);
}
}
// CUT
function EXP_RANGE()
{
}
EXP_RANGE.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4CurToken++;
var value = rhPtr.getExpression();
rhPtr.rh4CurToken++;
var minimum = rhPtr.getExpression();
rhPtr.rh4CurToken++;
var maximum = rhPtr.getExpression();
value = Math.max(value, minimum);
value = Math.min(value, maximum);
rhPtr.rh4Results[rhPtr.rh4PosPile] = value;
}
}
// CUT
function EXP_RANDOMRANGE()
{
}
EXP_RANDOMRANGE.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4CurToken++;
var minimum = rhPtr.getExpression();
rhPtr.rh4CurToken++;
var maximum = rhPtr.getExpression();
rhPtr.rh4Results[rhPtr.rh4PosPile] = minimum + rhPtr.random(maximum - minimum + 1);
}
}
// CUT
function EXP_RUNTIMENAME()
{
}
EXP_RUNTIMENAME.prototype =
{
evaluate: function (rhPtr) {
rhPtr.rh4Results[rhPtr.rh4PosPile] = "Html5";
}
}
// CUT
function EXP_ABS()
{
}
EXP_ABS.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4CurToken++;
var value = rhPtr.getExpression();
rhPtr.rh4Results[rhPtr.rh4PosPile] = Math.abs(value);
}
}
// CUT
function EXP_ABS()
{
}
EXP_ABS.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4CurToken++;
var value = rhPtr.getExpression();
rhPtr.rh4Results[rhPtr.rh4PosPile] = Math.abs(value);
}
}
// CUT
function EXP_ACOS()
{
}
EXP_ACOS.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4CurToken++;
var value = rhPtr.getExpression();
rhPtr.rh4Results[rhPtr.rh4PosPile] = Math.acos(value) * 57.295779513082320876798154814105;
rhPtr.flagFloat = true;
}
}
// CUT
function EXP_AND()
{
}
EXP_AND.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4Results[rhPtr.rh4PosPile] &= rhPtr.rh4Results[rhPtr.rh4PosPile + 1];
}
}
// CUT
function EXP_ASIN()
{
}
EXP_ASIN.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4CurToken++;
var value = rhPtr.getExpression();
rhPtr.rh4Results[rhPtr.rh4PosPile] = Math.asin(value) * 57.295779513082320876798154814105;
rhPtr.flagFloat = true;
}
}
// CUT
function EXP_ATAN()
{
}
EXP_ATAN.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4CurToken++;
var value = rhPtr.getExpression();
rhPtr.rh4Results[rhPtr.rh4PosPile] = Math.atan(value) * 57.295779513082320876798154814105;
rhPtr.flagFloat = true;
}
}
// CUT
function EXP_ATAN2()
{
}
EXP_ATAN2.prototype =
{
evaluate: function (rhPtr)
{
rhPtr.rh4CurToken++;
var value1 = rhPtr.getExpression();
rhPtr.rh4CurToken++;
var value2 = rhPtr.getExpression();
rhPtr.rh4Results[rhPtr.rh4PosPile] = Math.atan2(value1, value2) * 57.295779513082320876798154814105;
rhPtr.flagFloat = true;
}