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
|
//
// Generated By: dol2asm
// Translation Unit: J2DWindowEx
//
#include "JSystem/J2DGraph/J2DWindowEx.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "dol2asm.h"
//
// Forward References:
//
extern "C" void __ct__11J2DWindowExFP7J2DPaneP20JSURandomInputStreamUlP11J2DMaterial();
extern "C" void setMinSize__11J2DWindowExFv();
extern "C" void __dt__11J2DWindowExFv();
extern "C" void drawSelf__11J2DWindowExFffPA3_A4_f();
extern "C" void func_803012CC();
extern "C" void func_80301994();
extern "C" void drawFrameTexture__11J2DWindowExFffffUsUsUsUsP11J2DMaterialb();
extern "C" void func_80301FC8();
extern "C" void func_80302164();
extern "C" void setTevOrder__11J2DWindowExFb();
extern "C" void setTevStage__11J2DWindowExFb();
extern "C" void setStage__11J2DWindowExFP11J2DTevStageQ211J2DWindowEx10stage_enum();
extern "C" void setBlack__11J2DWindowExFQ28JUtility6TColor();
extern "C" void setWhite__11J2DWindowExFQ28JUtility6TColor();
extern "C" void setBlackWhite__11J2DWindowExFQ28JUtility6TColorQ28JUtility6TColor();
extern "C" void getBlackWhite__11J2DWindowExCFPQ28JUtility6TColorPQ28JUtility6TColor();
extern "C" void isSetBlackWhite__11J2DWindowExCFQ28JUtility6TColorQ28JUtility6TColor();
extern "C" void getBlack__11J2DWindowExCFv();
extern "C" void getWhite__11J2DWindowExCFv();
extern "C" void setAlpha__11J2DWindowExFUc();
extern "C" void setCullBack__11J2DWindowExF11_GXCullMode();
extern "C" void rewriteAlpha__11J2DWindowExFv();
extern "C" void getFrameTexture__11J2DWindowExCFUcUc();
extern "C" void getContentsTexture__11J2DWindowExCFUc();
extern "C" void isUsed__11J2DWindowExFPC7ResTIMG();
extern "C" void setAnimation__11J2DWindowExFP11J2DAnmColor();
extern "C" void setAnimation__11J2DWindowExFP19J2DAnmTextureSRTKey();
extern "C" void setAnimation__11J2DWindowExFP16J2DAnmTexPattern();
extern "C" void setAnimation__11J2DWindowExFP15J2DAnmTevRegKey();
extern "C" void isNeedSetAnm__11J2DWindowExFUc();
extern "C" void setAnimation__11J2DWindowExFP20J2DAnmVisibilityFull();
extern "C" void setAnimation__11J2DWindowExFP14J2DAnmVtxColor();
extern "C" void animationPane__11J2DWindowExFPC15J2DAnmTransform();
extern "C" void getFrameMaterial__11J2DWindowExCFUc();
extern "C" void getContentsMaterial__11J2DWindowExCFv();
extern "C" void getMaterial__11J2DWindowExCFRQ29J2DWindow9TMaterial();
extern "C" void draw__11J2DWindowExFffff();
extern "C" void setCullBack__11J2DWindowExFb();
extern "C" void isUsed__11J2DWindowExFPC7ResFONT();
extern "C" void setAnimation__11J2DWindowExFP10J2DAnmBase();
extern "C" void getColor__14J2DAnmVtxColorCFUcUsP8_GXColor();
//
// External References:
//
extern "C" void calcMtx__7J2DPaneFv();
extern "C" void makeMatrix__7J2DPaneFff();
extern "C" void setAnimation__11J2DWindowExFP15J2DAnmTransform();
extern "C" void __dl__FPv();
extern "C" void read__14JSUInputStreamFPvl();
extern "C" void peek__20JSURandomInputStreamFPvl();
extern "C" void seek__20JSURandomInputStreamFl17JSUStreamSeekFrom();
extern "C" void setGX__11J2DMaterialFv();
extern "C" void setAnimation__11J2DMaterialFP11J2DAnmColor();
extern "C" void setAnimation__11J2DMaterialFP19J2DAnmTextureSRTKey();
extern "C" void setAnimation__11J2DMaterialFP16J2DAnmTexPattern();
extern "C" void setAnimation__11J2DMaterialFP15J2DAnmTevRegKey();
extern "C" void move__7J2DPaneFff();
extern "C" void add__7J2DPaneFff();
extern "C" void func_802F7264();
extern "C" void search__7J2DPaneFUx();
extern "C" void searchUserInfo__7J2DPaneFUx();
extern "C" void isUsed__7J2DPaneFPC7ResTIMG();
extern "C" void isUsed__7J2DPaneFPC7ResFONT();
extern "C" void makeMatrix__7J2DPaneFffff();
extern "C" void setCullBack__7J2DPaneF11_GXCullMode();
extern "C" void getParentPane__7J2DPaneFv();
extern "C" void makePaneExStream__7J2DPaneFP7J2DPaneP20JSURandomInputStream();
extern "C" void setAnimation__7J2DPaneFP10J2DAnmBase();
extern "C" void clearAnmTransform__7J2DPaneFv();
extern "C" void animationTransform__7J2DPaneFPC15J2DAnmTransform();
extern "C" void setVisibileAnimation__7J2DPaneFP20J2DAnmVisibilityFull();
extern "C" void setVtxColorAnimation__7J2DPaneFP14J2DAnmVtxColor();
extern "C" void animationPane__7J2DPaneFPC15J2DAnmTransform();
extern "C" void setAnimationVF__7J2DPaneFP20J2DAnmVisibilityFull();
extern "C" void setAnimationVC__7J2DPaneFP14J2DAnmVtxColor();
extern "C" void setConnectParent__7J2DPaneFb();
extern "C" void update__7J2DPaneFv();
extern "C" void __ct__9J2DWindowFv();
extern "C" void __dt__9J2DWindowFv();
extern "C" void resize__9J2DWindowFff();
extern "C" void drawSelf__9J2DWindowFff();
extern "C" s32 getTypeID__9J2DWindowCFv();
extern "C" void getVisibility__20J2DAnmVisibilityFullCFUsPUc();
extern "C" void _savegpr_20();
extern "C" void _savegpr_25();
extern "C" void _savegpr_26();
extern "C" void _savegpr_27();
extern "C" void _savegpr_28();
extern "C" void _savegpr_29();
extern "C" void _restgpr_20();
extern "C" void _restgpr_25();
extern "C" void _restgpr_26();
extern "C" void _restgpr_27();
extern "C" void _restgpr_28();
extern "C" void _restgpr_29();
//
// Declarations:
//
/* ############################################################################################## */
/* 803A1C60-803A1C70 02E2C0 0010+00 2/2 0/0 0/0 .rodata @1508 */
SECTION_RODATA static u8 const lit_1508[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x803A1C60, &lit_1508);
/* 803CD3E8-803CD4B8 02A508 00CC+04 2/2 0/0 0/0 .data __vt__11J2DWindowEx */
SECTION_DATA extern void* __vt__11J2DWindowEx[51 + 1 /* padding */] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)__dt__11J2DWindowExFv,
(void*)getTypeID__9J2DWindowCFv,
(void*)move__7J2DPaneFff,
(void*)add__7J2DPaneFff,
(void*)resize__9J2DWindowFff,
(void*)setCullBack__11J2DWindowExFb,
(void*)setCullBack__11J2DWindowExF11_GXCullMode,
(void*)setAlpha__11J2DWindowExFUc,
(void*)setConnectParent__7J2DPaneFb,
(void*)calcMtx__7J2DPaneFv,
(void*)update__7J2DPaneFv,
(void*)drawSelf__9J2DWindowFff,
(void*)drawSelf__11J2DWindowExFffPA3_A4_f,
(void*)search__7J2DPaneFUx,
(void*)searchUserInfo__7J2DPaneFUx,
(void*)makeMatrix__7J2DPaneFff,
(void*)makeMatrix__7J2DPaneFffff,
(void*)isUsed__11J2DWindowExFPC7ResTIMG,
(void*)isUsed__11J2DWindowExFPC7ResFONT,
(void*)clearAnmTransform__7J2DPaneFv,
(void*)rewriteAlpha__11J2DWindowExFv,
(void*)setAnimation__11J2DWindowExFP10J2DAnmBase,
(void*)setAnimation__11J2DWindowExFP15J2DAnmTransform,
(void*)setAnimation__11J2DWindowExFP11J2DAnmColor,
(void*)setAnimation__11J2DWindowExFP16J2DAnmTexPattern,
(void*)setAnimation__11J2DWindowExFP19J2DAnmTextureSRTKey,
(void*)setAnimation__11J2DWindowExFP15J2DAnmTevRegKey,
(void*)setAnimation__11J2DWindowExFP20J2DAnmVisibilityFull,
(void*)setAnimation__11J2DWindowExFP14J2DAnmVtxColor,
(void*)animationTransform__7J2DPaneFPC15J2DAnmTransform,
(void*)setVisibileAnimation__7J2DPaneFP20J2DAnmVisibilityFull,
(void*)setAnimationVF__7J2DPaneFP20J2DAnmVisibilityFull,
(void*)setVtxColorAnimation__7J2DPaneFP14J2DAnmVtxColor,
(void*)setAnimationVC__7J2DPaneFP14J2DAnmVtxColor,
(void*)animationPane__11J2DWindowExFPC15J2DAnmTransform,
(void*)func_80301FC8,
(void*)func_80302164,
(void*)draw__11J2DWindowExFffff,
(void*)setBlack__11J2DWindowExFQ28JUtility6TColor,
(void*)setWhite__11J2DWindowExFQ28JUtility6TColor,
(void*)setBlackWhite__11J2DWindowExFQ28JUtility6TColorQ28JUtility6TColor,
(void*)getBlack__11J2DWindowExCFv,
(void*)getWhite__11J2DWindowExCFv,
(void*)getFrameTexture__11J2DWindowExCFUcUc,
(void*)getContentsTexture__11J2DWindowExCFUc,
(void*)getMaterial__11J2DWindowExCFRQ29J2DWindow9TMaterial,
(void*)getFrameMaterial__11J2DWindowExCFUc,
(void*)getContentsMaterial__11J2DWindowExCFv,
(void*)func_80301994,
/* padding */
NULL,
};
/* 804562A0-804562A8 0048A0 0008+00 4/4 0/0 0/0 .sdata2 @1549 */
SECTION_SDATA2 static f64 lit_1549 = 4503601774854144.0 /* cast s32 to float */;
/* 804562A8-804562B0 0048A8 0008+00 1/1 0/0 0/0 .sdata2 @1552 */
SECTION_SDATA2 static f64 lit_1552 = 4503599627370496.0 /* cast u32 to float */;
struct J2DWindowExDef {
u32 field_0x0[4];
u16 field_0x10[4];
u8 field_0x18;
u8 field_0x19;
u16 field_0x1A;
u16 field_0x1C;
u16 field_0x1E;
u16 field_0x20;
u16 field_0x22;
u16 field_0x24;
u16 field_0x26;
u16 field_0x28[4];
u32 field_0x30[4];
};
STATIC_ASSERT(sizeof(J2DWindowExDef) == 0x40);
/* 80300C94-80300F80 2FB5D4 02EC+00 0/0 1/1 0/0 .text
* __ct__11J2DWindowExFP7J2DPaneP20JSURandomInputStreamUlP11J2DMaterial */
// Matches with literals
#ifdef NONMATCHING
J2DWindowEx::J2DWindowEx(J2DPane* param_0, JSURandomInputStream* param_1, u32 param_2,
J2DMaterial* param_3) : J2DWindow() {
mAnmVisibilityFull = NULL;
mAnmVtxColor = NULL;
s32 position = param_1->getPosition();
int uStack_88[2];
param_1->read(uStack_88, 8);
mKind = uStack_88[0];
s32 iVar2 = param_1->getPosition();
int auStack_90[2];
param_1->peek(auStack_90, 8);
makePaneExStream(param_0, param_1);
param_1->seek(iVar2 + auStack_90[1], JSUStreamSeekFrom_SET);
J2DWindowExDef auStack_70;
param_1->read(&auStack_70, sizeof(J2DWindowExDef));
JUtility::TColor* colors[4] = {NULL};
colors[0] = &field_0x128;
colors[1] = &field_0x12C;
colors[2] = &field_0x130;
colors[3] = &field_0x134;
for (int i = 0; i < 4; i++) {
field_0x158[i] = auStack_70.field_0x10[i];
mFrameMaterial[i] = 0;
if (field_0x158[i] != 0xffff) {
mFrameMaterial[i] = param_3 + field_0x158[i];
(param_3 + field_0x158[i])->field_0x4 = this;
}
field_0x168[i] = auStack_70.field_0x28[i];
*(colors[i]) = JUtility::TColor(auStack_70.field_0x30[i]);
}
field_0x144 = auStack_70.field_0x18;
field_0x114.set(auStack_70.field_0x1A, auStack_70.field_0x1C,
auStack_70.field_0x1A + auStack_70.field_0x1E,
auStack_70.field_0x1C + auStack_70.field_0x20);
field_0x166 = auStack_70.field_0x22;
field_0x164 = auStack_70.field_0x24;
mContentsMaterial = NULL;
if (field_0x164 != 0xffff) {
mContentsMaterial = ¶m_3[field_0x164];
param_3[field_0x164].field_0x4 = this;
}
param_1->seek(position + uStack_88[1], JSUStreamSeekFrom_SET);
rewriteAlpha();
field_0x100 = NULL;
field_0x104 = NULL;
field_0x108 = NULL;
field_0x10c = NULL;
mPalette = NULL;
field_0x110 = NULL;
field_0x170 = 0;
setMinSize();
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm J2DWindowEx::J2DWindowEx(J2DPane* param_0, JSURandomInputStream* param_1, u32 param_2,
J2DMaterial* param_3) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DWindowEx/__ct__11J2DWindowExFP7J2DPaneP20JSURandomInputStreamUlP11J2DMaterial.s"
}
#pragma pop
#endif
/* 80300F80-80301144 2FB8C0 01C4+00 1/1 0/0 0/0 .text setMinSize__11J2DWindowExFv */
void J2DWindowEx::setMinSize() {
field_0x140 = 1;
field_0x142 = 1;
if (mFrameMaterial[0] == NULL) return;
if (mFrameMaterial[1] == NULL) return;
if (mFrameMaterial[2] == NULL) return;
if (mFrameMaterial[3] == NULL) return;
if (mFrameMaterial[0]->getTevBlock() == NULL) return;
if (mFrameMaterial[1]->getTevBlock() == NULL) return;
if (mFrameMaterial[2]->getTevBlock() == NULL) return;
if (mFrameMaterial[3]->getTevBlock() == NULL) return;
if (mFrameMaterial[0]->getTevBlock()->getTexture(0) == NULL) return;
if (mFrameMaterial[1]->getTevBlock()->getTexture(0) == NULL) return;
if (mFrameMaterial[2]->getTevBlock()->getTexture(0) == NULL) return;
if (mFrameMaterial[3]->getTevBlock()->getTexture(0) == NULL) return;
field_0x140 = mFrameMaterial[0]->getTevBlock()->getTexture(0)->getWidth() + mFrameMaterial[1]->getTevBlock()->getTexture(0)->getWidth();
field_0x142 = mFrameMaterial[0]->getTevBlock()->getTexture(0)->getHeight() + mFrameMaterial[2]->getTevBlock()->getTexture(0)->getHeight();
}
/* 80301144-8030122C 2FBA84 00E8+00 1/0 0/0 0/0 .text __dt__11J2DWindowExFv */
J2DWindowEx::~J2DWindowEx() {
for (u8 i = 0; i < 4; i++) {
if (field_0x170 & (1 << i)) {
delete mFrameMaterial[i];
}
}
if (field_0x170 & 0x10) {
delete mContentsMaterial;
}
}
/* 8030122C-803012CC 2FBB6C 00A0+00 1/0 0/0 0/0 .text drawSelf__11J2DWindowExFffPA3_A4_f
*/
void J2DWindowEx::drawSelf(f32 param_0, f32 param_1, f32 (*param_2)[3][4]) {
JGeometry::TBox2<f32> aTStack_50(mBounds);
Mtx auStack_40;
aTStack_50.addPos(JGeometry::TVec2<f32>(param_0, param_1));
MTXConcat(*param_2, mGlobalMtx, auStack_40);
GXLoadPosMtxImm(auStack_40, 0);
draw_private(aTStack_50, field_0x114);
clip(field_0x114);
}
/* 803012CC-80301994 2FBC0C 06C8+00 2/2 0/0 0/0 .text
* draw_private__11J2DWindowExFRCQ29JGeometry8TBox2<f>RCQ29JGeometry8TBox2<f> */
// Matches with literals
#ifdef NONMATCHING
void J2DWindowEx::draw_private(JGeometry::TBox2<f32> const& param_0,
JGeometry::TBox2<f32> const& param_1) {
if (param_0.getWidth() >= field_0x140 && param_0.getHeight() >= field_0x142) {
JUTTexture* textures[4];
bool anyFrameMaterialNull = false;
for (int i = 0; i < 4; i++) {
if (mFrameMaterial[i] == NULL) {
return;
}
J2DTevBlock* block = mFrameMaterial[i]->getTevBlock();
if (block == NULL) {
return;
}
textures[i] = block->getTexture(0);
if (textures[i] == NULL) {
anyFrameMaterialNull = true;
}
}
JGeometry::TBox2<f32> aTStack_b8(param_1);
aTStack_b8.addPos(param_0.i);
drawContents(aTStack_b8);
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
if (!anyFrameMaterialNull) {
f32 dVar16 = param_0.i.x;
f32 dVar15 = param_0.i.y;
f32 dVar18 = param_0.f.x - textures[3]->getWidth();
f32 dVar17 = param_0.f.y - textures[3]->getHeight();
f32 dVar14 = dVar16 + textures[0]->getWidth();
f32 dVar12 = dVar15 + textures[0]->getHeight();
u16 local_c4;
if (field_0x144 & 0x80) {
local_c4 = 0;
} else {
local_c4 = 0x8000;
}
u16 local_c6;
if (field_0x144 & 0x40) {
local_c6 = 0;
} else {
local_c6 = 0x8000;
}
drawFrameTexture(dVar16, dVar15, textures[0]->getWidth(), textures[0]->getHeight(),
local_c4, local_c6, 0x8000 - local_c4, 0x8000 - local_c6,
mFrameMaterial[0], true);
bool r9 = mFrameMaterial[1] != mFrameMaterial[0];
u16 local_c8;
if (field_0x144 & 0x20) {
local_c8 = 0;
} else {
local_c8 = 0x8000;
}
u16 local_ca;
if (field_0x144 & 0x10) {
local_ca = 0;
} else {
local_ca = 0x8000;
}
drawFrameTexture(dVar18, dVar15, textures[3]->getWidth(), textures[0]->getHeight(),
local_c8, local_ca, 0x8000 - local_c8, 0x8000 - local_ca,
mFrameMaterial[1], r9);
u16 local_cc;
if (field_0x144 & 0x20) {
local_cc = 0x8000;
} else {
local_cc = 0;
}
u16 local_ce;
if (field_0x144 & 0x10) {
local_ce = 0;
} else {
local_ce = 0x8000;
}
drawFrameTexture(dVar14, dVar15, dVar18 - dVar14, textures[0]->getHeight(), local_cc,
local_ce, local_cc, local_ce ^ 0x8000, mFrameMaterial[1], false);
r9 = mFrameMaterial[3] != mFrameMaterial[1];
u16 local_d0;
if (field_0x144 & 2) {
local_d0 = 0;
} else {
local_d0 = 0x8000;
}
u16 local_d2;
if (field_0x144 & 1) {
local_d2 = 0;
} else {
local_d2 = 0x8000;
}
drawFrameTexture(dVar18, dVar17, textures[3]->getWidth(), textures[3]->getHeight(),
local_d0, local_d2, 0x8000 - local_d0, 0x8000 - local_d2,
mFrameMaterial[3], r9);
u16 local_d4;
if (field_0x144 & 2) {
local_d4 = 0x8000;
} else {
local_d4 = 0;
}
u16 local_d6;
if (field_0x144 & 1) {
local_d6 = 0;
} else {
local_d6 = 0x8000;
}
drawFrameTexture(dVar14, dVar17, dVar18 - dVar14, textures[3]->getHeight(), local_d4,
local_d6, local_d4, local_d6 ^ 0x8000, mFrameMaterial[3], false);
u16 local_d8;
if (field_0x144 & 2) {
local_d8 = 0;
} else {
local_d8 = 0x8000;
}
u16 local_da;
if (field_0x144 & 1) {
local_da = 0x8000;
} else {
local_da = 0;
}
drawFrameTexture(dVar18, dVar12, textures[3]->getWidth(), dVar17 - dVar12, local_d8,
local_da, local_d8 ^ 0x8000, local_da, mFrameMaterial[3], false);
r9 = mFrameMaterial[2] != mFrameMaterial[3];
u16 local_dc;
if (field_0x144 & 8) {
local_dc = 0;
} else {
local_dc = 0x8000;
}
u16 local_de;
if (field_0x144 & 4) {
local_de = 0;
} else {
local_de = 0x8000;
}
drawFrameTexture(dVar16, dVar17, textures[0]->getWidth(), textures[3]->getHeight(),
local_dc, local_de, 0x8000 - local_dc, 0x8000 - local_de,
mFrameMaterial[2], r9);
u16 local_e0;
if (field_0x144 & 8) {
local_e0 = 0;
} else {
local_e0 = 0x8000;
}
u16 local_e2;
if (field_0x144 & 4) {
local_e2 = 0x8000;
} else {
local_e2 = 0;
}
drawFrameTexture(dVar16, dVar12, textures[0]->getWidth(), dVar17 - dVar12, local_e0,
local_e2, local_e0 ^ 0x8000, local_e2, mFrameMaterial[2], false);
}
GXSetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR0A0);
GXSetNumTexGens(0);
GXSetVtxDesc(GX_VA_TEX0, GX_NONE);
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J2DWindowEx::draw_private(JGeometry::TBox2<f32> const& param_0,
JGeometry::TBox2<f32> const& param_1) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DWindowEx/func_803012CC.s"
}
#pragma pop
#endif
/* ############################################################################################## */
/* 804562B0-804562B4 0048B0 0004+00 4/4 0/0 0/0 .sdata2 @1827 */
SECTION_SDATA2 static u8 lit_1827[4] = {
0x00,
0x00,
0x00,
0x00,
};
/* 804562B4-804562B8 0048B4 0004+00 1/1 0/0 0/0 .sdata2 @2256 */
SECTION_SDATA2 static f32 lit_2256 = 1.0f;
/* 804562B8-804562C0 0048B8 0004+04 1/1 0/0 0/0 .sdata2 @2257 */
SECTION_SDATA2 static f32 lit_2257[1 + 1 /* padding */] = {
0.5f,
/* padding */
0.0f,
};
/* 80301994-80301D74 2FC2D4 03E0+00 1/0 0/0 0/0 .text
* drawContents__11J2DWindowExFRCQ29JGeometry8TBox2<f> */
// Matches with literals
#ifdef NONMATCHING
void J2DWindowEx::drawContents(JGeometry::TBox2<f32> const& param_1) {
if (!param_1.isValid() || mContentsMaterial == NULL) {
return;
}
if (!mContentsMaterial->isVisible()) {
return;
}
mContentsMaterial->setGX();
GXClearVtxDesc();
GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
GXSetVtxDesc(GX_VA_CLR0, GX_DIRECT);
JUtility::TColor TStack_b4(field_0x128);
JUtility::TColor TStack_b8(field_0x130);
JUtility::TColor TStack_bc(field_0x12C);
JUtility::TColor TStack_c0(field_0x134);
if (mContentsMaterial->getColorBlock()->getColorChan(1)->getMatSrc() == 1) {
if (mContentsMaterial->getMaterialAlphaCalc() == 1) {
TStack_b4.a = (TStack_b4.a * mColorAlpha) / 0xff;
TStack_b8.a = (TStack_b8.a * mColorAlpha) / 0xff;
TStack_bc.a = (TStack_bc.a * mColorAlpha) / 0xff;
TStack_c0.a = (TStack_c0.a * mColorAlpha) / 0xff;
}
} else if (mIsInfluencedAlpha) {
GXSetChanMatColor(GX_ALPHA0, JUtility::TColor(mColorAlpha));
}
bool bVar5 = false;
f32 in_f31;
f32 in_f30;
f32 in_f29;
f32 in_f28;
if (mContentsMaterial->getTevBlock() != NULL) {
if (mContentsMaterial->getTevBlock()->getTexture(0)) {
bVar5 = true;
GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
f32 dVar15 = mContentsMaterial->getTevBlock()->getTexture(0)->getWidth();
f32 dVar14 = mContentsMaterial->getTevBlock()->getTexture(0)->getHeight();
f32 dVar12 = param_1.getWidth();
f32 dVar13 = param_1.getHeight();
in_f31 = -(dVar12 / dVar15 - 1.0f) / 2;
in_f30 = -((dVar13 / dVar14) - 1.0f) / 2;
in_f29 = in_f31 + (dVar12 / dVar15);
in_f28 = in_f30 + (dVar13 / dVar14);
}
}
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_F32, 0);
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
GXPosition3f32(param_1.i.x, param_1.i.y,
0.0f);
GXColor1u32(TStack_b4);
if (bVar5) {
GXTexCoord2f32(in_f31, in_f30);
}
GXPosition3f32(param_1.f.x, param_1.i.y,
0.0f);
GXColor1u32(TStack_bc);
if (bVar5) {
GXTexCoord2f32(in_f29, in_f30);
}
GXPosition3f32(param_1.f.x, param_1.f.y,
0.0f);
GXColor1u32(TStack_c0);
if (bVar5) {
GXTexCoord2f32(in_f29, in_f28);
}
GXPosition3f32(param_1.i.x, param_1.f.y,
0.0f);
GXColor1u32(TStack_b8);
if (bVar5) {
GXTexCoord2f32(in_f31, in_f28);
}
GXEnd();
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_CLR_RGBA, GX_RGBX8, 0xf);
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_RGBA4, 0);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J2DWindowEx::drawContents(JGeometry::TBox2<f32> const& param_0) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DWindowEx/func_80301994.s"
}
#pragma pop
#endif
/* 80301D74-80301FC8 2FC6B4 0254+00 1/1 0/0 0/0 .text
* drawFrameTexture__11J2DWindowExFffffUsUsUsUsP11J2DMaterialb */
// Matches with literals
#ifdef NONMATCHING
void J2DWindowEx::drawFrameTexture(f32 param_1, f32 param_2, f32 param_3, f32 param_4, u16 param_5,
u16 param_6, u16 param_7, u16 param_8, J2DMaterial* param_9,
bool param_10) {
if (param_9 != NULL && param_9->isVisible()) {
f32 dVar15 = param_1 + param_3;
f32 dVar14 = param_2 + param_4;
if (param_10) {
param_9->setGX();
}
JUtility::TColor aTStack_84(0xffffffff);
J2DPane* parentPane = getParentPane();
if (param_9->getColorBlock()->getColorChan(1)->getMatSrc() == 1) {
if (param_9->getMaterialAlphaCalc() == 1) {
u8 uVar11 = 0xff;
if (param_9->getColorBlock()->getMatColor(0) != 0) {
uVar11 = param_9->getColorBlock()->getMatColor(0)->a;
}
if (parentPane != NULL && mIsInfluencedAlpha != 0) {
uVar11 = ((uVar11 * parentPane->mColorAlpha) / 0xff);
}
aTStack_84 = JUtility::TColor((u32)uVar11 | 0xffffff00);
}
} else if (parentPane != NULL && mIsInfluencedAlpha != 0 && param_10) {
s32 matColorAlpha = param_9->getColorBlock()->getMatColor(0)->a;
s32 colorAlpha = parentPane->mColorAlpha;
GXSetChanMatColor(GX_ALPHA0, JUtility::TColor((matColorAlpha * colorAlpha / 0xff) & 0xff));
}
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_F32, 0);
GXBegin(GX_QUADS, GX_VTXFMT0, 4);
GXPosition3f32(param_1, param_2, 0.0f);
GXColor1u32(aTStack_84);
GXTexCoord2u16(param_7, param_8);
GXPosition3f32(dVar15, param_2, 0.0f);
GXColor1u32(aTStack_84);
GXTexCoord2u16(param_5, param_8);
GXPosition3f32(dVar15, dVar14, 0.0f);
GXColor1u32(aTStack_84);
GXTexCoord2u16(param_5, param_6);
GXPosition3f32(param_1, dVar14, 0.0f);
GXColor1u32(aTStack_84);
GXTexCoord2u16(param_7, param_6);
GXEnd();
GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_CLR_RGBA, GX_RGBA4, 0);
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J2DWindowEx::drawFrameTexture(f32 param_0, f32 param_1, f32 param_2, f32 param_3,
u16 param_4, u16 param_5, u16 param_6, u16 param_7,
J2DMaterial* param_8, bool param_9) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DWindowEx/drawFrameTexture__11J2DWindowExFffffUsUsUsUsP11J2DMaterialb.s"
}
#pragma pop
#endif
/* 80301FC8-80302164 2FC908 019C+00 1/0 0/0 0/0 .text draw__11J2DWindowExFRCQ29JGeometry8TBox2<f>
*/
// Matches with literals
#ifdef NONMATCHING
void J2DWindowEx::draw(JGeometry::TBox2<f32> const& param_1) {
bool isMissingTexture = false;
JUTTexture* local_68[4];
for (int i = 0; i < 4; i++) {
if (mFrameMaterial[i] == NULL) {
return;
}
if (mFrameMaterial[i]->getTevBlock() == NULL) {
return;
}
local_68[i] = mFrameMaterial[i]->getTevBlock()->getTexture(0);
if (local_68[i] == NULL) {
isMissingTexture = true;
}
}
JGeometry::TBox2<f32> aTStack_78;
if (!isMissingTexture) {
aTStack_78.set(local_68[0]->getWidth(), local_68[0]->getHeight(),
param_1.getWidth() - local_68[1]->getWidth(),
param_1.getHeight() - local_68[2]->getHeight());
} else {
aTStack_78.set(0.0f, 0.0f, param_1.getWidth(), param_1.getHeight());
}
draw(param_1, aTStack_78);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J2DWindowEx::draw(JGeometry::TBox2<f32> const& param_0) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DWindowEx/func_80301FC8.s"
}
#pragma pop
#endif
/* 80302164-80302284 2FCAA4 0120+00 1/0 0/0 0/0 .text
* draw__11J2DWindowExFRCQ29JGeometry8TBox2<f>RCQ29JGeometry8TBox2<f> */
// Matches with literals
#ifdef NONMATCHING
void J2DWindowEx::draw(JGeometry::TBox2<f32> const& param_1, JGeometry::TBox2<f32> const& param_2) {
rewriteAlpha();
mColorAlpha = mAlpha;
makeMatrix(param_1.i.x, param_1.i.y, 0.0f, 0.0f);
GXLoadPosMtxImm(mPositionMtx, 0);
GXSetCurrentMtx(0);
JGeometry::TBox2<f32> aTStack_70(0.0f, 0.0f, param_1.getWidth(), param_1.getHeight());
draw_private(aTStack_70, param_2);
for (int i = GX_TEV_SWAP0; i < GX_MAX_TEVSWAP; i++) {
GXSetTevSwapModeTable((GXTevSwapSel)i, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
}
GXSetNumIndStages(0);
for (int i = GX_TEVSTAGE0; i < GX_MAX_TEVSTAGE; i++) {
GXSetTevDirect((GXTevStageID)i);
}
Mtx auStack_60;
MTXIdentity(auStack_60);
GXLoadPosMtxImm(auStack_60, 0);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J2DWindowEx::draw(JGeometry::TBox2<f32> const& param_0,
JGeometry::TBox2<f32> const& param_1) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DWindowEx/func_80302164.s"
}
#pragma pop
#endif
/* 80302284-80302388 2FCBC4 0104+00 1/1 0/0 0/0 .text setTevOrder__11J2DWindowExFb */
void J2DWindowEx::setTevOrder(bool param_0) {
u16 local_28[2];
if (!param_0) {
local_28[0] = 4;
local_28[1] = 0xffff;
} else {
local_28[0] = 0xff;
local_28[1] = 0xff04;
}
for (u8 i = 0; i < 2; i++) {
s32 uVar1 = local_28[i];
J2DTevOrderInfo info;
info.mTexCoord = uVar1 >> 8;
info.mTexMap = uVar1 >> 8;
info.mColor = uVar1;
J2DTevOrder local_30(info);
for (int j = 0; j < 4; j++) {
if (mFrameMaterial[j]->getTevBlock()->getMaxStage() > i) {
mFrameMaterial[j]->getTevBlock()->setTevOrder(i, local_30);
}
}
}
}
/* 80302388-803024B4 2FCCC8 012C+00 1/1 0/0 0/0 .text setTevStage__11J2DWindowExFb */
void J2DWindowEx::setTevStage(bool param_1) {
for (int i = 0; i < 4; i++) {
J2DTevStage* pJVar3 = mFrameMaterial[i]->getTevBlock()->getTevStage(0);
JUTTexture* this_00 = mFrameMaterial[i]->getTevBlock()->getTexture(0);
bool bVar1 = false;
if (this_00 != NULL && ((s32)this_00->getFormat() == 0 || (s32)this_00->getFormat() == 1) &&
this_00->getTransparency() == 0)
{
bVar1 = true;
}
if (!param_1) {
setStage(pJVar3, bVar1 ? STAGE_ENUM_1 : STAGE_ENUM_0);
} else {
stage_enum sVar5;
if (bVar1) {
sVar5 = STAGE_ENUM_4;
} else {
sVar5 = STAGE_ENUM_3;
}
setStage(pJVar3, sVar5);
setStage(mFrameMaterial[i]->getTevBlock()->getTevStage(1), STAGE_ENUM_2);
}
}
}
/* 803024B4-80302764 2FCDF4 02B0+00 1/1 0/0 0/0 .text
* setStage__11J2DWindowExFP11J2DTevStageQ211J2DWindowEx10stage_enum */
// Matches with literals.
#ifdef NONMATCHING
void J2DWindowEx::setStage(J2DTevStage* param_0, J2DWindowEx::stage_enum param_1) {
s8 local_30[6][4] = {
{0x0f, 0x08, 0x0a, 0x0f}, {0x0f, 0x08, 0x0a, 0x0f}, {0x0f, 0x0a, 0x00, 0x0f},
{0x02, 0x04, 0x08, 0x0f}, {0x02, 0x04, 0x08, 0x0f}, {0x0f, 0x0f, 0x0f, 0x0a},
};
s8 local_48[6][4] = {
{0x07, 0x04, 0x05, 0x07}, {0x05, 0x07, 0x07, 0x07}, {0x07, 0x05, 0x00, 0x07},
{0x01, 0x02, 0x04, 0x07}, {0x07, 0x07, 0x07, 0x02}, {0x07, 0x07, 0x07, 0x05},
};
s8 local_68[6][5] = {
{1, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 1, 0, 0, 1},
{0, 0, 1, 0, 0}, {1, 0, 0, 0, 0}, {0, 0, 0, 0, 1},
};
param_0->setTevColorAB(local_30[param_1][0], local_30[param_1][1]);
param_0->setTevColorCD(local_30[param_1][2], local_30[param_1][3]);
param_0->setTevColorOp(local_68[param_1][0], local_68[param_1][1], local_68[param_1][2],
local_68[param_1][3], local_68[param_1][4]);
param_0->setAlphaABCD(local_48[param_1][0], local_48[param_1][1], local_48[param_1][2],
local_48[param_1][3]);
param_0->setTevAlphaOp(local_68[param_1][0], local_68[param_1][1], local_68[param_1][2],
local_68[param_1][3], local_68[param_1][4]);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J2DWindowEx::setStage(J2DTevStage* param_0, J2DWindowEx::stage_enum param_1) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DWindowEx/setStage__11J2DWindowExFP11J2DTevStageQ211J2DWindowEx10stage_enum.s"
}
#pragma pop
#endif
/* 80302764-803027EC 2FD0A4 0088+00 1/0 0/0 0/0 .text setBlack__11J2DWindowExFQ28JUtility6TColor
*/
bool J2DWindowEx::setBlack(JUtility::TColor black) {
JUtility::TColor dummy,white;
if (!getBlackWhite(&dummy, &white)) {
return false;
}
return setBlackWhite(black, white);
}
/* 803027EC-80302874 2FD12C 0088+00 1/0 0/0 0/0 .text setWhite__11J2DWindowExFQ28JUtility6TColor
*/
bool J2DWindowEx::setWhite(JUtility::TColor white) {
JUtility::TColor black,dummy;
if (!getBlackWhite(&black, &dummy)) {
return false;
}
return setBlackWhite(black, white);
}
/* 80302874-80302A4C 2FD1B4 01D8+00 1/0 0/0 0/0 .text
* setBlackWhite__11J2DWindowExFQ28JUtility6TColorQ28JUtility6TColor */
// J2DGXColorS10 issue
#ifdef NONMATCHING
bool J2DWindowEx::setBlackWhite(JUtility::TColor black, JUtility::TColor white) {
for (int i = 0; i < 4; i++) {
if (mFrameMaterial[i] == NULL) {
return false;
}
if (mFrameMaterial[i]->getTevBlock() == NULL) {
return false;
}
}
if (!isSetBlackWhite(black, white)) {
return false;
}
bool bVar1 = false;
if ((u32)black != 0 || (u32)white != 0xffffffff) {
bVar1 = true;
}
u8 uVar3 = bVar1 ? 2 : 1;
for (int i = 0; i < 4; i++) {
mFrameMaterial[i]->getTevBlock()->setTevStageNum(uVar3);
}
setTevOrder(bVar1);
setTevStage(bVar1);
if (bVar1) {
J2DGXColorS10 color0;
J2DGXColorS10 color1;
color0.r = black.r;
color0.g = black.g;
color0.b = black.b;
color0.a = black.a;
color1.r = white.r;
color1.g = white.g;
color1.b = white.b;
color1.a = white.a;
for (int i = 0; i < 4; i++) {
mFrameMaterial[i]->getTevBlock()->setTevColor(0, color0);
mFrameMaterial[i]->getTevBlock()->setTevColor(1, color1);
}
}
return true;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm bool J2DWindowEx::setBlackWhite(JUtility::TColor param_0, JUtility::TColor param_1) {
nofralloc
#include "asm/JSystem/J2DGraph/J2DWindowEx/setBlackWhite__11J2DWindowExFQ28JUtility6TColorQ28JUtility6TColor.s"
}
#pragma pop
#endif
/* 80302A4C-80302BE8 2FD38C 019C+00 4/4 0/0 0/0 .text
* getBlackWhite__11J2DWindowExCFPQ28JUtility6TColorPQ28JUtility6TColor */
bool J2DWindowEx::getBlackWhite(JUtility::TColor* param_0, JUtility::TColor* param_1) const {
if (mFrameMaterial[0] == NULL) {
return false;
}
if (mFrameMaterial[0]->getTevBlock() == NULL) {
return false;
}
bool cVar6 = mFrameMaterial[0]->getTevBlock()->getTevStageNum() != 1;
*param_0 = JUtility::TColor(0);
*param_1 = JUtility::TColor(0xffffffff);
if (cVar6) {
J2DGXColorS10* color0p = mFrameMaterial[0]->getTevBlock()->getTevColor(0);
GXColorS10 color0;
color0.r = color0p->r;
color0.g = color0p->g;
color0.b = color0p->b;
color0.a = color0p->a;
J2DGXColorS10* color1p = mFrameMaterial[0]->getTevBlock()->getTevColor(1);
GXColorS10 color1;
color1.r = color1p->r;
color1.g = color1p->g;
color1.b = color1p->b;
color1.a = color1p->a;
*param_0 = JUtility::TColor((((u8)color0.r) << 0x18) | (((u8)color0.g) << 0x10) | (((u8)color0.b) << 0x8) | (((u8)color0.a)));
*param_1 = JUtility::TColor((((u8)color1.r) << 0x18) | (((u8)color1.g) << 0x10) | (((u8)color1.b) << 0x8) | (((u8)color1.a)));
}
return true;
}
/* 80302BE8-80302C88 2FD528 00A0+00 1/1 0/0 0/0 .text
* isSetBlackWhite__11J2DWindowExCFQ28JUtility6TColorQ28JUtility6TColor */
bool J2DWindowEx::isSetBlackWhite(JUtility::TColor param_0, JUtility::TColor param_1) const {
if ((u32)param_0 == 0 && (u32)param_1 == 0xffffffff) {
return true;
}
for (int i = 0; i < 4; i++) {
if (mFrameMaterial[i]->getTevBlock()->getMaxStage() == 1) {
return false;
}
}
return true;
}
/* 80302C88-80302CE8 2FD5C8 0060+00 1/0 0/0 0/0 .text getBlack__11J2DWindowExCFv */
JUtility::TColor J2DWindowEx::getBlack() const {
JUtility::TColor black, white;
if (!getBlackWhite(&black, &white)) {
return JUtility::TColor(0);
}
return black;
}
/* 80302CE8-80302D48 2FD628 0060+00 1/0 0/0 0/0 .text getWhite__11J2DWindowExCFv */
JUtility::TColor J2DWindowEx::getWhite() const {
JUtility::TColor black, white;
if (!getBlackWhite(&black, &white)) {
return JUtility::TColor(0xffffffff);
}
return white;
}
/* 80302D48-80302D98 2FD688 0050+00 1/0 0/0 0/0 .text setAlpha__11J2DWindowExFUc */
void J2DWindowEx::setAlpha(u8 param_0) {
mAlpha = param_0;
for (int i = 0; i < 4; i++) {
if (mFrameMaterial[i] != NULL) {
if (mFrameMaterial[i]->getColorBlock()->getMatColor(0) != NULL) {
mFrameMaterial[i]->getColorBlock()->getMatColor(0)->a = param_0;
}
}
}
if (mContentsMaterial != NULL) {
if (mContentsMaterial->getColorBlock()->getMatColor(0) != 0) {
mContentsMaterial->getColorBlock()->getMatColor(0)->a = param_0;
}
}
}
/* 80302D98-80302DF4 2FD6D8 005C+00 1/0 0/0 0/0 .text setCullBack__11J2DWindowExF11_GXCullMode */
void J2DWindowEx::setCullBack(_GXCullMode param_0) {
mCullMode = param_0;
for (int i = 0; i < 4; i++) {
if (mFrameMaterial[i] != NULL) {
mFrameMaterial[i]->getColorBlock()->setCullMode(param_0);
}
}
if (mContentsMaterial != NULL) {
mContentsMaterial->getColorBlock()->setCullMode(param_0);
}
J2DPane::setCullBack(param_0);
}
/* 80302DF4-80302E0C 2FD734 0018+00 1/0 0/0 0/0 .text rewriteAlpha__11J2DWindowExFv */
void J2DWindowEx::rewriteAlpha() {
if (mContentsMaterial != NULL) {
mAlpha = mContentsMaterial->getColorBlock()->getMatColor(0)->a;
}
}
/* 80302E0C-80302E74 2FD74C 0068+00 1/0 0/0 0/0 .text getFrameTexture__11J2DWindowExCFUcUc */
JUTTexture* J2DWindowEx::getFrameTexture(u8 param_0, u8 param_1) const {
J2DMaterial* frameMaterial = getFrameMaterial(param_0);
if (frameMaterial != NULL && frameMaterial->getTevBlock() != NULL) {
return frameMaterial->getTevBlock()->getTexture(param_1);
}
return NULL;
}
/* 80302E74-80302EDC 2FD7B4 0068+00 1/0 0/0 0/0 .text getContentsTexture__11J2DWindowExCFUc */
JUTTexture* J2DWindowEx::getContentsTexture(u8 param_0) const {
J2DMaterial* frameMaterial = getContentsMaterial();
if (frameMaterial != NULL && frameMaterial->getTevBlock() != NULL) {
return frameMaterial->getTevBlock()->getTexture(param_0);
}
return NULL;
}
/* 80302EDC-80302FFC 2FD81C 0120+00 1/0 0/0 0/0 .text isUsed__11J2DWindowExFPC7ResTIMG */
bool J2DWindowEx::isUsed(ResTIMG const* timg) {
for (u8 i = 0; i < 4; i++) {
if (mFrameMaterial[i] != NULL && mFrameMaterial[i]->getTevBlock() != NULL) {
for (u32 j = 0; j < 8; j++) {
JUTTexture* texture = mFrameMaterial[i]->getTevBlock()->getTexture(j);
if (texture != NULL && texture->getTexInfo() == timg) {
return true;
}
}
}
}
if (mContentsMaterial != NULL && mContentsMaterial->getTevBlock() != NULL) {
for (u32 j = 0; j < 8; j++) {
JUTTexture* texture = mContentsMaterial->getTevBlock()->getTexture(j);
if (texture != NULL && texture->getTexInfo() == timg) {
return true;
}
}
}
return J2DPane::isUsed(timg);
}
/* 80302FFC-80303084 2FD93C 0088+00 1/0 0/0 0/0 .text setAnimation__11J2DWindowExFP11J2DAnmColor
*/
void J2DWindowEx::setAnimation(J2DAnmColor* anmColor) {
for (u8 i = 0; i < 4; i++) {
if (isNeedSetAnm(i)) {
mFrameMaterial[i]->setAnimation(anmColor);
}
}
if (mContentsMaterial != NULL) {
mContentsMaterial->setAnimation(anmColor);
}
}
/* 80303084-8030310C 2FD9C4 0088+00 1/0 0/0 0/0 .text
* setAnimation__11J2DWindowExFP19J2DAnmTextureSRTKey */
void J2DWindowEx::setAnimation(J2DAnmTextureSRTKey* param_0) {
for (u8 i = 0; i < 4; i++) {
if (isNeedSetAnm(i)) {
mFrameMaterial[i]->setAnimation(param_0);
}
}
if (mContentsMaterial != NULL) {
mContentsMaterial->setAnimation(param_0);
}
}
/* 8030310C-80303194 2FDA4C 0088+00 1/0 0/0 0/0 .text
* setAnimation__11J2DWindowExFP16J2DAnmTexPattern */
void J2DWindowEx::setAnimation(J2DAnmTexPattern* param_0) {
for (u8 i = 0; i < 4; i++) {
if (isNeedSetAnm(i)) {
mFrameMaterial[i]->setAnimation(param_0);
}
}
if (mContentsMaterial != NULL) {
mContentsMaterial->setAnimation(param_0);
}
}
/* 80303194-8030321C 2FDAD4 0088+00 1/0 0/0 0/0 .text
* setAnimation__11J2DWindowExFP15J2DAnmTevRegKey */
void J2DWindowEx::setAnimation(J2DAnmTevRegKey* param_0) {
for (u8 i = 0; i < 4; i++) {
if (isNeedSetAnm(i)) {
mFrameMaterial[i]->setAnimation(param_0);
}
}
if (mContentsMaterial != NULL) {
mContentsMaterial->setAnimation(param_0);
}
}
/* 8030321C-80303274 2FDB5C 0058+00 4/4 0/0 0/0 .text isNeedSetAnm__11J2DWindowExFUc */
bool J2DWindowEx::isNeedSetAnm(u8 param_0) {
for (u8 i = 0; i < param_0; i++) {
if (mFrameMaterial[i] == mFrameMaterial[param_0]) {
return false;
}
}
return mFrameMaterial[param_0] != NULL;
}
/* 80303274-8030327C -00001 0008+00 0/0 0/0 0/0 .text
* setAnimation__11J2DWindowExFP20J2DAnmVisibilityFull */
void J2DWindowEx::setAnimation(J2DAnmVisibilityFull* param_0) {
mAnmVisibilityFull = param_0;
}
/* 8030327C-80303370 2FDBBC 00F4+00 1/0 0/0 0/0 .text
* setAnimation__11J2DWindowExFP14J2DAnmVtxColor */
void J2DWindowEx::setAnimation(J2DAnmVtxColor* param_0) {
mAnmVtxColor = param_0;
field_0x17c = 0;
if (param_0 != NULL) {
u16 uVar3 = param_0->getAnmTableNum(0);
for (u8 i = 0; i < 4; i++) {
if (field_0x168[i] != 0xffff) {
for (u16 j = 0; j < uVar3; j++) {
J3DAnmVtxColorIndexData* puVar1 = param_0->getAnmVtxColorIndexData(0, j);
u16* indexPointer = param_0->getVtxColorIndexPointer(0);
u16* indexPointer2 = indexPointer + (u32)puVar1->mpData;
for (u16 k = 0; k < puVar1->mNum; k++) {
if (indexPointer2[k] == field_0x168[i]) {
mAnmVtxColor = param_0;
field_0x17c |= 1 << i;
goto nexti;
}
}
}
}
nexti:;
}
}
if (field_0x17c == 0) {
mAnmVtxColor = NULL;
}
}
/* ############################################################################################## */
/* 803A1C70-803A1C80 02E2D0 0010+00 0/0 0/0 0/0 .rodata @1557 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_1557[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x803A1C70, &lit_1557);
#pragma pop
/* 803A1C80-803A1C90 02E2E0 0010+00 0/0 0/0 0/0 .rodata @1566 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_1566[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x803A1C80, &lit_1566);
#pragma pop
/* 803A1C90-803A1CA0 02E2F0 0010+00 0/0 0/0 0/0 .rodata @1575 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_1575[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x803A1C90, &lit_1575);
#pragma pop
/* 803A1CA0-803A1CB0 02E300 0010+00 0/0 0/0 0/0 .rodata @1581 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_1581[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x803A1CA0, &lit_1581);
#pragma pop
/* 803A1CB0-803A1CC0 02E310 0010+00 0/0 0/0 0/0 .rodata @1587 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_1587[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x803A1CB0, &lit_1587);
#pragma pop
/* 803A1CC0-803A1CD0 02E320 0010+00 0/0 0/0 0/0 .rodata @1596 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_1596[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x803A1CC0, &lit_1596);
#pragma pop
/* 803A1CD0-803A1CE0 02E330 0010+00 0/0 0/0 0/0 .rodata @1605 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_1605[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x803A1CD0, &lit_1605);
#pragma pop
/* 803A1CE0-803A1CF0 02E340 0010+00 0/0 0/0 0/0 .rodata @1612 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_1612[16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
COMPILER_STRIP_GATE(0x803A1CE0, &lit_1612);
#pragma pop
/* 803A1CF0-803A1D08 02E350 0018+00 0/0 0/0 0/0 .rodata @2530 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_2530[24] = {
0x0F, 0x08, 0x0A, 0x0F, 0x0F, 0x08, 0x0A, 0x0F, 0x0F, 0x0A, 0x00, 0x0F,
0x02, 0x04, 0x08, 0x0F, 0x02, 0x04, 0x08, 0x0F, 0x0F, 0x0F, 0x0F, 0x0A,
};
COMPILER_STRIP_GATE(0x803A1CF0, &lit_2530);
#pragma pop
/* 803A1D08-803A1D20 02E368 0018+00 0/0 0/0 0/0 .rodata @2531 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_2531[24] = {
0x07, 0x04, 0x05, 0x07, 0x05, 0x07, 0x07, 0x07, 0x07, 0x05, 0x00, 0x07,
0x01, 0x02, 0x04, 0x07, 0x07, 0x07, 0x07, 0x02, 0x07, 0x07, 0x07, 0x05,
};
COMPILER_STRIP_GATE(0x803A1D08, &lit_2531);
#pragma pop
/* 803A1D20-803A1D40 02E380 001E+02 0/0 0/0 0/0 .rodata @2532 */
#pragma push
#pragma force_active on
SECTION_RODATA static u8 const lit_2532[30 + 2 /* padding */] = {
0x00,
0x00,
0x00,
0x01,
0x00,
0x00,
0x00,
0x00,
0x01,
0x00,
0x00,
0x00,
0x00,
0x01,
0x00,
0x00,
0x00,
0x00,
0x01,
0x00,
0x00,
0x00,
0x00,
0x01,
0x00,
0x00,
0x00,
0x00,
0x01,
0x00,
/* padding */
0x00,
0x00,
};
COMPILER_STRIP_GATE(0x803A1D20, &lit_2532);
#pragma pop
/* 80303370-80303510 2FDCB0 01A0+00 1/0 0/0 0/0 .text
* animationPane__11J2DWindowExFPC15J2DAnmTransform */
const J2DAnmTransform* J2DWindowEx::animationPane(J2DAnmTransform const* param_0) {
if (mAnmVisibilityFull != 0 && field_0x166 != 0xffff) {
u8 visibility;
mAnmVisibilityFull->getVisibility(field_0x166, &visibility);
if (visibility) {
J2DPane::show();
} else {
J2DPane::hide();
}
}
JUtility::TColor* local_38[4] = {NULL};
local_38[0] = &field_0x128;
local_38[1] = &field_0x12C;
local_38[2] = &field_0x130;
local_38[3] = &field_0x134;
if (mAnmVtxColor != NULL) {
u16 uVar3 = mAnmVtxColor->getAnmTableNum(0);
for (u8 i = 0; i < 4; i++) {
if ((field_0x17c & (1 << i))) {
for (u16 j = 0; j < uVar3; j++) {
J3DAnmVtxColorIndexData* puVar1 = mAnmVtxColor->getAnmVtxColorIndexData(0, j);
u16* indexPointer = mAnmVtxColor->getVtxColorIndexPointer(0);
u16* indexPointer2 = indexPointer + (u32)puVar1->mpData;
for (u16 k = 0; k < puVar1->mNum; k++) {
if (indexPointer2[k] == field_0x168[i]) {
mAnmVtxColor->getColor(0, j, local_38[i]);
goto nexti;
}
}
}
}
nexti:;
}
}
return J2DPane::animationPane(param_0);
}
/* 80303510-80303534 2FDE50 0024+00 1/0 0/0 0/0 .text getFrameMaterial__11J2DWindowExCFUc
*/
J2DMaterial* J2DWindowEx::getFrameMaterial(u8 index) const {
if (index >= 4) {
return NULL;
}
return mFrameMaterial[index];
}
/* 80303534-8030353C 2FDE74 0008+00 1/0 0/0 0/0 .text getContentsMaterial__11J2DWindowExCFv */
J2DMaterial* J2DWindowEx::getContentsMaterial() const {
return mContentsMaterial;
}
/* 8030353C-80303568 2FDE7C 002C+00 1/0 0/0 0/0 .text
* getMaterial__11J2DWindowExCFRQ29J2DWindow9TMaterial */
void J2DWindowEx::getMaterial(J2DWindow::TMaterial& param_0) const {
param_0.field_0x0 = mFrameMaterial[0];
param_0.field_0x4 = mFrameMaterial[1];
param_0.field_0x8 = mFrameMaterial[2];
param_0.field_0xc = mFrameMaterial[3];
param_0.field_0x10 = mContentsMaterial;
}
/* 80303568-803035C0 2FDEA8 0058+00 1/0 0/0 0/0 .text draw__11J2DWindowExFffff */
void J2DWindowEx::draw(f32 param_0, f32 param_1, f32 param_2, f32 param_3) {
draw(JGeometry::TBox2<f32>(JGeometry::TVec2<f32>(param_0, param_1),
JGeometry::TVec2<f32>(param_0 + param_2, param_1 + param_3)));
}
/* 803035C0-803035FC 2FDF00 003C+00 1/0 0/0 0/0 .text setCullBack__11J2DWindowExFb */
void J2DWindowEx::setCullBack(bool param_0) {
_GXCullMode mode;
if (param_0) {
mode = GX_CULL_BACK;
} else {
mode = GX_CULL_NONE;
}
setCullBack(mode);
}
/* 803035FC-8030361C 2FDF3C 0020+00 1/0 0/0 0/0 .text isUsed__11J2DWindowExFPC7ResFONT */
bool J2DWindowEx::isUsed(ResFONT const* param_0) {
return J2DPane::isUsed(param_0);
}
/* 8030361C-8030363C 2FDF5C 0020+00 1/0 0/0 0/0 .text setAnimation__11J2DWindowExFP10J2DAnmBase */
void J2DWindowEx::setAnimation(J2DAnmBase* param_0) {
J2DPane::setAnimation(param_0);
}
|