summaryrefslogtreecommitdiff
path: root/libs/JSystem/J3DGraphLoader/J3DMaterialFactory.cpp
blob: d928c4ed574740a5e3a19987f1711dd4de136ebf (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
//
// Generated By: dol2asm
// Translation Unit: J3DMaterialFactory
//

#include "JSystem/J3DGraphLoader/J3DMaterialFactory.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include "JSystem/JSupport/JSupport.h"
#include "dol2asm.h"

//
// Forward References:
//

extern "C" void __ct__18J3DMaterialFactoryFRC16J3DMaterialBlock();
extern "C" void __ct__18J3DMaterialFactoryFRC18J3DMaterialDLBlock();
extern "C" void countUniqueMaterials__18J3DMaterialFactoryFv();
extern "C" void countTexGens__18J3DMaterialFactoryCFi();
extern "C" void countStages__18J3DMaterialFactoryCFi();
extern "C" void
create__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl();
extern "C" void createNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl();
extern "C" void createPatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl();
extern "C" void modifyPatchedCurrentMtx__18J3DMaterialFactoryCFP11J3DMateriali();
extern "C" void createLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl();
extern "C" void
calcSize__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl();
extern "C" void calcSizeNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl();
extern "C" void calcSizePatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl();
extern "C" void calcSizeLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl();
extern "C" void newMatColor__18J3DMaterialFactoryCFii();
extern "C" void newColorChanNum__18J3DMaterialFactoryCFi();
extern "C" void newColorChan__18J3DMaterialFactoryCFii();
extern "C" void newAmbColor__18J3DMaterialFactoryCFii();
extern "C" void newTexGenNum__18J3DMaterialFactoryCFi();
extern "C" void newTexCoord__18J3DMaterialFactoryCFii();
extern "C" void newTexMtx__18J3DMaterialFactoryCFii();
extern "C" void newCullMode__18J3DMaterialFactoryCFi();
extern "C" void newTexNo__18J3DMaterialFactoryCFii();
extern "C" void newTevOrder__18J3DMaterialFactoryCFii();
extern "C" void newTevColor__18J3DMaterialFactoryCFii();
extern "C" void newTevKColor__18J3DMaterialFactoryCFii();
extern "C" void newTevStageNum__18J3DMaterialFactoryCFi();
extern "C" void newTevStage__18J3DMaterialFactoryCFii();
extern "C" void newTevSwapModeTable__18J3DMaterialFactoryCFii();
extern "C" void newIndTexStageNum__18J3DMaterialFactoryCFi();
extern "C" void newIndTexOrder__18J3DMaterialFactoryCFii();
extern "C" void newIndTexMtx__18J3DMaterialFactoryCFii();
extern "C" void newIndTevStage__18J3DMaterialFactoryCFii();
extern "C" void newIndTexCoordScale__18J3DMaterialFactoryCFii();
extern "C" void newFog__18J3DMaterialFactoryCFi();
extern "C" void newAlphaComp__18J3DMaterialFactoryCFi();
extern "C" void newBlend__18J3DMaterialFactoryCFi();
extern "C" void newZMode__18J3DMaterialFactoryCFi();
extern "C" void newZCompLoc__18J3DMaterialFactoryCFi();
extern "C" void newDither__18J3DMaterialFactoryCFi();
extern "C" void newNBTScale__18J3DMaterialFactoryCFi();
extern "C" void load__14J3DPEBlockNullFv();
extern "C" void getType__14J3DPEBlockNullFv();
extern "C" void __dt__14J3DPEBlockNullFv();
extern "C" void reset__15J3DTevBlockNullFP11J3DTevBlock();
extern "C" void ptrToIndex__15J3DTevBlockNullFv();
extern "C" void indexToPtr__15J3DTevBlockNullFv();
extern "C" void getType__15J3DTevBlockNullFv();
extern "C" void __dt__15J3DTevBlockNullFv();
extern "C" void calc__18J3DTexGenBlockNullFPA4_Cf();
extern "C" void calcWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf();
extern "C" void calcPostTexMtx__18J3DTexGenBlockNullFPA4_Cf();
extern "C" void calcPostTexMtxWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf();
extern "C" void load__18J3DTexGenBlockNullFv();
extern "C" void patch__18J3DTexGenBlockNullFv();
extern "C" void diff__18J3DTexGenBlockNullFUl();
extern "C" void diffTexMtx__18J3DTexGenBlockNullFv();
extern "C" void diffTexGen__18J3DTexGenBlockNullFv();
extern "C" void getType__18J3DTexGenBlockNullFv();
extern "C" void __dt__18J3DTexGenBlockNullFv();
extern "C" void getType__17J3DColorBlockNullFv();
extern "C" void __dt__17J3DColorBlockNullFv();
extern "C" void __dt__11J3DMaterialFv();
extern "C" void func_80332BDC(void* _this, void const*, void const*);
extern "C" void func_80332BF4(void* _this, void const*, void const*);
extern "C" void func_80332C0C(void* _this, void const*, void const*);
extern "C" void func_80332C24(void* _this, void const*, void const*);
extern "C" void func_80332C3C(void* _this, void const*, void const*);
extern "C" void func_80332C54(void* _this, void const*, void const*);
extern "C" void func_80332C6C(void* _this, void const*, void const*);
extern "C" void func_80332C84(void* _this, void const*, void const*);
extern "C" void func_80332C9C(void* _this, void const*, void const*);
extern "C" void func_80332CB4(void* _this, void const*, void const*);
extern "C" void func_80332CCC(void* _this, void const*, void const*);
extern "C" void func_80332CE4(void* _this, void const*, void const*);
extern "C" void func_80332CFC(void* _this, void const*, void const*);
extern "C" void func_80332D14(void* _this, void const*, void const*);
extern "C" void func_80332D2C(void* _this, void const*, void const*);
extern "C" void func_80332D44(void* _this, void const*, void const*);
extern "C" void func_80332D5C(void* _this, void const*, void const*);
extern "C" void func_80332D74(void* _this, void const*, void const*);
extern "C" void func_80332D8C(void* _this, void const*, void const*);

//
// External References:
//

extern "C" void patchTexNoAndTexCoordScale__11J3DTevBlockFv();
extern "C" void patch__10J3DPEBlockFv();
extern "C" void patchLight__13J3DColorBlockFv();
extern "C" void patch__11J3DTevBlockFv();
extern "C" bool getZCompLoc__10J3DPEBlockCFv();
extern "C" bool getZMode__10J3DPEBlockFv();
extern "C" bool getBlend__10J3DPEBlockFv();
extern "C" bool getAlphaComp__10J3DPEBlockFv();
extern "C" bool getFog__10J3DPEBlockFv();
extern "C" bool getIndTevStage__11J3DTevBlockFUl();
extern "C" bool getTevStage__11J3DTevBlockFUl();
extern "C" void getTexNo__11J3DTevBlockCFUl();
extern "C" bool getTevSwapModeTable__11J3DTevBlockFUl();
extern "C" bool getTevKAlphaSel__11J3DTevBlockFUl();
extern "C" bool getTevKColorSel__11J3DTevBlockFUl();
extern "C" bool getTevOrder__11J3DTevBlockFUl();
extern "C" bool getTevKColor__11J3DTevBlockFUl();
extern "C" bool getTevColor__11J3DTevBlockFUl();
extern "C" bool getTevStageNum__11J3DTevBlockCFv();
extern "C" bool getTexMtx__14J3DTexGenBlockFUl();
extern "C" bool getTexCoord__14J3DTexGenBlockFUl();
extern "C" bool getTexGenNum__14J3DTexGenBlockCFv();
extern "C" bool getAmbColor__13J3DColorBlockFUl();
extern "C" bool getColorChan__13J3DColorBlockFUl();
extern "C" bool getMatColor__13J3DColorBlockFUl();
extern "C" bool getColorChanNum__13J3DColorBlockCFv();
extern "C" void setZCompLoc__10J3DPEBlockFUc();
extern "C" void setZMode__10J3DPEBlockF8J3DZMode();
extern "C" void setBlend__10J3DPEBlockFRC8J3DBlend();
extern "C" void setAlphaComp__10J3DPEBlockFRC12J3DAlphaComp();
extern "C" void setIndTevStage__11J3DTevBlockFUl14J3DIndTevStage();
extern "C" void setTevStage__11J3DTevBlockFUl11J3DTevStage();
extern "C" void setTexNo__11J3DTevBlockFUlUs();
extern "C" void setTevSwapModeTable__11J3DTevBlockFUl19J3DTevSwapModeTable();
extern "C" void setTevKAlphaSel__11J3DTevBlockFUlUc();
extern "C" void setTevKColorSel__11J3DTevBlockFUlUc();
extern "C" void setTevOrder__11J3DTevBlockFUl11J3DTevOrder();
extern "C" void setTevKColor__11J3DTevBlockFUl10J3DGXColor();
extern "C" void setTevColor__11J3DTevBlockFUl13J3DGXColorS10();
extern "C" void setTevStageNum__11J3DTevBlockFUc();
extern "C" void setTexCoord__14J3DTexGenBlockFUlPC11J3DTexCoord();
extern "C" void setTexGenNum__14J3DTexGenBlockFUl();
extern "C" void setAmbColor__13J3DColorBlockFUl10J3DGXColor();
extern "C" void setColorChan__13J3DColorBlockFUlRC12J3DColorChan();
extern "C" void setMatColor__13J3DColorBlockFUl10J3DGXColor();
extern "C" void setColorChanNum__13J3DColorBlockFUc();
extern "C" void __ct__11J3DTevOrderFv();
extern "C" void __ct__14J3DIndTevStageFv();
extern "C" void __ct__11J3DTevStageFv();
extern "C" void __ct__13J3DGXColorS10Fv();
extern "C" void __ct__11J3DTexCoordFv();
extern "C" void __ct__10J3DGXColorFv();
extern "C" void __ct__11J3DTevStageFRC15J3DTevStageInfo();
extern "C" void setTexMtx__14J3DTexGenBlockFUlP9J3DTexMtx();
extern "C" void setTevKColor__11J3DTevBlockFUlPC10J3DGXColor();
extern "C" void setTevColor__11J3DTevBlockFUlPC13J3DGXColorS10();
extern "C" void setLight__13J3DColorBlockFUlP11J3DLightObj();
extern "C" void setAmbColor__13J3DColorBlockFUlPC10J3DGXColor();
extern "C" void* __nw__FUl();
extern "C" void __dl__FPv();
extern "C" GXColorS10* func_802F41E8(void const*, void const*);
extern "C" u8* func_802F4260(void const*, void const*);
extern "C" GXColor* func_802F4278(void const*, void const*);
extern "C" GXCullMode* func_802F4290(void const*, void const*);
extern "C" u16* func_802F42C0(void const*, void const*);
extern "C" void setSingleDisplayList__17J3DDisplayListObjFPvUl();
extern "C" void createColorBlock__11J3DMaterialFUl();
extern "C" void createTexGenBlock__11J3DMaterialFUl();
extern "C" void createTevBlock__11J3DMaterialFi();
extern "C" void createIndBlock__11J3DMaterialFi();
extern "C" void createPEBlock__11J3DMaterialFUlUl();
extern "C" void calcSizeColorBlock__11J3DMaterialFUl();
extern "C" void calcSizeTexGenBlock__11J3DMaterialFUl();
extern "C" void calcSizeTevBlock__11J3DMaterialFi();
extern "C" void calcSizeIndBlock__11J3DMaterialFi();
extern "C" void calcSizePEBlock__11J3DMaterialFUlUl();
extern "C" void initialize__11J3DMaterialFv();
extern "C" void initialize__18J3DPatchedMaterialFv();
extern "C" void initialize__17J3DLockedMaterialFv();
extern "C" bool countDLSize__14J3DTexGenBlockFv();
extern "C" bool countDLSize__13J3DColorBlockFv();
extern "C" bool countDLSize__11J3DTevBlockFv();
extern "C" bool countDLSize__10J3DPEBlockFv();
extern "C" void load__13J3DColorBlockFv();
extern "C" s32 getCullMode__13J3DColorBlockCFv();
extern "C" void load__11J3DTevBlockFv();
extern "C" bool getNBTScale__14J3DTexGenBlockFv();
extern "C" void patch__13J3DColorBlockFv();
extern "C" void diff__13J3DColorBlockFUl();
extern "C" void diff__10J3DPEBlockFUl();
extern "C" void reset__10J3DPEBlockFP10J3DPEBlock();
extern "C" void reset__14J3DTexGenBlockFP14J3DTexGenBlock();
extern "C" void reset__13J3DColorBlockFP13J3DColorBlock();
extern "C" void diffFog__10J3DPEBlockFv();
extern "C" void diffBlend__10J3DPEBlockFv();
extern "C" void setFog__10J3DPEBlockFP6J3DFog();
extern "C" void setFog__10J3DPEBlockF6J3DFog();
extern "C" void setAlphaComp__10J3DPEBlockFPC12J3DAlphaComp();
extern "C" void setBlend__10J3DPEBlockFPC8J3DBlend();
extern "C" void setZMode__10J3DPEBlockFPC8J3DZMode();
extern "C" void setZCompLoc__10J3DPEBlockFPCUc();
extern "C" void setDither__10J3DPEBlockFUc();
extern "C" void setDither__10J3DPEBlockFPCUc();
extern "C" bool getDither__10J3DPEBlockCFv();
extern "C" bool getFogOffset__10J3DPEBlockCFv();
extern "C" void setFogOffset__10J3DPEBlockFUl();
extern "C" void setTexGenNum__14J3DTexGenBlockFPCUl();
extern "C" void setNBTScale__14J3DTexGenBlockF11J3DNBTScale();
extern "C" void setNBTScale__14J3DTexGenBlockFPC11J3DNBTScale();
extern "C" bool getTexMtxOffset__14J3DTexGenBlockCFv();
extern "C" void setTexMtxOffset__14J3DTexGenBlockFUl();
extern "C" void patchMatColor__13J3DColorBlockFv();
extern "C" void diffAmbColor__13J3DColorBlockFv();
extern "C" void diffMatColor__13J3DColorBlockFv();
extern "C" void diffColorChan__13J3DColorBlockFv();
extern "C" void diffLightObj__13J3DColorBlockFUl();
extern "C" void setMatColor__13J3DColorBlockFUlPC10J3DGXColor();
extern "C" void setColorChanNum__13J3DColorBlockFPCUc();
extern "C" void setColorChan__13J3DColorBlockFUlPC12J3DColorChan();
extern "C" bool getLight__13J3DColorBlockFUl();
extern "C" void setCullMode__13J3DColorBlockFUc();
extern "C" void setCullMode__13J3DColorBlockFPCUc();
extern "C" bool getMatColorOffset__13J3DColorBlockCFv();
extern "C" bool getColorChanOffset__13J3DColorBlockCFv();
extern "C" void setMatColorOffset__13J3DColorBlockFUl();
extern "C" void setColorChanOffset__13J3DColorBlockFUl();
extern "C" void initialize__21J3DTexGenBlockPatchedFv();
extern "C" void initialize__15J3DTevBlockNullFv();
extern "C" void initialize__18J3DTevBlockPatchedFv();
extern "C" void diff__11J3DTevBlockFUl();
extern "C" void indexToPtr_private__11J3DTevBlockFUl();
extern "C" void diffTevReg__11J3DTevBlockFv();
extern "C" void diffTevStageIndirect__11J3DTevBlockFv();
extern "C" void diffTevStage__11J3DTevBlockFv();
extern "C" void diffTexCoordScale__11J3DTevBlockFv();
extern "C" void diffTexNo__11J3DTevBlockFv();
extern "C" void setTexNoOffset__11J3DTevBlockFUl();
extern "C" void setTevKColorSel__11J3DTevBlockFUlPCUc();
extern "C" void setTevKAlphaSel__11J3DTevBlockFUlPCUc();
extern "C" void setTevSwapModeInfo__11J3DTevBlockFUl18J3DTevSwapModeInfo();
extern "C" void setTevSwapModeInfo__11J3DTevBlockFUlPC18J3DTevSwapModeInfo();
extern "C" void setTevSwapModeTable__11J3DTevBlockFUlPC19J3DTevSwapModeTable();
extern "C" bool getTevRegOffset__11J3DTevBlockCFv();
extern "C" void setTevRegOffset__11J3DTevBlockFUl();
extern "C" void patchTexNo__11J3DTevBlockFv();
extern "C" void patchTevReg__11J3DTevBlockFv();
extern "C" void setTexNo__11J3DTevBlockFUlPCUs();
extern "C" void setTevOrder__11J3DTevBlockFUlPC11J3DTevOrder();
extern "C" void setTevStageNum__11J3DTevBlockFPCUc();
extern "C" void setTevStage__11J3DTevBlockFUlPC11J3DTevStage();
extern "C" void setIndTevStage__11J3DTevBlockFUlPC14J3DIndTevStage();
extern "C" bool getTexNoOffset__11J3DTevBlockCFv();
extern "C" void __as__13J3DTexMtxInfoFRC13J3DTexMtxInfo();
extern "C" void __as__16J3DIndTexMtxInfoFRC16J3DIndTexMtxInfo();
extern "C" void __as__10J3DFogInfoFRC10J3DFogInfo();
extern "C" void __construct_array();
extern "C" void _savegpr_18();
extern "C" void _savegpr_19();
extern "C" void _savegpr_24();
extern "C" void _savegpr_26();
extern "C" void _savegpr_28();
extern "C" void _savegpr_29();
extern "C" void _restgpr_18();
extern "C" void _restgpr_19();
extern "C" void _restgpr_24();
extern "C" void _restgpr_26();
extern "C" void _restgpr_28();
extern "C" void _restgpr_29();
extern "C" extern void* __vt__17J3DLockedMaterial[12];
extern "C" extern void* __vt__18J3DPatchedMaterial[12];
extern "C" extern void* __vt__11J3DMaterial[12];
extern "C" extern void* __vt__10J3DPEBlock[31];
extern "C" extern void* __vt__15J3DIndBlockNull[19];
extern "C" extern void* __vt__11J3DIndBlock[19];
extern "C" extern void* __vt__14J3DTexGenBlock[27];
extern "C" extern void* __vt__13J3DColorBlock[36];
extern "C" extern void* __vt__18J3DTevBlockPatched[55];
extern "C" extern void* __vt__21J3DTexGenBlockPatched[27];
extern "C" extern void* __vt__11J3DTevBlock[55];

//
// Declarations:
//

/* 8032FFEC-80330234 32A92C 0248+00 0/0 7/7 0/0 .text
 * __ct__18J3DMaterialFactoryFRC16J3DMaterialBlock              */
J3DMaterialFactory::J3DMaterialFactory(J3DMaterialBlock const& i_block) {
    mMaterialNum = i_block.mMaterialNum;
    mpMaterialInitData = JSUConvertOffsetToPtr<J3DMaterialInitData>(&i_block, i_block.mpMaterialInitData);
    mpMaterialID = JSUConvertOffsetToPtr<u16>(&i_block, i_block.mpMaterialID);
    if (i_block.mpIndInitData != NULL && (u32)i_block.mpIndInitData - (u32)i_block.mpNameTable > 4) {
        mpIndInitData = JSUConvertOffsetToPtr<J3DIndInitData>(&i_block, i_block.mpIndInitData);
    } else {
        mpIndInitData = NULL;
    }
    mpCullMode = JSUConvertOffsetToPtr<GXCullMode>(&i_block, i_block.mpCullMode);
    mpMatColor = JSUConvertOffsetToPtr<GXColor>(&i_block, i_block.mpMatColor);
    mpColorChanNum = JSUConvertOffsetToPtr<u8>(&i_block, i_block.mpColorChanNum);
    mpColorChanInfo = JSUConvertOffsetToPtr<J3DColorChanInfo>(&i_block, i_block.mpColorChanInfo);
    mpAmbColor = JSUConvertOffsetToPtr<GXColor>(&i_block, i_block.mpAmbColor);
    mpLightInfo = JSUConvertOffsetToPtr<J3DLightInfo>(&i_block, i_block.mpLightInfo);
    mpTexGenNum = JSUConvertOffsetToPtr<u8>(&i_block, i_block.mpTexGenNum);
    mpTexCoordInfo = JSUConvertOffsetToPtr<J3DTexCoordInfo>(&i_block, i_block.mpTexCoordInfo);
    mpTexCoord2Info = JSUConvertOffsetToPtr<J3DTexCoord2Info>(&i_block, i_block.mpTexCoord2Info);
    mpTexMtxInfo = JSUConvertOffsetToPtr<J3DTexMtxInfo>(&i_block, i_block.mpTexMtxInfo);
    field_0x34 = JSUConvertOffsetToPtr<J3DTexMtxInfo>(&i_block, i_block.field_0x44);
    mpTexNo = JSUConvertOffsetToPtr<u16>(&i_block, i_block.mpTexNo);
    mpTevOrderInfo = JSUConvertOffsetToPtr<J3DTevOrderInfo>(&i_block, i_block.mpTevOrderInfo);
    mpTevColor = JSUConvertOffsetToPtr<GXColorS10>(&i_block, i_block.mpTevColor);
    mpTevKColor = JSUConvertOffsetToPtr<GXColor>(&i_block, i_block.mpTevKColor);
    mpTevStageNum = JSUConvertOffsetToPtr<u8>(&i_block, i_block.mpTevStageNum);
    mpTevStageInfo = JSUConvertOffsetToPtr<J3DTevStageInfo>(&i_block, i_block.mpTevStageInfo);
    mpTevSwapModeInfo = JSUConvertOffsetToPtr<J3DTevSwapModeInfo>(&i_block, i_block.mpTevSwapModeInfo);
    mpTevSwapModeTableInfo = JSUConvertOffsetToPtr<J3DTevSwapModeTableInfo>(&i_block, i_block.mpTevSwapModeTableInfo);
    mpFogInfo = JSUConvertOffsetToPtr<J3DFogInfo>(&i_block, i_block.mpFogInfo);
    mpAlphaCompInfo = JSUConvertOffsetToPtr<J3DAlphaCompInfo>(&i_block, i_block.mpAlphaCompInfo);
    mpBlendInfo = JSUConvertOffsetToPtr<J3DBlendInfo>(&i_block, i_block.mpBlendInfo);
    mpZModeInfo = JSUConvertOffsetToPtr<J3DZModeInfo>(&i_block, i_block.mpZModeInfo);
    mpZCompLoc = JSUConvertOffsetToPtr<u8>(&i_block, i_block.mpZCompLoc);
    mpDither = JSUConvertOffsetToPtr<u8>(&i_block, i_block.mpDither);
    mpNBTScaleInfo = JSUConvertOffsetToPtr<J3DNBTScaleInfo>(&i_block, i_block.mpNBTScaleInfo);
    mpDisplayListInit = NULL;
    mpPatchingInfo = NULL;
    mpCurrentMtxInfo = NULL;
    mpMaterialMode = NULL;
}

/* 80330234-803302BC 32AB74 0088+00 0/0 2/2 0/0 .text
 * __ct__18J3DMaterialFactoryFRC18J3DMaterialDLBlock            */
J3DMaterialFactory::J3DMaterialFactory(J3DMaterialDLBlock const& i_block) {
    mMaterialNum = i_block.mMaterialNum;
    mpMaterialInitData = NULL;
    mpDisplayListInit = JSUConvertOffsetToPtr<J3DDisplayListInit>(&i_block, i_block.mpDisplayListInit);
    mpPatchingInfo = JSUConvertOffsetToPtr<J3DPatchingInfo>(&i_block, i_block.mpPatchingInfo);
    mpCurrentMtxInfo = JSUConvertOffsetToPtr<J3DCurrentMtxInfo>(&i_block, i_block.mpCurrentMtxInfo);
    mpMaterialMode = JSUConvertOffsetToPtr<u8>(&i_block, i_block.mpMaterialMode);
}

/* 803302BC-80330304 32ABFC 0048+00 0/0 3/3 0/0 .text countUniqueMaterials__18J3DMaterialFactoryFv
 */
u16 J3DMaterialFactory::countUniqueMaterials() {
    u16 count = 0;
    s32 id = -1;
    for (u16 i = 0; i < mMaterialNum; i++) {
        if (id < mpMaterialID[i]) {
            count++;
            id = mpMaterialID[i];
        }
    }
    return count;
}

/* 80330304-8033033C 32AC44 0038+00 4/4 0/0 0/0 .text countTexGens__18J3DMaterialFactoryCFi */
u32 J3DMaterialFactory::countTexGens(int i_idx) const {
    u8 tex_gen_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexGenNumIdx;
    if (tex_gen_num_index != 0xff) {
        return mpTexGenNum[tex_gen_num_index];
    }
    return 0;
}

/* 8033033C-803303C4 32AC7C 0088+00 2/2 0/0 0/0 .text countStages__18J3DMaterialFactoryCFi */
u32 J3DMaterialFactory::countStages(int i_idx) const {
    J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    u32 count1 = 0;
    u32 count2 = 0;
    u8 tev_stage_num_index = init_data->mTevStageNumIdx;
    if (tev_stage_num_index != 0xff) {
        count2 = mpTevStageNum[tev_stage_num_index];
    }
    for (int i = 0; i < 8; i++) {
        if (init_data->mTexNoIdx[i] != 0xffff) {
            count1++;
        }
    }
    if (count2 != count1 && count1 != 0) {
        if (count2 > count1) {
            return count2;
        } else {
            return count1;
        }
    }
    return count2;
}

/* 803303C4-80330440 32AD04 007C+00 0/0 4/4 0/0 .text
 * create__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl */
J3DMaterial* J3DMaterialFactory::create(J3DMaterial* i_material, MaterialType i_type,
                                        int i_idx, u32 i_flags) const {
    switch (i_type) {
        case MATERIAL_TYPE_NORMAL:
            i_material = createNormalMaterial(i_material, i_idx, i_flags);
            break;
        case MATERIAL_TYPE_LOCKED:
            i_material = createLockedMaterial(i_material, i_idx, i_flags);
            break;
        case MATERIAL_TYPE_PATCHED:
            i_material = createPatchedMaterial(i_material, i_idx, i_flags);
            break;
    }
    return i_material;
}

/* 80330440-80330D84 32AD80 0944+00 1/1 0/0 0/0 .text
 * createNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
#ifdef NONMATCHING
J3DMaterial* J3DMaterialFactory::createNormalMaterial(J3DMaterial* i_material, int i_idx,
                                                      u32 i_flags) const {
    if (mpDisplayListInit != NULL) {
        return createLockedMaterial(i_material, i_idx, i_flags);
    }
    u32 stages = countStages(i_idx);
    u32 tev_stage_num = getMdlDataFlag_TevStageNum(i_flags);
    if (stages > tev_stage_num) {
        tev_stage_num = stages;
    }
    u32 u1 = 8;
    if (tev_stage_num <= 8) {
        u1 = tev_stage_num;
    }
    u32 texgens = countTexGens(i_idx);
    u32 texgen_flag = texgens > 4 ? 0 : getMdlDataFlag_TexGenFlag(i_flags);
    u32 color_flag = getMdlDataFlag_ColorFlag(i_flags);
    u32 pe_flag = getMdlDataFlag_PEFlag(i_flags);
    bool ind_flag = (i_flags & 0x1000000) != 0;
    if (i_material == NULL) {
        i_material = new J3DMaterial();
    }
    i_material->mColorBlock = J3DMaterial::createColorBlock(color_flag);
    i_material->mTexGenBlock = J3DMaterial::createTexGenBlock(texgen_flag);
    i_material->mTevBlock = J3DMaterial::createTevBlock((u16)tev_stage_num);
    i_material->mIndBlock = J3DMaterial::createIndBlock(ind_flag);
    i_material->mPEBlock = J3DMaterial::createPEBlock(pe_flag, getMaterialMode(i_idx));
    i_material->mIndex = i_idx;
    i_material->mMaterialMode = getMaterialMode(i_idx);
    i_material->mColorBlock->setColorChanNum(newColorChanNum(i_idx));
    i_material->mColorBlock->setCullMode(newCullMode(i_idx));
    i_material->mTexGenBlock->setTexGenNum(newTexGenNum(i_idx));
    i_material->mTexGenBlock->setNBTScale(newNBTScale(i_idx));
    i_material->mPEBlock->setFog(newFog(i_idx));
    i_material->mPEBlock->setAlphaComp(newAlphaComp(i_idx));
    i_material->mPEBlock->setBlend(newBlend(i_idx));
    i_material->mPEBlock->setZMode(newZMode(i_idx));
    i_material->mPEBlock->setZCompLoc(newZCompLoc(i_idx));
    i_material->mPEBlock->setDither(newDither(i_idx));
    i_material->mTevBlock->setTevStageNum(newTevStageNum(i_idx));
    for (u8 i = 0; i < u1; i++) {
        i_material->mTevBlock->setTexNo(i, newTexNo(i_idx, i));
    }
    for (u8 i = 0; i < tev_stage_num; i++) {
        i_material->mTevBlock->setTevOrder(i, newTevOrder(i_idx, i));
    }
    for (u8 i = 0; i < tev_stage_num; i++) {
        J3DMaterialInitData* material_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
        i_material->mTevBlock->setTevStage(i, newTevStage(i_idx, i));
        if (material_init_data->mTevSwapModeIdx[i] != 0xffff) {
            i_material->mTevBlock->getTevStage(i)->setTexSel(
                mpTevSwapModeInfo[material_init_data->mTevSwapModeIdx[i]].mTexSel);
            i_material->mTevBlock->getTevStage(i)->setRasSel(
                mpTevSwapModeInfo[material_init_data->mTevSwapModeIdx[i]].mRasSel);
        }
    }
    for (u8 i = 0; i < 4; i++) {
        i_material->mTevBlock->setTevKColor(i, newTevKColor(i_idx, i));
    }
    for (u8 i = 0; i < 4; i++) {
        i_material->mTevBlock->setTevColor(i, newTevColor(i_idx, i));
    }
    for (u8 i = 0; i < 4; i++) {
        i_material->mTevBlock->setTevSwapModeTable(i, newTevSwapModeTable(i_idx, i));
    }
    for (u8 i = 0; i < 2; i++) {
        i_material->mColorBlock->setAmbColor(i, newAmbColor(i_idx, i));
    }
    for (u8 i = 0; i < 2; i++) {
        i_material->mColorBlock->setMatColor(i, newMatColor(i_idx, i));
    }
    for (u8 i = 0; i < 4; i++) {
        i_material->mColorBlock->setColorChan(i, newColorChan(i_idx, i));
    }
    for (u8 i = 0; i < texgens; i++) {
        J3DTexCoord tex_coord = newTexCoord(i_idx, i);
        i_material->mTexGenBlock->setTexCoord(i, &tex_coord);
    }
    for (u8 i = 0; i < 8; i++) {
        i_material->mTexGenBlock->setTexMtx(i, newTexMtx(i_idx, i));
    }
    J3DMaterialInitData* material_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    for (u8 i = 0; i < tev_stage_num; i++) {
        if (material_init_data->mTevKColorSel[i] != 0xff) {
            i_material->mTevBlock->setTevKColorSel(i, material_init_data->mTevKColorSel[i]);
        } else {
            i_material->mTevBlock->setTevKColorSel(i, 0xc);
        }
    }
    for (u8 i = 0; i < tev_stage_num; i++) {
        if (material_init_data->mTevKAlphaSel[i] != 0xff) {
            i_material->mTevBlock->setTevKAlphaSel(i, material_init_data->mTevKAlphaSel[i]);
        } else {
            i_material->mTevBlock->setTevKAlphaSel(i, 0x1c);
        }
    }
    if (mpIndInitData != NULL) {
        u8 ind_tex_stage_num = newIndTexStageNum(i_idx);
        i_material->mIndBlock->setIndTexStageNum(newIndTexStageNum(i_idx));
        for (u8 i = 0; i < ind_tex_stage_num; i++) {
            i_material->mIndBlock->setIndTexMtx(i, newIndTexMtx(i_idx, i));
        }
        for (u8 i = 0; i < ind_tex_stage_num; i++) {
            i_material->mIndBlock->setIndTexOrder(i, newIndTexOrder(i_idx, i));
        }
        for (u8 i = 0; i < ind_tex_stage_num; i++) {
            i_material->mIndBlock->setIndTexCoordScale(i, newIndTexCoordScale(i_idx, i));
        }
        for (u8 i = 0; i < tev_stage_num; i++) {
            i_material->mTevBlock->setIndTevStage(i, newIndTevStage(i_idx, i));
        }
    }
    return i_material;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm J3DMaterial* J3DMaterialFactory::createNormalMaterial(J3DMaterial* param_0, int param_1,
                                                  u32 param_2) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/createNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s"
}
#pragma pop
#endif

/* 80330D84-8033168C 32B6C4 0908+00 1/1 0/0 0/0 .text
 * createPatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm J3DMaterial* J3DMaterialFactory::createPatchedMaterial(J3DMaterial* param_0, int param_1,
                                                   u32 param_2) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/createPatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s"
}
#pragma pop

/* 8033168C-803317D4 32BFCC 0148+00 0/0 1/1 0/0 .text
 * modifyPatchedCurrentMtx__18J3DMaterialFactoryCFP11J3DMateriali */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J3DMaterialFactory::modifyPatchedCurrentMtx(J3DMaterial* param_0, int param_1) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/modifyPatchedCurrentMtx__18J3DMaterialFactoryCFP11J3DMateriali.s"
}
#pragma pop

