-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvobFunctions.d
1771 lines (1342 loc) · 51 KB
/
vobFunctions.d
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
/*
* Vob functions
*/
func void zCObject_Release (var int ptr) {
//0x0042AC30 public: int __thiscall zCObject::Release(void)
const int zCObject__Release_G1 = 4369456;
//0x0040C310 public: int __thiscall zCObject::Release(void)
const int zCObject__Release_G2 = 4244240;
if (!Hlp_Is_zCObject (ptr)) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL__thiscall (_@ (ptr), MEMINT_SwitchG1G2 (zCObject__Release_G1, zCObject__Release_G2));
call = CALL_End();
};
};
/*
*
*/
func int oCMob_GetModel (var int mobPtr) {
//0x0067AD00 public: virtual class zCModel * __thiscall oCMOB::GetModel(void)
const int oCMOB__GetModel_G1 = 6794496;
//0x0071BEE0 public: virtual class zCModel * __thiscall oCMOB::GetModel(void)
const int oCMOB__GetModel_G2 = 7454432;
if (!mobPtr) { return 0; };
const int call = 0;
if (CALL_Begin(call)) {
CALL__thiscall (_@ (mobPtr), MEMINT_SwitchG1G2 (oCMOB__GetModel_G1, oCMOB__GetModel_G2));
call = CALL_End();
};
return CALL_RetValAsPtr();
};
func string zCModel_GetVisualName (var int modelPtr) {
//0x00563EF0 public: virtual class zSTRING __thiscall zCModel::GetVisualName(void)
const int zCModel__GetVisualName_G1 = 5652208;
//0x0057DF60 public: virtual class zSTRING __thiscall zCModel::GetVisualName(void)
const int zCModel__GetVisualName_G2 = 5758816;
if (!modelPtr) { return STR_EMPTY; };
CALL_RetValIszString();
CALL__thiscall (modelPtr, MEMINT_SwitchG1G2 (zCModel__GetVisualName_G1, zCModel__GetVisualName_G2));
return CALL_RetValAszstring ();
};
func string zCDecal_GetVisualName (var int vobPtr) {
//0x00542430 public: virtual class zSTRING __thiscall zCDecal::GetVisualName(void)
const int zCDecal__GetVisualName_G1 = 5514288;
//0x00556B80 public: virtual class zSTRING __thiscall zCDecal::GetVisualName(void)
const int zCDecal__GetVisualName_G2 = 5598080;
if (!vobPtr) { return STR_EMPTY; };
CALL_RetValIszString();
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCDecal__GetVisualName_G1, zCDecal__GetVisualName_G2));
return CALL_RetValAszstring ();
};
func string zCProgMeshProto_GetVisualName (var int vobPtr) {
//0x005A5230 public: virtual class zSTRING __thiscall zCProgMeshProto::GetVisualName(void)
const int zCProgMeshProto__GetVisualName_G1 = 5919280;
//0x005C7130 public: virtual class zSTRING __thiscall zCProgMeshProto::GetVisualName(void)
const int zCProgMeshProto__GetVisualName_G2 = 6058288;
if (!vobPtr) { return STR_EMPTY; };
CALL_RetValIszString();
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCProgMeshProto__GetVisualName_G1, zCProgMeshProto__GetVisualName_G2));
return CALL_RetValAszstring ();
};
func string zCParticleFX_GetVisualName (var int vobPtr) {
//0x0058DE10 public: virtual class zSTRING __thiscall zCParticleFX::GetVisualName(void)
const int zCParticleFX__GetVisualName_G1 = 5824016;
//0x005ADD30 public: virtual class zSTRING __thiscall zCParticleFX::GetVisualName(void)
const int zCParticleFX__GetVisualName_G2 = 5954864;
if (!vobPtr) { return STR_EMPTY; };
CALL_RetValIszString();
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCParticleFX__GetVisualName_G1, zCParticleFX__GetVisualName_G2));
return CALL_RetValAszstring ();
};
func string zCMorphMesh_GetVisualName (var int vobPtr) {
//0x005868F0 public: virtual class zSTRING __thiscall zCMorphMesh::GetVisualName(void)
const int zCMorphMesh__GetVisualName_G1 = 5794032;
//0x005A6290 public: virtual class zSTRING __thiscall zCMorphMesh::GetVisualName(void)
const int zCMorphMesh__GetVisualName_G2 = 5923472;
if (!vobPtr) { return STR_EMPTY; };
CALL_RetValIszString();
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCMorphMesh__GetVisualName_G1, zCMorphMesh__GetVisualName_G2));
return CALL_RetValAszstring ();
};
func string zCPolyStrip_GetVisualName (var int vobPtr) {
//0x004C0DD0 public: virtual class zSTRING __thiscall zCPolyStrip::GetVisualName(void)
const int zCPolyStrip__GetVisualName_G1 = 4984272;
//0x004CA110 public: virtual class zSTRING __thiscall zCPolyStrip::GetVisualName(void)
const int zCPolyStrip__GetVisualName_G2 = 5021968;
if (!vobPtr) { return STR_EMPTY; };
CALL_RetValIszString();
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCPolyStrip__GetVisualName_G1, zCPolyStrip__GetVisualName_G2));
return CALL_RetValAszstring ();
};
func string zCFlash_GetVisualName (var int vobPtr) {
//0x004C0EA0 public: virtual class zSTRING __thiscall zCFlash::GetVisualName(void)
const int zCFlash__GetVisualName_G1 = 4984480;
//0x004CA1E0 public: virtual class zSTRING __thiscall zCFlash::GetVisualName(void)
const int zCFlash__GetVisualName_G2 = 5022176;
if (!vobPtr) { return STR_EMPTY; };
CALL_RetValIszString();
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCFlash__GetVisualName_G1, zCFlash__GetVisualName_G2));
return CALL_RetValAszstring ();
};
func string zCMesh_GetVisualName (var int vobPtr) {
//0x0054FBC0 public: virtual class zSTRING __thiscall zCMesh::GetVisualName(void)
const int zCMesh__GetVisualName_G1 = 5569472;
//0x00567020 public: virtual class zSTRING __thiscall zCMesh::GetVisualName(void)
const int zCMesh__GetVisualName_G2 = 5664800;
if (!vobPtr) { return STR_EMPTY; };
CALL_RetValIszString();
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCMesh__GetVisualName_G1, zCMesh__GetVisualName_G2));
return CALL_RetValAszstring ();
};
func string zCQuadMark_GetVisualName (var int vobPtr) {
//0x005AB980 public: virtual class zSTRING __thiscall zCQuadMark::GetVisualName(void)
const int zCQuadMark__GetVisualName_G1 = 5945728;
//0x005D0AB0 public: virtual class zSTRING __thiscall zCQuadMark::GetVisualName(void)
const int zCQuadMark__GetVisualName_G2 = 6097584;
if (!vobPtr) { return STR_EMPTY; };
CALL_RetValIszString();
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCQuadMark__GetVisualName_G1, zCQuadMark__GetVisualName_G2));
return CALL_RetValAszstring ();
};
func int zCVob_GetVisual (var int vobPtr) {
//0x005E9A70 public: class zCVisual * __thiscall zCVob::GetVisual(void)const
const int zCVob__GetVisual_G1 = 6199920;
//0x00616B20 public: class zCVisual * __thiscall zCVob::GetVisual(void)const
const int zCVob__GetVisual_G2 = 6384416;
if (!vobPtr) { return 0; };
var int retVal;
const int call = 0;
if (CALL_Begin(call)) {
CALL_PutRetValTo (_@ (retVal));
CALL__thiscall (_@ (vobPtr), MEMINT_SwitchG1G2 (zCVob__GetVisual_G1, zCVob__GetVisual_G2));
call = CALL_End();
};
return + retVal;
};
/*
* Wrapper function for getting Visual
* - returns visual name
* - works with zCDecal, zCModel, zCProgMeshProto visual types
*/
func string Visual_GetVisualName (var int visualPtr) {
/*
if (!vobPtr) { return STR_EMPTY; };
var zCVob vob; vob = _^ (vobPtr);
if (!vob.visual) { return STR_EMPTY; };
var zCObject visualObj;
visualObj = _^ (vob.visual);
return visualObj.objectName;
*/
if (!visualPtr) { return STR_EMPTY; };
var zCVisual visual; visual = _^ (visualPtr);
//visual zCDecal
//Ikarus constant for G1 has incorrect value ... G2A is not defined
//0x007D3E04 const zCDecal::`vftable'
const int zCDecal_vtbl_G1 = 8207876;
//0x00832084 const zCDecal::`vftable'
const int zCDecal_vtbl_G2 = 8593540;
if (visual._vtbl == MEMINT_SwitchG1G2 (zCDecal_vtbl_G1, zCDecal_vtbl_G2)) {
return zCDecal_GetVisualName (visualPtr);
};
//visual zCModel
//0x007D3FEC const zCModel::`vftable'
const int zCModel_vtbl_G1 = 8208364;
//0x0083234C const zCModel::`vftable'
const int zCModel_vtbl_G2 = 8594252;
if (visual._vtbl == MEMINT_SwitchG1G2 (zCModel_vtbl_G1, zCModel_vtbl_G2)) {
return zCModel_GetVisualName (visualPtr);
};
//visual zCProgMeshProto
//0x007D45F4 const zCProgMeshProto::`vftable'
const int zCProgMeshProto_vtbl_G1 = 8209908;
//0x008329CC const zCProgMeshProto::`vftable'
const int zCProgMeshProto_vtbl_G2 = 8595916;
if (visual._vtbl == MEMINT_SwitchG1G2 (zCProgMeshProto_vtbl_G1, zCProgMeshProto_vtbl_G2)) {
return zCProgMeshProto_GetVisualName (visualPtr);
};
//visual zCParticleFX
//0x007D4214 const zCParticleFX::`vftable'
const int zCParticleFX_vtbl_G1 = 8208916;
//0x008325C4 const zCParticleFX::`vftable'
const int zCParticleFX_vtbl_G2 = 8594884;
if (visual._vtbl == MEMINT_SwitchG1G2 (zCParticleFX_vtbl_G1, zCParticleFX_vtbl_G2)) {
return zCParticleFX_GetVisualName (visualPtr);
};
//visual zCMorphMesh
//0x007D4144 const zCMorphMesh::`vftable'
const int zCMorphMesh_vtbl_G1 = 8208708;
//0x008324D4 const zCMorphMesh::`vftable'
const int zCMorphMesh_vtbl_G2 = 8594644;
if (visual._vtbl == MEMINT_SwitchG1G2 (zCMorphMesh_vtbl_G1, zCMorphMesh_vtbl_G2)) {
return zCMorphMesh_GetVisualName (visualPtr);
};
//visual zCPolyStrip
//0x007D42EC const zCPolyStrip::`vftable'
const int zCPolyStrip_vtbl_G1 = 8209132;
//0x008326B4 const zCPolyStrip::`vftable'
const int zCPolyStrip_vtbl_G2 = 8595124;
if (visual._vtbl == MEMINT_SwitchG1G2 (zCPolyStrip_vtbl_G1, zCPolyStrip_vtbl_G2)) {
return zCPolyStrip_GetVisualName (visualPtr);
};
//visual zCFlash
//0x007D292C const zCFlash::`vftable'
const int zCFlash_vtbl_G1 = 8202540;
//0x00830A64 const zCFlash::`vftable'
const int zCFlash_vtbl_G2 = 8587876;
if (visual._vtbl == MEMINT_SwitchG1G2 (zCFlash_vtbl_G1, zCFlash_vtbl_G2)) {
return zCFlash_GetVisualName (visualPtr);
};
//visual zCMesh
//0x007D3F6C const zCMesh::`vftable'
const int zCMesh_vtbl_G1 = 8208236;
//0x008322BC const zCMesh::`vftable'
const int zCMesh_vtbl_G2 = 8594108;
if (visual._vtbl == MEMINT_SwitchG1G2 (zCMesh_vtbl_G1, zCMesh_vtbl_G2)) {
return zCMesh_GetVisualName (visualPtr);
};
//visual zCQuadMark
//0x007D467C const zCQuadMark::`vftable'
const int zCQuadMark_vtbl_G1 = 8210044;
//0x00832A64 const zCQuadMark::`vftable'
const int zCQuadMark_vtbl_G2 = 8596068;
if (visual._vtbl == MEMINT_SwitchG1G2 (zCQuadMark_vtbl_G1, zCQuadMark_vtbl_G2)) {
return zCQuadMark_GetVisualName (visualPtr);
};
//Since I am not sure if this works properly - couple of prints that might help in the future
MEM_Info ("AFSP TODO: Investigate visual vtbl:");
MEM_Info (IntToString (visual._vtbl));
return visual._zCObject_objectName;
};
func string Vob_GetVisualName (var int vobPtr){
if (!vobPtr) { return STR_EMPTY; };
//in case of oCMob we need to get visual from object model
//if (Hlp_Is_oCMob (vobPtr)){
// var int modelPtr; modelPtr = oCMob_GetModel (vobPtr);
// return zCModel_GetVisualName (modelPtr);
//};
//B_Msg_Add (zCDecal_GetVisualName (vobPtr));
if (!vobPtr) { return STR_EMPTY; };
var int visualPtr; visualPtr = zCVob_GetVisual (vobPtr);
return Visual_GetVisualName (visualPtr);
};
/*
* zCVob_GetName
* - returns vob name
*/
func string zCVob_GetName (var int vobPtr) {
if (!Hlp_Is_zCVob (vobPtr)) { return STR_EMPTY; };
var zCVob vob; vob = _^ (vobPtr);
return vob._zCObject_objectName;
};
/*
* Will draw BBox3D on Vob
*/
func void zCVob_SetDrawBBox3D (var int vobPtr, var int enabled) {
//0x00645030 public: void __thiscall zCVob::SetDrawBBox3D(int)
const int zCVob__SetDrawBBox3D_G1 = 6574128;
//0x006CFFE0 public: void __thiscall zCVob::SetDrawBBox3D(int)
const int zCVob__SetDrawBBox3D_G2 = 7143392;
if (!vobPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_IntParam (_@ (enabled));
CALL__thiscall (_@ (vobPtr), MEMINT_SwitchG1G2 (zCVob__SetDrawBBox3D_G1, zCVob__SetDrawBBox3D_G2));
call = CALL_End();
};
};
/*
*
*/
func void zCVob_Move (var int vobPtr, var int x, var int y, var int z) {
//0x005EDDE0 public: void __thiscall zCVob::Move(float,float,float)
const int zCVob__Move_G1 = 6217184;
//0x0061B2E0 public: void __thiscall zCVob::Move(float,float,float)
const int zCVob__Move_G2 = 6402784;
if (!vobPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_FloatParam (_@ (x));
CALL_FloatParam (_@ (y));
CALL_FloatParam (_@ (z));
CALL__thiscall (_@ (vobPtr), MEMINT_SwitchG1G2 (zCVob__Move_G1, zCVob__Move_G2));
call = CALL_End();
};
};
/*
* Vob_GetCollBits will return collision bitfield values
*/
func int Vob_GetCollBits (var int vobPtr) {
if (!vobPtr) { return 0; };
var zCVob vob; vob = _^ (vobPtr);
return (vob.bitfield[0] & (zCVob_bitfield0_collDetectionStatic + zCVob_bitfield0_collDetectionDynamic));
};
/*
* Vob_AddCollBits - will add collisions based on input bitfield values in collBits
*/
func void Vob_AddCollBits (var int vobPtr, var int collBits) {
if (!vobPtr) { return; };
var zCVob vob; vob = _^ (vobPtr);
vob.bitfield[0] = (vob.bitfield[0] | collBits);
};
/*
* Vob_RemoveCollBits - will remove collisions based on input bitfield values in collBits
*/
func void Vob_RemoveCollBits (var int vobPtr, var int collBits) {
if (!vobPtr) { return; };
var zCVob vob; vob = _^ (vobPtr);
vob.bitfield[0] = (vob.bitfield[0] & ~ collBits);
};
/*
* Rotates vob on its X axis
*/
func void zCVob_RotateLocalX (var int vobPtr, var int x) {
//0x005EE1A0 public: void __thiscall zCVob::RotateLocalX(float)
const int zCVob__RotateLocalX_G1 = 6218144;
//0x0061B6B0 public: void __thiscall zCVob::RotateLocalX(float)
const int zCVob__RotateLocalX_G2 = 6403760;
if (!vobPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_FloatParam (_@ (x));
CALL__thiscall (_@ (vobPtr), MEMINT_SwitchG1G2 (zCVob__RotateLocalX_G1, zCVob__RotateLocalX_G2));
call = CALL_End();
};
};
/*
* Rotates vob on its Y axis
*/
func void zCVob_RotateLocalY (var int vobPtr, var int y) {
//0x005EE210 public: void __thiscall zCVob::RotateLocalY(float)
const int zCVob__RotateLocalY_G1 = 6218256;
//0x0061B720 public: void __thiscall zCVob::RotateLocalY(float)
const int zCVob__RotateLocalY_G2 = 6403872;
if (!vobPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_FloatParam (_@ (y));
CALL__thiscall (_@ (vobPtr), MEMINT_SwitchG1G2 (zCVob__RotateLocalY_G1, zCVob__RotateLocalY_G2));
call = CALL_End();
};
};
/*
* Rotates vob on its Z axis
*/
func void zCVob_RotateLocalZ (var int vobPtr, var int z) {
//0x005EE280 public: void __thiscall zCVob::RotateLocalZ(float)
const int zCVob__RotateLocalZ_G1 = 6218368;
//0x0061B790 public: void __thiscall zCVob::RotateLocalZ(float)
const int zCVob__RotateLocalZ_G2 = 6403984;
if (!vobPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_FloatParam (_@ (z));
CALL__thiscall (_@ (vobPtr), MEMINT_SwitchG1G2 (zCVob__RotateLocalZ_G1, zCVob__RotateLocalZ_G2));
call = CALL_End();
};
};
/*
* Rotates vob on its X Y Z axes
*/
func void zCVob_RotateLocalXYZ (var int vobPtr, var int x, var int y, var int z) {
if (!vobPtr) { return; };
zCVob_RotateLocalX (vobPtr, x);
zCVob_RotateLocalY (vobPtr, y);
zCVob_RotateLocalZ (vobPtr, z);
};
/*
*
*/
func void zCVob_SetPhysicsEnabled (var int vobPtr, var int enabled) {
//0x005EFC20 public: void __thiscall zCVob::SetPhysicsEnabled(int)
const int zCVob__SetPhysicsEnabled_G1 = 6224928;
//0x0061D190 public: void __thiscall zCVob::SetPhysicsEnabled(int)
const int zCVob__SetPhysicsEnabled_G2 = 6410640;
if (!vobPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_IntParam (_@ (enabled));
CALL__thiscall (_@ (vobPtr), MEMINT_SwitchG1G2 (zCVob__SetPhysicsEnabled_G1, zCVob__SetPhysicsEnabled_G2));
call = CALL_End();
};
};
/*
* zCVob_SetSleeping
* zVOB_SLEEPING = 0
* zVOB_AWAKE = 1
* zVOB_AWAKE_DOAI_ONLY = 2
*/
func void zCVob_SetSleeping (var int vobPtr, var int sleepingMode) {
//0x005D7250 public: void __thiscall zCVob::SetSleeping(int)
const int zCVob__SetSleeping_G1 = 6124112;
//0x00602930 public: void __thiscall zCVob::SetSleeping(int)
const int zCVob__SetSleeping_G2 = 6302000;
if (!vobPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_IntParam (_@ (sleepingMode));
CALL__thiscall (_@ (vobPtr), MEMINT_SwitchG1G2 (zCVob__SetSleeping_G1, zCVob__SetSleeping_G2));
call = CALL_End();
};
};
/*
*
*/
func int zCVob_IsSleeping (var int vobPtr) {
if (!vobPtr) { return 0; };
/*
enum zTVobSleepingMode {
zVOB_SLEEPING, //0
zVOB_AWAKE, //1
zVOB_AWAKE_DOAI_ONLY //2
};
*/
var zCVob vob; vob = _^ (vobPtr);
return ((vob.bitfield[2] & zCVob_bitfield2_sleepingMode) == 0);
//Put in sleeping mode
//vob.bitfield[2] = (vob.bitfield[2] & ~ zCVob_bitfield2_sleepingMode) | 0;
//Remove from sleeping mode
//vob.bitfield[2] = (vob.bitfield[2] & ~ zCVob_bitfield2_sleepingMode) | 1;
};
func int zCVob_HasParentVob (var int vobPtr) {
//0x005EF620 public: int __thiscall zCVob::HasParentVob(void)const
const int zCVob__HasParentVob_G1 = 6223392;
//0x0061CBA0 public: int __thiscall zCVob::HasParentVob(void)const
const int zCVob__HasParentVob_G2 = 6409120;
if (!vobPtr) { return FALSE; };
const int call = 0;
if (CALL_Begin(call)) {
CALL__thiscall (_@ (vobPtr), MEMINT_SwitchG1G2 (zCVob__HasParentVob_G1, zCVob__HasParentVob_G2));
call = CALL_End();
};
return CALL_RetValAsInt ();
};
//0x005D6E10 public: virtual void __thiscall zCVob::SetVisual(class zCVisual *)
//0x006024F0 public: virtual void __thiscall zCVob::SetVisual(class zCVisual *)
func void zCVob_SetVisual (var int vobPtr, var string visualName) {
//0x005D6FA0 public: virtual void __thiscall zCVob::SetVisual(class zSTRING const &)
const int zCVob__SetVisual_G1 = 6123424;
//0x00602680 public: virtual void __thiscall zCVob::SetVisual(class zSTRING const &)
const int zCVob__SetVisual_G2 = 6301312;
if (!vobPtr) { return; };
CALL_zStringPtrParam (visualName);
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCVob__SetVisual_G1, zCVob__SetVisual_G2));
};
func int zCVob_GetVelocity (var int vobPtr) {
//0x005EFC50 public: class zVEC3 __thiscall zCVob::GetVelocity(void)
const int zCVob__GetVelocity_G1 = 6224976;
//0x0061D1C0 public: class zVEC3 __thiscall zCVob::GetVelocity(void)
const int zCVob__GetVelocity_G2 = 6410688;
if (!vobPtr) { return 0; };
CALL_RetValIsStruct (12);
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCVob__GetVelocity_G1, zCVob__GetVelocity_G2));
return CALL_RetValAsPtr ();
};
func int Vob_IsMoving (var int vobPtr) {
/*
This does not work ;-/
if (!itemPtr) { return 0; };
var oCItem itm; itm = _^ (itemPtr);
return + (itm._zCVob_bitfield[1] & zCVob_bitfield1_isInMovementMode);
*/
/*
if (!vobPtr) { return FALSE; };
var int vecPtr; vecPtr = zCVob_GetVelocity (vobPtr);
if (!vecPtr) { return FALSE; };
var int vec[3];
copyVector (vecPtr, _@ (vec));
return + (magVector (_@ (vec)));
*/
//0x004AC6C0 public: class zVEC3 & __thiscall zVEC3::NormalizeSafe(void)
const int zVEC3__NormalizeSafe_G1 = 4900544;
//0x00498A20 public: class zVEC3 & __thiscall zVEC3::NormalizeSafe(void)
const int zVEC3__NormalizeSafe_G2 = 4819488;
var int vec[3];
var int vecPtr; vecPtr = zCVob_GetVelocity (vobPtr);
//only supported in disposable calls
//CALL_RetValIsStruct (12);
const int call = 0;
if (CALL_Begin(call)) {
CALL_PutRetValTo (_@ (vecPtr));
CALL__thiscall (_@ (vecPtr), MEMINT_SwitchG1G2 (zVEC3__NormalizeSafe_G1, zVEC3__NormalizeSafe_G2));
call = CALL_End();
};
MEM_CopyBytes (vecPtr, _@ (vec), 12);
MEM_Free (vecPtr);
return + (magVector (_@ (vec)));
};
func int Vob_GetNoOfVobsByName (var string vobName) {
var int arr; arr = MEM_SearchAllVobsByName (vobName);
var zCArray zarr; zarr = _^ (arr);
var int count; count = zarr.numInArray;
MEM_ArrayFree (arr);
return + count;
};
/*
*
*/
func void Vob_TriggerVobByName (var string vobName) {
var int arr; arr = MEM_SearchAllVobsByName (vobName);
var zCArray zarr; zarr = _^ (arr);
var int vobPtr;
repeat (i, zarr.numInArray); var int i;
vobPtr = MEM_ReadIntArray(zarr.array, i);
MEM_TriggerVob (vobPtr);
end;
MEM_ArrayFree (arr);
};
/*
*
*/
func void Vob_UnTriggerVobByName (var string vobName) {
var int arr; arr = MEM_SearchAllVobsByName (vobName);
var zCArray zarr; zarr = _^ (arr);
var int vobPtr;
repeat (i, zarr.numInArray); var int i;
vobPtr = MEM_ReadIntArray(zarr.array, i);
MEM_UntriggerVob (vobPtr);
end;
MEM_ArrayFree (arr);
};
/*
*
*/
func void Vob_ChangeDataByPtr (var int vobPtr, var int staticVob, var int collStat, var int collDyn, var int showVisual) {
if (!vobPtr) { return; };
var int onBits; onBits = ( showVisual * zCVob_bitfield0_showVisual + staticVob * zCVob_bitfield0_staticVob + collStat * zCVob_bitfield0_collDetectionStatic + collDyn * zCVob_bitfield0_collDetectionDynamic);
var int offBits; offBits = (!showVisual * zCVob_bitfield0_showVisual + !staticVob * zCVob_bitfield0_staticVob + !collStat * zCVob_bitfield0_collDetectionStatic + !collDyn * zCVob_bitfield0_collDetectionDynamic);
var zCVob vob; vob = _^ (vobPtr);
vob.bitfield[0] = vob.bitfield[0] | (onBits);
vob.bitfield[0] = vob.bitfield[0] & ~ (offBits);
};
/*
*
*/
func void Vob_ChangeDataByName (var string vobName, var int staticVob, var int collStat, var int collDyn, var int showVisual) {
var int arr; arr = MEM_SearchAllVobsByName (vobName);
var zCArray zarr; zarr = _^ (arr);
var int onBits; onBits = ( showVisual * zCVob_bitfield0_showVisual + staticVob * zCVob_bitfield0_staticVob + collStat * zCVob_bitfield0_collDetectionStatic + collDyn * zCVob_bitfield0_collDetectionDynamic);
var int offBits; offBits = (!showVisual * zCVob_bitfield0_showVisual + !staticVob * zCVob_bitfield0_staticVob + !collStat * zCVob_bitfield0_collDetectionStatic + !collDyn * zCVob_bitfield0_collDetectionDynamic);
var zCVob vob;
var int vobPtr;
repeat (i, zarr.numInArray); var int i;
vobPtr = MEM_ReadIntArray (zarr.array, i);
vob = _^ (vobPtr);
vob.bitfield[0] = vob.bitfield[0] | (onBits);
vob.bitfield[0] = vob.bitfield[0] & ~ (offBits);
end;
MEM_ArrayFree (arr);
};
/*
*
*/
func void Vob_MoveToVob (var string moveVobName, var string toVobName) {
var zcVob toVob;
var int moveVobPtr; moveVobPtr = MEM_SearchVobByName (moveVobName);
if (!moveVobPtr) { return; };
var int toVobPtr; toVobPtr = MEM_SearchVobByName (toVobName);
if (!toVobPtr) { return; };
toVob = _^ (toVobPtr);
//AlignVobAt (moveVobPtr, _@(toVob.trafoObjToWorld));
MEM_PushIntParam (moveVobPtr);
MEM_PushIntParam (_@(toVob.trafoObjToWorld));
MEM_Call (AlignVobAt);
};
/*
*
*/
func void Vob_PlayEffect (var string vobName, var string effectName)
{
var int arr; arr = MEM_SearchAllVobsByName (vobName);
var zCArray zarr; zarr = _^ (arr);
var int vobPtr;
var zCVob vob;
repeat (i, zarr.numInArray); var int i;
vobPtr = MEM_ReadIntArray (zarr.array, i);
vob = _^ (vobPtr);
Wld_PlayEffect (effectName, vob, vob, 0, 0, 0, FALSE);
end;
MEM_ArrayFree (arr);
};
//0x005EF090 public: void __thiscall zCVob::SetHeadingLocal(class zVEC3 const &)
//0x005EF150 public: void __thiscall zCVob::SetHeadingWorld(class zVEC3 const &)
//0x005EF640 public: void __thiscall zCVob::SetHeadingAtWorld(class zVEC3 const &)
func int zCVob_GetPositionWorld (var int vobPtr) {
//0x0051B3C0 public: class zVEC3 __thiscall zCVob::GetPositionWorld(void)const
const int zCVob__GetPositionWorld_G1 = 5354432;
//0x0052DC90 public: class zVEC3 __thiscall zCVob::GetPositionWorld(void)const
const int zCVob__GetPositionWorld_G2 = 5430416;
if (!vobPtr) { return 0; };
CALL_RetValIsStruct (12);
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCVob__GetPositionWorld_G1, zCVob__GetPositionWorld_G2));
return CALL_RetValAsPtr ();
};
//Wrapper function that frees allocated memory
//return TRUE if everything went ok
func int zCVob_GetPositionWorldToPos (var int vobPtr, var int posPtr) {
if (!posPtr) { return FALSE; };
var int vobPosPtr; vobPosPtr = zCVob_GetPositionWorld (vobPtr);
if (!vobPosPtr) { return FALSE; };
MEM_CopyBytes (vobPosPtr, posPtr, 12);
MEM_Free (vobPosPtr);
return TRUE;
};
func int zCVob_GetAtVectorWorld (var int vobPtr) {
//0x0051B3E0 public: class zVEC3 __thiscall zCVob::GetAtVectorWorld(void)const
const int zCVob__GetAtVectorWorld_G1 = 5354464;
//0x0052DCB0 public: class zVEC3 __thiscall zCVob::GetAtVectorWorld(void)const
const int zCVob__GetAtVectorWorld_G2 = 5430448;
if (!vobPtr) { return 0; };
CALL_RetValIsStruct (12);
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCVob__GetAtVectorWorld_G1, zCVob__GetAtVectorWorld_G2));
return CALL_RetValAsPtr ();
};
//Wrapper function that frees allocated memory
//return TRUE if everything went ok
func int zCVob_GetAtVectorWorldToPos (var int vobPtr, var int posPtr) {
if (!posPtr) { return FALSE; };
var int vobPosPtr; vobPosPtr = zCVob_GetAtVectorWorld (vobPtr);
if (!vobPosPtr) { return FALSE; };
MEM_CopyBytes (vobPosPtr, posPtr, 12);
MEM_Free (vobPosPtr);
return TRUE;
};
func int zCVob_GetUpVectorWorld (var int vobPtr) {
//0x0051B400 public: class zVEC3 __thiscall zCVob::GetUpVectorWorld(void)const
const int zCVob__GetUpVectorWorld_G1 = 5354496;
//0x0052DCD0 public: class zVEC3 __thiscall zCVob::GetUpVectorWorld(void)const
const int zCVob__GetUpVectorWorld_G2 = 5430480;
if (!vobPtr) { return 0; };
CALL_RetValIsStruct (12);
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCVob__GetUpVectorWorld_G1, zCVob__GetUpVectorWorld_G2));
return CALL_RetValAsPtr ();
};
func int zCVob_GetRightVectorWorld (var int vobPtr) {
//0x0051B420 public: class zVEC3 __thiscall zCVob::GetRightVectorWorld(void)const
const int zCVob__GetRightVectorWorld_G1 = 5354528;
//0x0052DCF0 public: class zVEC3 __thiscall zCVob::GetRightVectorWorld(void)const
const int zCVob__GetRightVectorWorld_G2 = 5430512;
if (!vobPtr) { return 0; };
CALL_RetValIsStruct (12);
CALL__thiscall (vobPtr, MEMINT_SwitchG1G2 (zCVob__GetRightVectorWorld_G1, zCVob__GetRightVectorWorld_G2));
return CALL_RetValAsPtr ();
};
//
func void zCVob_SetPositionWorld (var int vobPtr, var int vecPtr) {
//0x005EE650 public: void __thiscall zCVob::SetPositionWorld(class zVEC3 const &)
const int zCVob__SetPositionWorld_G1 = 6219344;
//0x0061BB70 public: void __thiscall zCVob::SetPositionWorld(class zVEC3 const &)
const int zCVob__SetPositionWorld_G2 = 6404976;
if (!vobPtr) || (!vecPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_PtrParam (_@ (vecPtr));
CALL__thiscall (_@ (vobPtr), MEMINT_SwitchG1G2 (zCVob__SetPositionWorld_G1, zCVob__SetPositionWorld_G2));
call = CALL_End();
};
};
func void zMAT4_SetAtVector (var int trafoPtr, var int vecPtr) {
//0x00497390 public: void __thiscall zMAT4::SetAtVector(class zVEC3 const &)
const int zMAT4__SetAtVector_G1 = 4813712;
//0x0056B960 public: void __thiscall zMAT4::SetAtVector(class zVEC3 const &)
const int zMAT4__SetAtVector_G2 = 5683552;
if (!trafoPtr) { return; };
if (!vecPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_PtrParam (_@ (vecPtr));
CALL__thiscall (_@ (trafoPtr), MEMINT_SwitchG1G2 (zMAT4__SetAtVector_G1, zMAT4__SetAtVector_G2));
call = CALL_End();
};
};
func void zMAT4_SetUpVector (var int trafoPtr, var int vecPtr)
{
//0x004973B0 public: void __thiscall zMAT4::SetUpVector(class zVEC3 const &)
const int zMAT4__SetUpVector_G1 = 4813744;
//0x004B9D90 public: void __thiscall zMAT4::SetUpVector(class zVEC3 const &)
const int zMAT4__SetUpVector_G2 = 4955536;
if (!trafoPtr) { return; };
if (!vecPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_PtrParam (_@ (vecPtr));
CALL__thiscall (_@ (trafoPtr), MEMINT_SwitchG1G2 (zMAT4__SetUpVector_G1, zMAT4__SetUpVector_G2));
call = CALL_End();
};
};
func void zMAT4_SetRightVector (var int trafoPtr, var int vecPtr)
{
//0x004973D0 public: void __thiscall zMAT4::SetRightVector(class zVEC3 const &)
const int zMAT4__SetRightVector_G1 = 4813776;
//0x004B9DB0 public: void __thiscall zMAT4::SetRightVector(class zVEC3 const &)
const int zMAT4__SetRightVector_G2 = 4955568;
if (!trafoPtr) { return; };
if (!vecPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_PtrParam (_@ (vecPtr));
CALL__thiscall (_@ (trafoPtr), MEMINT_SwitchG1G2 (zMAT4__SetRightVector_G1, zMAT4__SetRightVector_G2));
call = CALL_End();
};
};
/*
*
*/
func void zMAT4_PostRotateX (var int trafoPtr, var int degrees) {
//0x00507A40 public: void __thiscall zMAT4::PostRotateX(float)
const int zMAT4__PostRotateX_G1 = 5274176;
//0x00517730 public: void __thiscall zMAT4::PostRotateX(float)
const int zMAT4__PostRotateX_G2 = 5338928;
if (!trafoPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_FloatParam (_@ (degrees));
CALL__thiscall (_@ (trafoPtr), MEMINT_SwitchG1G2(zMAT4__PostRotateX_G1, zMAT4__PostRotateX_G2));
call = CALL_End();
};
};
func void zMAT4_PostRotateY (var int trafoPtr, var int degrees) {
//0x00507A90 public: void __thiscall zMAT4::PostRotateY(float)
const int zMAT4__PostRotateY_G1 = 5274256;
//0x00517780 public: void __thiscall zMAT4::PostRotateY(float)
const int zMAT4__PostRotateY_G2 = 5339008;
if (!trafoPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_FloatParam (_@ (degrees));
CALL__thiscall (_@ (trafoPtr), MEMINT_SwitchG1G2(zMAT4__PostRotateY_G1, zMAT4__PostRotateY_G2));
call = CALL_End();
};
};
func void zMAT4_PostRotateZ (var int trafoPtr, var int degrees) {
//0x00507AE0 public: void __thiscall zMAT4::PostRotateZ(float)
const int zMAT4__PostRotateZ_G1 = 5274336;
//0x005177D0 public: void __thiscall zMAT4::PostRotateZ(float)
const int zMAT4__PostRotateZ_G2 = 5339088;
if (!trafoPtr) { return; };
const int call = 0;
if (CALL_Begin(call)) {
CALL_FloatParam (_@ (degrees));
CALL__thiscall (_@ (trafoPtr), MEMINT_SwitchG1G2(zMAT4__PostRotateZ_G1, zMAT4__PostRotateZ_G2));
call = CALL_End();