/* 803CEE90-803CEF0C 02BFB0 007C+00 2/2 0/0 0/0 .data            __vt__14J3DPEBlockNull */
SECTION_DATA extern void* __vt__14J3DPEBlockNull[31] = {
    (void*)NULL /* RTTI */,
    (void*)NULL,
    (void*)reset__10J3DPEBlockFP10J3DPEBlock,
    (void*)load__14J3DPEBlockNullFv,
    (void*)patch__10J3DPEBlockFv,
    (void*)diff__10J3DPEBlockFUl,
    (void*)diffFog__10J3DPEBlockFv,
    (void*)diffBlend__10J3DPEBlockFv,
    (void*)countDLSize__10J3DPEBlockFv,
    (void*)getType__14J3DPEBlockNullFv,
    (void*)setFog__10J3DPEBlockF6J3DFog,
    (void*)setFog__10J3DPEBlockFP6J3DFog,
    (void*)getFog__10J3DPEBlockFv,
    (void*)setAlphaComp__10J3DPEBlockFPC12J3DAlphaComp,
    (void*)setAlphaComp__10J3DPEBlockFRC12J3DAlphaComp,
    (void*)getAlphaComp__10J3DPEBlockFv,
    (void*)setBlend__10J3DPEBlockFPC8J3DBlend,
    (void*)setBlend__10J3DPEBlockFRC8J3DBlend,
    (void*)getBlend__10J3DPEBlockFv,
    (void*)setZMode__10J3DPEBlockFPC8J3DZMode,
    (void*)setZMode__10J3DPEBlockF8J3DZMode,
    (void*)getZMode__10J3DPEBlockFv,
    (void*)setZCompLoc__10J3DPEBlockFPCUc,
    (void*)setZCompLoc__10J3DPEBlockFUc,
    (void*)getZCompLoc__10J3DPEBlockCFv,
    (void*)setDither__10J3DPEBlockFPCUc,
    (void*)setDither__10J3DPEBlockFUc,
    (void*)getDither__10J3DPEBlockCFv,
    (void*)getFogOffset__10J3DPEBlockCFv,
    (void*)setFogOffset__10J3DPEBlockFUl,
    (void*)__dt__14J3DPEBlockNullFv,
};

/* 803CEF0C-803CEFE8 02C02C 00DC+00 2/2 0/0 0/0 .data            __vt__15J3DTevBlockNull */
SECTION_DATA extern void* __vt__15J3DTevBlockNull[55] = {
    (void*)NULL /* RTTI */,
    (void*)NULL,
    (void*)reset__15J3DTevBlockNullFP11J3DTevBlock,
    (void*)load__11J3DTevBlockFv,
    (void*)diff__11J3DTevBlockFUl,
    (void*)diffTexNo__11J3DTevBlockFv,
    (void*)diffTevReg__11J3DTevBlockFv,
    (void*)diffTexCoordScale__11J3DTevBlockFv,
    (void*)diffTevStage__11J3DTevBlockFv,
    (void*)diffTevStageIndirect__11J3DTevBlockFv,
    (void*)patch__11J3DTevBlockFv,
    (void*)patchTexNo__11J3DTevBlockFv,
    (void*)patchTevReg__11J3DTevBlockFv,
    (void*)patchTexNoAndTexCoordScale__11J3DTevBlockFv,
    (void*)ptrToIndex__15J3DTevBlockNullFv,
    (void*)indexToPtr__15J3DTevBlockNullFv,
    (void*)getType__15J3DTevBlockNullFv,
    (void*)countDLSize__11J3DTevBlockFv,
    (void*)setTexNo__11J3DTevBlockFUlPCUs,
    (void*)setTexNo__11J3DTevBlockFUlUs,
    (void*)getTexNo__11J3DTevBlockCFUl,
    (void*)setTevOrder__11J3DTevBlockFUlPC11J3DTevOrder,
    (void*)setTevOrder__11J3DTevBlockFUl11J3DTevOrder,
    (void*)getTevOrder__11J3DTevBlockFUl,
    (void*)setTevColor__11J3DTevBlockFUlPC13J3DGXColorS10,
    (void*)setTevColor__11J3DTevBlockFUl13J3DGXColorS10,
    (void*)getTevColor__11J3DTevBlockFUl,
    (void*)setTevKColor__11J3DTevBlockFUlPC10J3DGXColor,
    (void*)setTevKColor__11J3DTevBlockFUl10J3DGXColor,
    (void*)getTevKColor__11J3DTevBlockFUl,
    (void*)setTevKColorSel__11J3DTevBlockFUlPCUc,
    (void*)setTevKColorSel__11J3DTevBlockFUlUc,
    (void*)getTevKColorSel__11J3DTevBlockFUl,
    (void*)setTevKAlphaSel__11J3DTevBlockFUlPCUc,
    (void*)setTevKAlphaSel__11J3DTevBlockFUlUc,
    (void*)getTevKAlphaSel__11J3DTevBlockFUl,
    (void*)setTevStageNum__11J3DTevBlockFPCUc,
    (void*)setTevStageNum__11J3DTevBlockFUc,
    (void*)getTevStageNum__11J3DTevBlockCFv,
    (void*)setTevStage__11J3DTevBlockFUlPC11J3DTevStage,
    (void*)setTevStage__11J3DTevBlockFUl11J3DTevStage,
    (void*)getTevStage__11J3DTevBlockFUl,
    (void*)setTevSwapModeInfo__11J3DTevBlockFUlPC18J3DTevSwapModeInfo,
    (void*)setTevSwapModeInfo__11J3DTevBlockFUl18J3DTevSwapModeInfo,
    (void*)setTevSwapModeTable__11J3DTevBlockFUlPC19J3DTevSwapModeTable,
    (void*)setTevSwapModeTable__11J3DTevBlockFUl19J3DTevSwapModeTable,
    (void*)getTevSwapModeTable__11J3DTevBlockFUl,
    (void*)setIndTevStage__11J3DTevBlockFUlPC14J3DIndTevStage,
    (void*)setIndTevStage__11J3DTevBlockFUl14J3DIndTevStage,
    (void*)getIndTevStage__11J3DTevBlockFUl,
    (void*)getTexNoOffset__11J3DTevBlockCFv,
    (void*)getTevRegOffset__11J3DTevBlockCFv,
    (void*)setTexNoOffset__11J3DTevBlockFUl,
    (void*)setTevRegOffset__11J3DTevBlockFUl,
    (void*)__dt__15J3DTevBlockNullFv,
};

/* 803CEFE8-803CF054 02C108 006C+00 2/2 0/0 0/0 .data            __vt__18J3DTexGenBlockNull */
SECTION_DATA extern void* __vt__18J3DTexGenBlockNull[27] = {
    (void*)NULL /* RTTI */,
    (void*)NULL,
    (void*)reset__14J3DTexGenBlockFP14J3DTexGenBlock,
    (void*)calc__18J3DTexGenBlockNullFPA4_Cf,
    (void*)calcWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf,
    (void*)calcPostTexMtx__18J3DTexGenBlockNullFPA4_Cf,
    (void*)calcPostTexMtxWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf,
    (void*)load__18J3DTexGenBlockNullFv,
    (void*)patch__18J3DTexGenBlockNullFv,
    (void*)diff__18J3DTexGenBlockNullFUl,
    (void*)diffTexMtx__18J3DTexGenBlockNullFv,
    (void*)diffTexGen__18J3DTexGenBlockNullFv,
    (void*)countDLSize__14J3DTexGenBlockFv,
    (void*)getType__18J3DTexGenBlockNullFv,
    (void*)setTexGenNum__14J3DTexGenBlockFPCUl,
    (void*)setTexGenNum__14J3DTexGenBlockFUl,
    (void*)getTexGenNum__14J3DTexGenBlockCFv,
    (void*)setTexCoord__14J3DTexGenBlockFUlPC11J3DTexCoord,
    (void*)getTexCoord__14J3DTexGenBlockFUl,
    (void*)setTexMtx__14J3DTexGenBlockFUlP9J3DTexMtx,
    (void*)getTexMtx__14J3DTexGenBlockFUl,
    (void*)setNBTScale__14J3DTexGenBlockFPC11J3DNBTScale,
    (void*)setNBTScale__14J3DTexGenBlockF11J3DNBTScale,
    (void*)getNBTScale__14J3DTexGenBlockFv,
    (void*)getTexMtxOffset__14J3DTexGenBlockCFv,
    (void*)setTexMtxOffset__14J3DTexGenBlockFUl,
    (void*)__dt__18J3DTexGenBlockNullFv,
};

/* 803CF054-803CF0E8 02C174 0090+04 2/2 0/0 0/0 .data            __vt__17J3DColorBlockNull */
SECTION_DATA extern void* __vt__17J3DColorBlockNull[36 + 1 /* padding */] = {
    (void*)NULL /* RTTI */,
    (void*)NULL,
    (void*)load__13J3DColorBlockFv,
    (void*)reset__13J3DColorBlockFP13J3DColorBlock,
    (void*)patch__13J3DColorBlockFv,
    (void*)patchMatColor__13J3DColorBlockFv,
    (void*)patchLight__13J3DColorBlockFv,
    (void*)diff__13J3DColorBlockFUl,
    (void*)diffAmbColor__13J3DColorBlockFv,
    (void*)diffMatColor__13J3DColorBlockFv,
    (void*)diffColorChan__13J3DColorBlockFv,
    (void*)diffLightObj__13J3DColorBlockFUl,
    (void*)countDLSize__13J3DColorBlockFv,
    (void*)getType__17J3DColorBlockNullFv,
    (void*)setMatColor__13J3DColorBlockFUlPC10J3DGXColor,
    (void*)setMatColor__13J3DColorBlockFUl10J3DGXColor,
    (void*)getMatColor__13J3DColorBlockFUl,
    (void*)setAmbColor__13J3DColorBlockFUlPC10J3DGXColor,
    (void*)setAmbColor__13J3DColorBlockFUl10J3DGXColor,
    (void*)getAmbColor__13J3DColorBlockFUl,
    (void*)setColorChanNum__13J3DColorBlockFUc,
    (void*)setColorChanNum__13J3DColorBlockFPCUc,
    (void*)getColorChanNum__13J3DColorBlockCFv,
    (void*)setColorChan__13J3DColorBlockFUlRC12J3DColorChan,
    (void*)setColorChan__13J3DColorBlockFUlPC12J3DColorChan,
    (void*)getColorChan__13J3DColorBlockFUl,
    (void*)setLight__13J3DColorBlockFUlP11J3DLightObj,
    (void*)getLight__13J3DColorBlockFUl,
    (void*)setCullMode__13J3DColorBlockFPCUc,
    (void*)setCullMode__13J3DColorBlockFUc,
    (void*)getCullMode__13J3DColorBlockCFv,
    (void*)getMatColorOffset__13J3DColorBlockCFv,
    (void*)getColorChanOffset__13J3DColorBlockCFv,
    (void*)setMatColorOffset__13J3DColorBlockFUl,
    (void*)setColorChanOffset__13J3DColorBlockFUl,
    (void*)__dt__17J3DColorBlockNullFv,
    /* padding */
    NULL,
};

/* 803317D4-80331A7C 32C114 02A8+00 2/2 0/0 0/0 .text
 * createLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
#ifdef NONMATCHING
// matches but makes the J3DMaterial destructor appear in the wrong place
J3DMaterial* J3DMaterialFactory::createLockedMaterial(J3DMaterial* i_material, int i_idx,
                                                      u32 i_flags) const {
    if (i_material == NULL) {
        i_material = new J3DLockedMaterial();
        i_material->mColorBlock = new J3DColorBlockNull();
        i_material->mTexGenBlock = new J3DTexGenBlockNull();
        i_material->mTevBlock = new J3DTevBlockNull();
        i_material->mIndBlock = new J3DIndBlockNull();
        i_material->mPEBlock = new J3DPEBlockNull();
        i_material->mIndex = i_idx;
        i_material->mMaterialMode = mpMaterialMode[i_idx];
    }

    i_material->mCurrentMtx = mpCurrentMtxInfo[i_idx];
    i_material->mColorBlock->setMatColorOffset(mpPatchingInfo[i_idx].mMatColorOffset);
    i_material->mColorBlock->setColorChanOffset(mpPatchingInfo[i_idx].mColorChanOffset);
    i_material->mTexGenBlock->setTexMtxOffset(mpPatchingInfo[i_idx].mTexMtxOffset);
    i_material->mTevBlock->setTexNoOffset(mpPatchingInfo[i_idx].mTexNoOffset);
    i_material->mTevBlock->setTevRegOffset(mpPatchingInfo[i_idx].mTevRegOffset);
    i_material->mPEBlock->setFogOffset(mpPatchingInfo[i_idx].mFogOffset);
    if (i_material->mSharedDLObj == NULL) {
        i_material->mSharedDLObj = new J3DDisplayListObj();
        i_material->mSharedDLObj->setSingleDisplayList((void*)(
            mpDisplayListInit[i_idx].mOffset + (u32)&mpDisplayListInit[i_idx]),
            mpDisplayListInit[i_idx].field_0x4
        );
    }
    return i_material;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm J3DMaterial* J3DMaterialFactory::createLockedMaterial(J3DMaterial* param_0, int param_1,
                                                  u32 param_2) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/createLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s"
}
#pragma pop
#endif

/* 80331A7C-80331AFC 32C3BC 0080+00 0/0 4/4 0/0 .text
 * calcSize__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl */
u32 J3DMaterialFactory::calcSize(J3DMaterial* i_material, J3DMaterialFactory::MaterialType i_type,
                                  int i_idx, u32 i_flags) const {
    u32 size = 0;
    switch (i_type) {
        case MATERIAL_TYPE_NORMAL:
            size = calcSizeNormalMaterial(i_material, i_idx, i_flags);
            break;
        case MATERIAL_TYPE_LOCKED:
            size = calcSizeLockedMaterial(i_material, i_idx, i_flags);
            break;
        case MATERIAL_TYPE_PATCHED:
            size = calcSizePatchedMaterial(i_material, i_idx, i_flags);
            break;
    }
    return size;
}

/* 80331AFC-80331C30 32C43C 0134+00 1/1 0/0 0/0 .text
 * calcSizeNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
#ifdef NONMATCHING
// regalloc
u32 J3DMaterialFactory::calcSizeNormalMaterial(J3DMaterial* i_material, int i_idx,
                                               u32 i_flags) const {
    u32 size = 0;
    if (mpDisplayListInit != NULL) {
        return calcSizeLockedMaterial(i_material, i_idx, i_flags);
    }

    u32 stages = countStages(i_idx);
    // u32 tev_stage_num = getMdlDataFlag_TevStageNum(i_flags);
    u32 tev_stage_num = (i_flags >> 0x10) & 0x1f;
    if (stages > tev_stage_num) {
        tev_stage_num = stages;
    }
    u32 tex_gens = countTexGens(i_flags);
    u32 tex_gen_flag = tex_gens > 4 ?
        getMdlDataFlag_TexGenFlag(0) : getMdlDataFlag_TexGenFlag(i_flags);
    u32 color_block_flag = getMdlDataFlag_ColorFlag(i_flags);
    u32 pe_flag = getMdlDataFlag_PEFlag(i_flags);
    u32 ind_flag = (i_flags >> 0x18) & 1;
    if (i_material == NULL) {
        size = sizeof(J3DMaterial);
    }
    size += J3DMaterial::calcSizeColorBlock(color_block_flag);
    size += J3DMaterial::calcSizeTexGenBlock(tex_gen_flag);
    size += J3DMaterial::calcSizeTevBlock((u16)tev_stage_num);
    size += J3DMaterial::calcSizeIndBlock(ind_flag);
    size += J3DMaterial::calcSizePEBlock(pe_flag, getMaterialMode(i_idx));
    J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    for (int i = 0; i < 8; i++) {
        if (init_data->mTexMtxIdx[i] != 0xffff) {
            size += sizeof(J3DTexMtx);
        }
    }
    return size;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm u32 J3DMaterialFactory::calcSizeNormalMaterial(J3DMaterial* param_0, int param_1,
                                                    u32 param_2) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/calcSizeNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s"
}
#pragma pop
#endif

/* 80331C30-80331D00 32C570 00D0+00 1/1 0/0 0/0 .text
 * calcSizePatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
#ifdef NONMATCHING
u32 J3DMaterialFactory::calcSizePatchedMaterial(J3DMaterial* i_material, int i_idx,
                                                u32 i_flags) const {
    u32 size = 0;
    if (i_material == NULL) {
        size = sizeof(J3DPatchedMaterial);
    }
    int ind_flag = (i_flags & 0x3000000) != 0;
    size += J3DMaterial::calcSizeColorBlock(0x40000000);
    size += 0x134;  // TODO what is this
    size += J3DMaterial::calcSizeIndBlock(ind_flag);
    size += J3DMaterial::calcSizePEBlock(0x10000000, getMaterialMode(i_idx));
    J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    for (int i = 0; i < 8; i++) {
        if (init_data->mTexMtxIdx[i] != 0xffff) {
            size += sizeof(J3DTexMtx);
        }
    }
    return size;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm u32 J3DMaterialFactory::calcSizePatchedMaterial(J3DMaterial* param_0, int param_1,
                                                     u32 param_2) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/calcSizePatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl.s"
}
#pragma pop
#endif

/* 80331D00-80331D18 32C640 0018+00 2/2 0/0 0/0 .text
 * calcSizeLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
u32 J3DMaterialFactory::calcSizeLockedMaterial(J3DMaterial* i_material, int i_idx,
                                               u32 i_flags) const {
    u32 size = 0;
    if (i_material == NULL) {
        size = sizeof(J3DLockedMaterial) + sizeof(J3DColorBlockNull) + sizeof(J3DTexGenBlockNull)
            + sizeof(J3DTevBlockNull) + sizeof(J3DIndBlockNull) + sizeof(J3DPEBlockNull);
    }
    return size + sizeof(J3DDisplayListObj);
}

/* 804564A8-804564AC 004AA8 0004+00 1/1 0/0 0/0 .sdata2          @1691 */
#ifdef NONMATCHING
static GXColor const defaultMatColor = {0xff, 0xff, 0xff, 0xff};
#else
SECTION_SDATA2 static u32 lit_1691 = 0xFFFFFFFF;
#endif

/* 80331D18-80331D74 32C658 005C+00 2/2 0/0 0/0 .text newMatColor__18J3DMaterialFactoryCFii */
#ifdef NONMATCHING
J3DGXColor J3DMaterialFactory::newMatColor(int i_idx, int i_no) const {
    J3DGXColor dflt = defaultMatColor;
    u16 mat_color_index = mpMaterialInitData[mpMaterialID[i_idx]].mMatColorIdx[i_no];
    if (mat_color_index != 0xffff) {
        return mpMatColor[mat_color_index];
    } else {
        return dflt;
    }
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm J3DGXColor J3DMaterialFactory::newMatColor(int param_0, int param_1) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newMatColor__18J3DMaterialFactoryCFii.s"
}
#pragma pop
#endif

/* 80331D74-80331DAC 32C6B4 0038+00 2/2 0/0 0/0 .text newColorChanNum__18J3DMaterialFactoryCFi */
u8 J3DMaterialFactory::newColorChanNum(int i_idx) const {
    u8 color_chan_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mColorChanNumIdx;
    if (color_chan_num_index != 0xff) {
        return mpColorChanNum[color_chan_num_index];
    } else {
        return 0;
    }
}

/* 80331DAC-80331F50 32C6EC 01A4+00 2/2 0/0 0/0 .text newColorChan__18J3DMaterialFactoryCFii */
#ifdef NONMATCHING
// problem with J3DColorChan inline constructor
J3DColorChan J3DMaterialFactory::newColorChan(int i_idx, int i_no) const {
    u16 color_chan_index = mpMaterialInitData[mpMaterialID[i_idx]].mColorChanIdx[i_no];
    if (color_chan_index != 0xffff) {
        return J3DColorChan(mpColorChanInfo[color_chan_index]);
    } else {
        return J3DColorChan();
    }
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm J3DColorChan J3DMaterialFactory::newColorChan(int param_0, int param_1) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newColorChan__18J3DMaterialFactoryCFii.s"
}
#pragma pop
#endif

/* 804564AC-804564B0 004AAC 0004+00 1/1 0/0 0/0 .sdata2          @1798 */
#ifdef NONMATCHING
static GXColor const defaultAmbColor = {0x32, 0x32, 0x32, 0x32};
#else
SECTION_SDATA2 static u32 lit_1798 = 0x32323232;
#endif

/* 80331F50-80331FAC 32C890 005C+00 1/1 0/0 0/0 .text newAmbColor__18J3DMaterialFactoryCFii */
#ifdef NONMATCHING
J3DGXColor J3DMaterialFactory::newAmbColor(int i_idx, int i_no) const {
    J3DGXColor dflt = defaultAmbColor;
    u16 amb_color_index = mpMaterialInitData[mpMaterialID[i_idx]].mAmbColorIdx[i_no];
    if (amb_color_index != 0xffff) {
        return mpAmbColor[amb_color_index];
    } else {
        return dflt;
    }
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm J3DGXColor J3DMaterialFactory::newAmbColor(int param_0, int param_1) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newAmbColor__18J3DMaterialFactoryCFii.s"
}
#pragma pop
#endif

/* 80331FAC-80331FE4 32C8EC 0038+00 2/2 0/0 0/0 .text newTexGenNum__18J3DMaterialFactoryCFi */
u32 J3DMaterialFactory::newTexGenNum(int i_idx) const {
    u8 tex_gen_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexGenNumIdx;
    if (tex_gen_num_index != 0xff) {
        return mpTexGenNum[tex_gen_num_index];
    } else {
        return 0;
    }
}

/* 80331FE4-80332044 32C924 0060+00 3/3 0/0 0/0 .text newTexCoord__18J3DMaterialFactoryCFii */
J3DTexCoord J3DMaterialFactory::newTexCoord(int i_idx, int i_no) const {
    u16 tex_coord_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexCoordIdx[i_no];
    if (tex_coord_index != 0xffff) {
        return J3DTexCoord(mpTexCoordInfo[tex_coord_index]);
    } else {
        return J3DTexCoord();
    }
}

/* 80332044-803320CC 32C984 0088+00 2/2 0/0 0/0 .text            newTexMtx__18J3DMaterialFactoryCFii
 */
J3DTexMtx* J3DMaterialFactory::newTexMtx(int i_idx, int i_no) const {
    J3DTexMtx* tex_mtx = NULL;
    J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    if (mtl_init_data->mTexMtxIdx[i_no] != 0xffff) {
        tex_mtx = new J3DTexMtx(mpTexMtxInfo[mtl_init_data->mTexMtxIdx[i_no]]);
    }
    return tex_mtx;
}

/* 803320CC-8033210C 32CA0C 0040+00 2/2 0/0 0/0 .text newCullMode__18J3DMaterialFactoryCFi */
u8 J3DMaterialFactory::newCullMode(int i_idx) const {
    u8 cull_mode_index = mpMaterialInitData[mpMaterialID[i_idx]].mCullModeIdx;
    if (cull_mode_index != 0xff) {
        return mpCullMode[cull_mode_index];
    } else {
        return 0xff;
    }
}

/* 8033210C-80332154 32CA4C 0048+00 2/2 0/0 0/0 .text            newTexNo__18J3DMaterialFactoryCFii
 */
u16 J3DMaterialFactory::newTexNo(int i_idx, int i_no) const {
    u16 tex_no_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexNoIdx[i_no];
    if (tex_no_index != 0xffff) {
        return mpTexNo[tex_no_index];
    } else {
        return 0xffff;
    }
}

/* 80332154-803321A0 32CA94 004C+00 2/2 0/0 0/0 .text newTevOrder__18J3DMaterialFactoryCFii */
J3DTevOrder J3DMaterialFactory::newTevOrder(int i_idx, int i_no) const {
    J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    if (mtl_init_data->mTevOrderIdx[i_no] != 0xffff) {
        return J3DTevOrder(mpTevOrderInfo[mtl_init_data->mTevOrderIdx[i_no]]);
    } else {
        return J3DTevOrder();
    }
}

/* 80456BB8-80456BBC 000058 0004+00 1/1 0/0 0/0 .sbss2           @1897 */
SECTION_SBSS2 static GXColorS10 defaultTevColor;

/* 803321A0-80332210 32CAE0 0070+00 2/2 0/0 0/0 .text newTevColor__18J3DMaterialFactoryCFii */
J3DGXColorS10 J3DMaterialFactory::newTevColor(int i_idx, int i_no) const {
    J3DGXColorS10 dflt = defaultTevColor;
    J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    if (mtl_init_data->mTevColorIdx[i_no] != 0xffff) {
        return mpTevColor[mtl_init_data->mTevColorIdx[i_no]];
    } else {
        return dflt;
    }
}

/* 804564B0-804564B8 004AB0 0004+04 1/1 0/0 0/0 .sdata2          @1915 */
#ifdef NONMATCHING
static GXColor const defaultTevKColor = {0xff, 0xff, 0xff, 0xff};
#else
SECTION_SDATA2 static u32 lit_1915[1 + 1 /* padding */] = {
    0xFFFFFFFF,
    /* padding */
    0x00000000,
};
#endif

/* 80332210-8033226C 32CB50 005C+00 2/2 0/0 0/0 .text newTevKColor__18J3DMaterialFactoryCFii */
#ifdef NONMATCHING
J3DGXColor J3DMaterialFactory::newTevKColor(int i_idx, int i_no) const {
    J3DGXColor dflt = defaultTevKColor;
    u16 tev_kcolor_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevKColorIdx[i_no];
    if (tev_kcolor_index != 0xffff) {
        return mpTevKColor[tev_kcolor_index];
    } else {
        return dflt;
    }
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm J3DGXColor J3DMaterialFactory::newTevKColor(int param_0, int param_1) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevKColor__18J3DMaterialFactoryCFii.s"
}
#pragma pop
#endif

/* 8033226C-803322A4 32CBAC 0038+00 2/2 0/0 0/0 .text newTevStageNum__18J3DMaterialFactoryCFi */
u8 J3DMaterialFactory::newTevStageNum(int i_idx) const {
    u8 tev_stage_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevStageNumIdx;
    if (tev_stage_num_index != 0xff) {
        return mpTevStageNum[tev_stage_num_index];
    } else {
        return 0xff;
    }
}

/* 803322A4-80332304 32CBE4 0060+00 2/2 0/0 0/0 .text newTevStage__18J3DMaterialFactoryCFii */
J3DTevStage J3DMaterialFactory::newTevStage(int i_idx, int i_no) const {
    u16 tev_stage_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevStageIdx[i_no];
    if (tev_stage_index != 0xffff) {
        return J3DTevStage(mpTevStageInfo[tev_stage_index]);
    } else {
        return J3DTevStage();
    }
}

/* 80332304-803323A0 32CC44 009C+00 1/1 0/0 0/0 .text
 * newTevSwapModeTable__18J3DMaterialFactoryCFii                */
#ifdef NONMATCHING
// J3DTevSwapModeTable inline constructor matches in the first usage but not the second
J3DTevSwapModeTable J3DMaterialFactory::newTevSwapModeTable(int i_idx, int i_no) const {
    u16 tev_swap_mode_table_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevSwapModeTableIdx[i_no];
    if (tev_swap_mode_table_index != 0xffff) {
        return J3DTevSwapModeTable(mpTevSwapModeTableInfo[tev_swap_mode_table_index]);
    } else {
        return J3DTevSwapModeTable(j3dDefaultTevSwapModeTable);
    }
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm J3DTevSwapModeTable J3DMaterialFactory::newTevSwapModeTable(int param_0, int param_1) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newTevSwapModeTable__18J3DMaterialFactoryCFii.s"
}
#pragma pop
#endif

/* 803323A0-803323C8 32CCE0 0028+00 2/2 0/0 0/0 .text newIndTexStageNum__18J3DMaterialFactoryCFi
 */
u8 J3DMaterialFactory::newIndTexStageNum(int i_idx) const {
    if (mpIndInitData[i_idx].mEnabled == true) {
        return mpIndInitData[i_idx].mIndTexStageNum;
    } else {
        return 0;
    }
}

/* 803323C8-8033240C 32CD08 0044+00 2/2 0/0 0/0 .text newIndTexOrder__18J3DMaterialFactoryCFii */
J3DIndTexOrder J3DMaterialFactory::newIndTexOrder(int i_idx, int i_no) const {
    J3DIndTexOrder dflt;
    if (mpIndInitData[i_idx].mEnabled == true) {
        return J3DIndTexOrder(mpIndInitData[i_idx].mIndTexOrderInfo[i_no]);
    } else {
        return dflt;
    }
}

/* 8033240C-803324B4 32CD4C 00A8+00 2/2 0/0 0/0 .text newIndTexMtx__18J3DMaterialFactoryCFii */
J3DIndTexMtx J3DMaterialFactory::newIndTexMtx(int i_idx, int i_no) const {
    J3DIndTexMtx dflt;
    if (mpIndInitData[i_idx].mEnabled == true) {
        return J3DIndTexMtx(mpIndInitData[i_idx].mIndTexMtxInfo[i_no]);
    } else {
        return dflt;
    }
}

/* 803324B4-80332648 32CDF4 0194+00 2/2 0/0 0/0 .text newIndTevStage__18J3DMaterialFactoryCFii */
J3DIndTevStage J3DMaterialFactory::newIndTevStage(int i_idx, int i_no) const {
    J3DIndTevStage dflt;
    if (mpIndInitData[i_idx].mEnabled == true) {
        return J3DIndTevStage(mpIndInitData[i_idx].mIndTevStageInfo[i_no]);
    } else {
        return dflt;
    }
}

/* 80332648-8033268C 32CF88 0044+00 2/2 0/0 0/0 .text
 * newIndTexCoordScale__18J3DMaterialFactoryCFii                */
J3DIndTexCoordScale J3DMaterialFactory::newIndTexCoordScale(int i_idx, int i_no) const {
    J3DIndTexCoordScale dflt;
    if (mpIndInitData[i_idx].mEnabled == true) {
        return J3DIndTexCoordScale(mpIndInitData[i_idx].mIndTexCoordScaleInfo[i_no]);
    } else {
        return dflt;
    }
}

/* 8033268C-80332768 32CFCC 00DC+00 2/2 0/0 0/0 .text            newFog__18J3DMaterialFactoryCFi */
J3DFog J3DMaterialFactory::newFog(int i_idx) const {
    J3DFog fog;
    u16 fog_index = mpMaterialInitData[mpMaterialID[i_idx]].mFogIdx;
    if (fog_index != 0xffff) {
        fog.setFogInfo(mpFogInfo[fog_index]);
    }
    return fog;
}

/* 80332768-803327E8 32D0A8 0080+00 2/2 0/0 0/0 .text newAlphaComp__18J3DMaterialFactoryCFi */
#ifdef NONMATCHING
// weird issue with calcAlphaCmpID, see J3DMatBlock.h
J3DAlphaComp J3DMaterialFactory::newAlphaComp(int i_idx) const {
    J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    if (mtl_init_data->mAlphaCompIdx != 0xffff) {
        return J3DAlphaComp(mpAlphaCompInfo[mtl_init_data->mAlphaCompIdx]);
    } else {
        return J3DAlphaComp(0xffff);
    }
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm J3DAlphaComp J3DMaterialFactory::newAlphaComp(int param_0) const {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/newAlphaComp__18J3DMaterialFactoryCFi.s"
}
#pragma pop
#endif

/* 803327E8-8033282C 32D128 0044+00 2/2 0/0 0/0 .text            newBlend__18J3DMaterialFactoryCFi
 */
J3DBlend J3DMaterialFactory::newBlend(int i_idx) const {
    J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    if (mtl_init_data->mBlendIdx != 0xffff) {
        return J3DBlend(mpBlendInfo[mtl_init_data->mBlendIdx]);
    } else {
        return J3DBlend(j3dDefaultBlendInfo);
    }
}

/* 8033282C-8033288C 32D16C 0060+00 2/2 0/0 0/0 .text            newZMode__18J3DMaterialFactoryCFi
 */
J3DZMode J3DMaterialFactory::newZMode(int i_idx) const {
    J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    if (mtl_init_data->mZModeIdx != 0xff) {
        return J3DZMode(mpZModeInfo[mtl_init_data->mZModeIdx]);
    } else {
        return J3DZMode();
    }
}

/* 8033288C-803328C4 32D1CC 0038+00 2/2 0/0 0/0 .text newZCompLoc__18J3DMaterialFactoryCFi */
u8 J3DMaterialFactory::newZCompLoc(int i_idx) const {
    J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    if (mtl_init_data->mZCompLocIdx != 0xff){
        return mpZCompLoc[mtl_init_data->mZCompLocIdx];
    } else {
        return 0;
    }
}

/* 803328C4-803328FC 32D204 0038+00 2/2 0/0 0/0 .text            newDither__18J3DMaterialFactoryCFi
 */
u8 J3DMaterialFactory::newDither(int i_idx) const {
    J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    if (mtl_init_data->mDitherIdx != 0xff){
        return mpDither[mtl_init_data->mDitherIdx];
    } else {
        return 1;
    }
}

/* 803328FC-803329A0 32D23C 00A4+00 1/1 0/0 0/0 .text newNBTScale__18J3DMaterialFactoryCFi */
J3DNBTScale J3DMaterialFactory::newNBTScale(int i_idx) const {
    J3DNBTScale dflt(j3dDefaultNBTScaleInfo);
    J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
    if (mtl_init_data->mNBTScaleIdx != 0xffff) {
        return J3DNBTScale(mpNBTScaleInfo[mtl_init_data->mNBTScaleIdx]);
    } else {
        return dflt;
    }
}

/* 803329A0-803329A4 32D2E0 0004+00 1/0 0/0 0/0 .text            load__14J3DPEBlockNullFv */
// void J3DPEBlockNull::load() {
extern "C" void load__14J3DPEBlockNullFv() {
    /* empty function */
}

/* 803329A4-803329B0 32D2E4 000C+00 1/0 0/0 0/0 .text            getType__14J3DPEBlockNullFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
// asm u32 J3DPEBlockNull::getType() {
extern "C" asm void getType__14J3DPEBlockNullFv() {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/getType__14J3DPEBlockNullFv.s"
}
#pragma pop

/* 803329B0-80332A0C 32D2F0 005C+00 1/0 0/0 0/0 .text            __dt__14J3DPEBlockNullFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
// asm J3DPEBlockNull::~J3DPEBlockNull() {
extern "C" asm void __dt__14J3DPEBlockNullFv() {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__dt__14J3DPEBlockNullFv.s"
}
#pragma pop

/* 80332A0C-80332A10 32D34C 0004+00 1/0 0/0 0/0 .text reset__15J3DTevBlockNullFP11J3DTevBlock */
// void J3DTevBlockNull::reset(J3DTevBlock* param_0) {
extern "C" void reset__15J3DTevBlockNullFP11J3DTevBlock() {
    /* empty function */
}

/* 80332A10-80332A14 32D350 0004+00 1/0 0/0 0/0 .text            ptrToIndex__15J3DTevBlockNullFv */
// void J3DTevBlockNull::ptrToIndex() {
extern "C" void ptrToIndex__15J3DTevBlockNullFv() {
    /* empty function */
}

/* 80332A14-80332A38 32D354 0024+00 1/0 0/0 0/0 .text            indexToPtr__15J3DTevBlockNullFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
// asm void J3DTevBlockNull::indexToPtr() {
extern "C" asm void indexToPtr__15J3DTevBlockNullFv() {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/indexToPtr__15J3DTevBlockNullFv.s"
}
#pragma pop

/* 80332A38-80332A44 32D378 000C+00 1/0 0/0 0/0 .text            getType__15J3DTevBlockNullFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
// asm u32 J3DTevBlockNull::getType() {
extern "C" asm void getType__15J3DTevBlockNullFv() {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/getType__15J3DTevBlockNullFv.s"
}
#pragma pop

/* 80332A44-80332AA0 32D384 005C+00 1/0 0/0 0/0 .text            __dt__15J3DTevBlockNullFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
// asm J3DTevBlockNull::~J3DTevBlockNull() {
extern "C" asm void __dt__15J3DTevBlockNullFv() {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__dt__15J3DTevBlockNullFv.s"
}
#pragma pop

/* 80332AA0-80332AA4 32D3E0 0004+00 1/0 0/0 0/0 .text            calc__18J3DTexGenBlockNullFPA4_Cf
 */
// void J3DTexGenBlockNull::calc(f32 const (*param_0)[4]) {
extern "C" void calc__18J3DTexGenBlockNullFPA4_Cf() {
    /* empty function */
}

/* 80332AA4-80332AA8 32D3E4 0004+00 1/0 0/0 0/0 .text
 * calcWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf              */
// void J3DTexGenBlockNull::calcWithoutViewMtx(f32 const (*param_0)[4]) {
extern "C" void calcWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf() {
    /* empty function */
}

/* 80332AA8-80332AAC 32D3E8 0004+00 1/0 0/0 0/0 .text calcPostTexMtx__18J3DTexGenBlockNullFPA4_Cf
 */
// void J3DTexGenBlockNull::calcPostTexMtx(f32 const (*param_0)[4]) {
extern "C" void calcPostTexMtx__18J3DTexGenBlockNullFPA4_Cf() {
    /* empty function */
}

/* 80332AAC-80332AB0 32D3EC 0004+00 1/0 0/0 0/0 .text
 * calcPostTexMtxWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf    */
// void J3DTexGenBlockNull::calcPostTexMtxWithoutViewMtx(f32 const (*param_0)[4]) {
extern "C" void calcPostTexMtxWithoutViewMtx__18J3DTexGenBlockNullFPA4_Cf() {
    /* empty function */
}

/* 80332AB0-80332AB4 32D3F0 0004+00 1/0 0/0 0/0 .text            load__18J3DTexGenBlockNullFv */
// void J3DTexGenBlockNull::load() {
extern "C" void load__18J3DTexGenBlockNullFv() {
    /* empty function */
}

/* 80332AB4-80332AB8 32D3F4 0004+00 1/0 0/0 0/0 .text            patch__18J3DTexGenBlockNullFv */
// void J3DTexGenBlockNull::patch() {
extern "C" void patch__18J3DTexGenBlockNullFv() {
    /* empty function */
}

/* 80332AB8-80332ABC 32D3F8 0004+00 1/0 0/0 0/0 .text            diff__18J3DTexGenBlockNullFUl */
// void J3DTexGenBlockNull::diff(u32 param_0) {
extern "C" void diff__18J3DTexGenBlockNullFUl() {
    /* empty function */
}

/* 80332ABC-80332AC0 32D3FC 0004+00 1/0 0/0 0/0 .text            diffTexMtx__18J3DTexGenBlockNullFv
 */
// void J3DTexGenBlockNull::diffTexMtx() {
extern "C" void diffTexMtx__18J3DTexGenBlockNullFv() {
    /* empty function */
}

/* 80332AC0-80332AC4 32D400 0004+00 1/0 0/0 0/0 .text            diffTexGen__18J3DTexGenBlockNullFv
 */
// void J3DTexGenBlockNull::diffTexGen() {
extern "C" void diffTexGen__18J3DTexGenBlockNullFv() {
    /* empty function */
}

/* 80332AC4-80332AD0 32D404 000C+00 1/0 0/0 0/0 .text            getType__18J3DTexGenBlockNullFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
// asm u32 J3DTexGenBlockNull::getType() {
extern "C" asm void getType__18J3DTexGenBlockNullFv() {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/getType__18J3DTexGenBlockNullFv.s"
}
#pragma pop

/* 80332AD0-80332B2C 32D410 005C+00 1/0 0/0 0/0 .text            __dt__18J3DTexGenBlockNullFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
// asm J3DTexGenBlockNull::~J3DTexGenBlockNull() {
extern "C" asm void __dt__18J3DTexGenBlockNullFv() {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__dt__18J3DTexGenBlockNullFv.s"
}
#pragma pop

/* 80332B2C-80332B38 32D46C 000C+00 1/0 0/0 0/0 .text            getType__17J3DColorBlockNullFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
// asm u32 J3DColorBlockNull::getType() {
extern "C" asm void getType__17J3DColorBlockNullFv() {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/getType__17J3DColorBlockNullFv.s"
}
#pragma pop

/* 80332B38-80332B94 32D478 005C+00 1/0 0/0 0/0 .text            __dt__17J3DColorBlockNullFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
// asm J3DColorBlockNull::~J3DColorBlockNull() {
extern "C" asm void __dt__17J3DColorBlockNullFv() {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__dt__17J3DColorBlockNullFv.s"
}
#pragma pop

/* 80332B94-80332BDC 32D4D4 0048+00 0/0 2/2 0/0 .text            __dt__11J3DMaterialFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
// asm J3DMaterial::~J3DMaterial() {
extern "C" asm void __dt__11J3DMaterialFv() {
    nofralloc
#include "asm/JSystem/J3DGraphLoader/J3DMaterialFactory/__dt__11J3DMaterialFv.s"
}
#pragma pop