Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
draw_box.c File Reference

Go to the source code of this file.

Data Structures

struct  DefaultWindowStyle
 

Macros

#define INTEGER_LOG2(x)   ((x) <= 1 ? 0 : (x) <= 2 ? 1 : (x) <= 4 ? 2 : (x) <= 8 ? 3 : (x) <= 16 ? 4 : (x) <= 32 ? 5 : (x) <= 64 ? 6 : (x) <= 128 ? 7 : (x) <= 256 ? 8 : (x) <= 512 ? 9 : 10)
 
#define BOX_QUAD_BUFFER_NUM   21
 

Functions

 INCLUDE_IMG ("ui/box/corners9.png", ui_box_corners9_png)
 
 INCLUDE_IMG ("ui/box/corners8.png", ui_box_corners8_png)
 
 INCLUDE_IMG ("ui/box/corners6.png", ui_box_corners6_png)
 
 INCLUDE_IMG ("ui/box/corners7.png", ui_box_corners7_png)
 
 INCLUDE_IMG ("ui/box/corners3.png", ui_box_corners3_png)
 
 INCLUDE_IMG ("ui/box/corners5.png", ui_box_corners5_png)
 
 INCLUDE_IMG ("ui/box/corners4.png", ui_box_corners4_png)
 
 INCLUDE_IMG ("ui/box/bg_tile.png", ui_box_bg_tile_png)
 
 INCLUDE_IMG ("ui/box/corners1.png", ui_box_corners1_png)
 
 INCLUDE_IMG ("ui/box/corners2.png", ui_box_corners2_png)
 
 INCLUDE_IMG ("ui/box/bg_flat.png", ui_box_bg_flat_png)
 
s32 draw_box (s32 flags, WindowStyle windowStyle, s32 posX, s32 posY, s32 posZ, s32 width, s32 height, u8 opacity, u8 darkening, f32 scaleX, f32 scaleY, f32 rotX, f32 rotY, f32 rotZ, void(*fpDrawContents)(s32, s32, s32, s32, s32, s32, s32), void *drawContentsArg0, Matrix4f rotScaleMtx, s32 translateX, s32 translateY, Matrix4f outMtx)
 

Variables

BSS Vtx gBoxQuadBuffer [21][16]
 
DefaultWindowStyle gBoxDefaultStyles []
 
WindowBackground gBoxBackground []
 
WindowCorners gBoxCorners []
 
Gfx gBoxCombineModes []
 
s32 gBoxQuadIndex = 0
 
Vp gBoxViewport
 
Mtx gBoxMatrix
 

Data Structure Documentation

◆ DefaultWindowStyle

struct DefaultWindowStyle
Data Fields
u8 bgIndex
u8 cornersIndex
u8 combineModeIndex
Color_RGBA8 color1
Color_RGBA8 color2

Macro Definition Documentation

◆ INTEGER_LOG2

#define INTEGER_LOG2 ( x)    ((x) <= 1 ? 0 : (x) <= 2 ? 1 : (x) <= 4 ? 2 : (x) <= 8 ? 3 : (x) <= 16 ? 4 : (x) <= 32 ? 5 : (x) <= 64 ? 6 : (x) <= 128 ? 7 : (x) <= 256 ? 8 : (x) <= 512 ? 9 : 10)

Definition at line 5 of file draw_box.c.

Referenced by draw_box().

◆ BOX_QUAD_BUFFER_NUM

#define BOX_QUAD_BUFFER_NUM   21

Definition at line 15 of file draw_box.c.

Referenced by draw_box().

Function Documentation

◆ INCLUDE_IMG() [1/11]

INCLUDE_IMG ( "ui/box/corners9.png" ,
ui_box_corners9_png  )

◆ INCLUDE_IMG() [2/11]

INCLUDE_IMG ( "ui/box/corners8.png" ,
ui_box_corners8_png  )

◆ INCLUDE_IMG() [3/11]

INCLUDE_IMG ( "ui/box/corners6.png" ,
ui_box_corners6_png  )

◆ INCLUDE_IMG() [4/11]

INCLUDE_IMG ( "ui/box/corners7.png" ,
ui_box_corners7_png  )

◆ INCLUDE_IMG() [5/11]

INCLUDE_IMG ( "ui/box/corners3.png" ,
ui_box_corners3_png  )

◆ INCLUDE_IMG() [6/11]

INCLUDE_IMG ( "ui/box/corners5.png" ,
ui_box_corners5_png  )

◆ INCLUDE_IMG() [7/11]

INCLUDE_IMG ( "ui/box/corners4.png" ,
ui_box_corners4_png  )

◆ INCLUDE_IMG() [8/11]

INCLUDE_IMG ( "ui/box/bg_tile.png" ,
ui_box_bg_tile_png  )

◆ INCLUDE_IMG() [9/11]

INCLUDE_IMG ( "ui/box/corners1.png" ,
ui_box_corners1_png  )

◆ INCLUDE_IMG() [10/11]

INCLUDE_IMG ( "ui/box/corners2.png" ,
ui_box_corners2_png  )

◆ INCLUDE_IMG() [11/11]

INCLUDE_IMG ( "ui/box/bg_flat.png" ,
ui_box_bg_flat_png  )

◆ draw_box()

s32 draw_box ( s32 flags,
WindowStyle windowStyle,
s32 posX,
s32 posY,
s32 posZ,
s32 width,
s32 height,
u8 opacity,
u8 darkening,
f32 scaleX,
f32 scaleY,
f32 rotX,
f32 rotY,
f32 rotZ,
void(*)(s32, s32, s32, s32, s32, s32, s32) fpDrawContents,
void * drawContentsArg0,
Matrix4f rotScaleMtx,
s32 translateX,
s32 translateY,
Matrix4f outMtx )

Definition at line 337 of file draw_box.c.

341{
343 u8 primR, primG, primB, primA, envR, envG, envB, envA;
345 WindowStyleCustom* customStyle = nullptr;
346 WindowCorners* corners;
347 WindowBackground* background;
350 s32 masks, maskt;
351 Vtx* quads;
352 s32 idx;
353 s32 i, j;
354 s32 tmem = 0x100;
356
357 s32 foo;
358
359 if (windowStyle.defaultStyleID <= WINDOW_STYLE_MAX && windowStyle.defaultStyleID >= 0) {
360 defaultStyle = &gBoxDefaultStyles[windowStyle.defaultStyleID];
361
362 primR = defaultStyle->color1.r;
363 primG = defaultStyle->color1.g;
364 primB = defaultStyle->color1.b;
365 primA = defaultStyle->color1.a * opacity / 255;
366 envR = defaultStyle->color2.r;
367 envG = defaultStyle->color2.g;
368 envB = defaultStyle->color2.b;
369 envA = defaultStyle->color2.a;
370
371 background = &gBoxBackground[defaultStyle->bgIndex];
372 corners = &gBoxCorners[defaultStyle->cornersIndex];
373 } else {
374 primR = windowStyle.customStyle->color1.r;
375 primG = windowStyle.customStyle->color1.g;
376 primB = windowStyle.customStyle->color1.b;
377 primA = windowStyle.customStyle->color1.a * opacity / 255;
378 envR = windowStyle.customStyle->color2.r;
379 envG = windowStyle.customStyle->color2.g;
380 envB = windowStyle.customStyle->color2.b;
381 envA = windowStyle.customStyle->color2.a;
382
383 customStyle = windowStyle.customStyle;
384 background = &windowStyle.customStyle->background;
385 corners = &windowStyle.customStyle->corners;
386 }
387 {
388 u8* bgImage;
390 s32 bgFmt;
391 s32 bgMasks;
392 s32 bgMaskt;
396 Mtx* sp154;
397
398 bgFmt = background->fmt;
399 cornersImage = corners->imgData;
400
401 bgWidth = background->width;
402 bgImage = background->imgData;
403 bgHeight = background->height;
404
407
408 quads = nullptr;
409 sp154 = nullptr;
410 cornersSizes = (Vec2bu*)&corners->size1;
411 cornersFmt = corners->fmt;
412 cornersBitDepth = corners->bitDepth;
413
414 if (width <= 0 || height <= 0 || opacity == 0 || posX <= -768 || posY <= -768) {
415 return true;
416 }
417
418 if (posX >= SCREEN_WIDTH || posY >= SCREEN_HEIGHT) {
419 return true;
420 }
421
422 if (posX + width >= 768 || posY + height >= 768 || posX + width <= 0 || posY + height <= 0) {
423 return true;
424 }
425
429 gBoxQuadIndex = 0;
430 }
431 }
432
435 gDPSetBlendColor(gMainGfxPos++, 0, 0, 0, 0);
436 gDPSetFogColor(gMainGfxPos++, 0, 0, 0, darkening);
438 if (!(flags & DRAW_FLAG_NO_CLIP)) {
440 }
441
442 if (defaultStyle != nullptr) {
444 *gfxPos = gBoxCombineModes[defaultStyle->combineModeIndex + (primA != 255 ? 2 : 0)];
445 } else {
447 if (primA != 255) {
448 *gfxPos = customStyle->transparentCombineMode;
449 } else {
450 *gfxPos = customStyle->opaqueCombineMode;
451 }
452 }
453
454 gMainGfxPos++;
456
457 if (quads != nullptr) {
459 guFrustumF(mtx1, -80.0f, 80.0f, 60.0f, -60.0f, 160.0f, 480.0f, 1.0f);
463 guPositionF(mtx1, rotX, rotY, rotZ, 1.0f, posX + width / 2, posY + height / 2, posZ);
464 if (scaleX != 1.0f || scaleY != 1.0f) {
465 guScaleF(mtx2, scaleX, scaleY, 1.0f);
467 }
468 if (rotScaleMtx != 0) {
469 guTranslateF(mtx2, -translateX / 2, -translateY / 2, 0.0f);
472 }
473 if (outMtx) {
474 for (i = 0; i < 4; i++) {
475 for (j = 0; j < 4; j++) {
476 outMtx[i][j] = mtx1[i][j];
477 }
478 }
479 }
480 guTranslateF(mtx2, -160.0f, -120.0f, -320.0f);
485 }
490 } else {
492 }
493
494 gSPTexture(gMainGfxPos++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
498 gDPSetPrimColor(gMainGfxPos++, 0, 0, primR, primG, primB, primA);
499 gDPSetEnvColor(gMainGfxPos++, envR, envG, envB, envA);
500 if (bgImage != nullptr) {
501 switch (background->bitDepth) {
502 case G_IM_SIZ_4b:
504 break;
505 case G_IM_SIZ_8b:
507 break;
508 case G_IM_SIZ_16b:
510 break;
511 case G_IM_SIZ_32b:
513 break;
514 }
515
520 width / 2 * 4 + bgScrollOffsetX,
521 height / 2 * 4 + bgScrollOffsetY,
522 (width / 2 + bgWidth - 1) * 4 + bgScrollOffsetX,
523 (height / 2 + bgHeight - 1) * 4 + bgScrollOffsetY);
524 } else {
525 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, width / 2 * 4, height / 2 * 4,
526 (width / 2 + bgWidth - 1) * 4, (height / 2 + bgHeight - 1)* 4);
527 }
528 }
529
530 if (cornersImage != nullptr) {
531 for (idx = 0; idx < 4; idx++) {
536
537 switch (cornersBitDepth) {
538 case G_IM_SIZ_4b:
541 break;
542 case G_IM_SIZ_8b:
545 break;
546 case G_IM_SIZ_16b:
549 break;
550 case G_IM_SIZ_32b:
553 break;
554 }
555
556 switch(idx) {
557 case 1:
558 gDPSetTileSize(gMainGfxPos++, 1, (width - cornerWidth) * 4, 0, (width - 1) * 4, (cornerHeight - 1) * 4);
559 break;
560 case 2:
561 gDPSetTileSize(gMainGfxPos++, 1, 0, (height - cornerHeight) * 4, (cornerWidth - 1) * 4, (height - 1) * 4);
562 break;
563 case 3:
564 gDPSetTileSize(gMainGfxPos++, 1, (width - cornerWidth) * 4, (height - cornerHeight) * 4, (width - 1) * 4, (height - 1) * 4);
565 break;
566 }
567
568 if (quads != nullptr) {
569 switch(idx) {
570 case 0:
571 quads[0].v.ob[0] = -width / 2;
572 quads[0].v.ob[1] = -height / 2;
573 quads[0].v.ob[2] = 0;
574
575 quads[1].v.ob[0] = 0;
576 quads[1].v.ob[1] = -height / 2;
577 quads[1].v.ob[2] = 0;
578
579 quads[2].v.ob[0] = -width / 2;
580 quads[2].v.ob[1] = 0;
581 quads[2].v.ob[2] = 0;
582
583 quads[3].v.ob[0] = 0;
584 quads[3].v.ob[1] = 0;
585 quads[3].v.ob[2] = 0;
586
587 quads[0].v.tc[0] = 0;
588 quads[0].v.tc[1] = 0;
589
590 quads[1].v.tc[0] = (width / 2) * 32;
591 quads[1].v.tc[1] = 0;
592
593 quads[2].v.tc[0] = 0;
594 quads[2].v.tc[1] = (height / 2) * 32;
595
596 quads[3].v.tc[0] = (width / 2) * 32;
597 quads[3].v.tc[1] = (height / 2) * 32;
598 break;
599 case 1:
600 quads[4].v.ob[0] = 0;
601 quads[4].v.ob[1] = -height / 2;
602 quads[4].v.ob[2] = 0;
603
604 quads[5].v.ob[0] = (-width / 2) + width;
605 quads[5].v.ob[1] = -height / 2;
606 quads[5].v.ob[2] = 0;
607
608 quads[6].v.ob[0] = 0;
609 quads[6].v.ob[1] = 0;
610 quads[6].v.ob[2] = 0;
611
612 quads[7].v.ob[0] = (-width / 2) + width;
613 quads[7].v.ob[1] = 0;
614 quads[7].v.ob[2] = 0;
615
616 quads[4].v.tc[0] = (width / 2) * 32;
617 quads[4].v.tc[1] = 0;
618
619 quads[5].v.tc[0] = width * 32;
620 quads[5].v.tc[1] = 0;
621
622 quads[6].v.tc[0] = (width / 2) * 32;
623 quads[6].v.tc[1] = (height / 2) * 32;
624
625 quads[7].v.tc[0] = width * 32;
626 quads[7].v.tc[1] = (height / 2) * 32;
627
628#ifndef SHIFT
629 quads += 4;
630#endif
631 break;
632 case 2:
633 quads[8].v.ob[0] = -width / 2;
634 quads[8].v.ob[1] = 0;
635 quads[8].v.ob[2] = 0;
636
637 quads[9].v.ob[0] = 0;
638 quads[9].v.ob[1] = 0;
639 quads[9].v.ob[2] = 0;
640
641 quads[10].v.ob[0] = -width / 2;
642 quads[10].v.ob[1] = height / 2;
643 quads[10].v.ob[2] = 0;
644
645 quads[11].v.ob[0] = 0;
646 quads[11].v.ob[1] = height / 2;
647 quads[11].v.ob[2] = 0;
648
649 quads[8].v.tc[0] = 0;
650 quads[8].v.tc[1] = (height / 2) * 32;
651
652 quads[9].v.tc[0] = (width / 2) * 32;
653 quads[9].v.tc[1] = (height / 2) * 32;
654
655 quads[10].v.tc[0] = 0;
656 quads[10].v.tc[1] = height * 32;
657
658 quads[11].v.tc[0] = (width / 2) * 32;
659 quads[11].v.tc[1] = height * 32;
660
661#ifndef SHIFT
662 quads += 8;
663#endif
664 break;
665 case 3:
666 quads[12].v.ob[0] = 0;
667 quads[12].v.ob[1] = 0;
668 quads[12].v.ob[2] = 0;
669
670 quads[13].v.ob[0] = (-width / 2) + width;
671 quads[13].v.ob[1] = 0;
672 quads[13].v.ob[2] = 0;
673
674 quads[14].v.ob[0] = 0;
675 quads[14].v.ob[1] = height / 2;
676 quads[14].v.ob[2] = 0;
677
678 quads[15].v.ob[0] = (-width / 2) + width;
679 quads[15].v.ob[1] = height / 2;
680 quads[15].v.ob[2] = 0;
681
682 quads[12].v.tc[0] = (width / 2) * 32;
683 quads[12].v.tc[1] = (height / 2) * 32;
684
685 quads[13].v.tc[0] = width * 32;
686 quads[13].v.tc[1] = (height / 2) * 32;
687
688 quads[14].v.tc[0] = (width / 2) * 32;
689 quads[14].v.tc[1] = height * 32;
690
691 quads[15].v.tc[0] = width * 32;
692 quads[15].v.tc[1] = height * 32;
693
694#ifndef SHIFT
695 quads += 12;
696#endif
697 break;
698 }
699#ifdef SHIFT
700 gSPVertex(gMainGfxPos++, &quads[idx*4], 4, 0);
701#else
702 gSPVertex(gMainGfxPos++, quads, 4, 0);
703#endif
704 gSP2Triangles(gMainGfxPos++, 0, 3, 1, 0, 0, 2, 3, 0);
705 } else {
706 switch (idx) {
707 case 0:
708 gSPScisTextureRectangle(gMainGfxPos++, posX * 4, posY * 4, (posX + width / 2) * 4, (posY + height / 2) * 4, G_TX_RENDERTILE, 0, 0, 0x400, 0x400);
709 break;
710 case 1:
711 gSPScisTextureRectangle(gMainGfxPos++, (posX + width / 2) * 4, posY * 4, (posX + width) * 4, (posY + height / 2) * 4, G_TX_RENDERTILE, (width / 2) * 32, 0, 0x400, 0x400);
712 break;
713 case 2:
714 gSPScisTextureRectangle(gMainGfxPos++, posX * 4, (posY + height / 2) * 4, (posX + width / 2) * 4, (posY + height) * 4, G_TX_RENDERTILE, 0, (height / 2) * 32, 0x400, 0x400);
715 break;
716 case 3:
717 gSPScisTextureRectangle(gMainGfxPos++, (posX + width / 2) * 4, (posY + height / 2) * 4, (posX + width) * 4, (posY + height) * 4, G_TX_RENDERTILE, (width / 2) * 32, (height / 2) * 32, 0x400, 0x400);
718 break;
719 }
720
721 }
723 }
724 } else if (bgImage != nullptr) {
725 if (quads != nullptr) {
726 quads[0].v.ob[0] = -width / 2;
727 quads[0].v.ob[1] = -height / 2;
728 quads[0].v.ob[2] = 0;
729
730 quads[1].v.ob[0] = (-width / 2) + width;
731 quads[1].v.ob[1] = -height / 2;
732 quads[1].v.ob[2] = 0;
733
734 quads[2].v.ob[0] = -width / 2;
735 quads[2].v.ob[1] = height / 2;
736 quads[2].v.ob[2] = 0;
737
738 quads[3].v.ob[0] = (-width / 2) + width;
739 quads[3].v.ob[1] = height / 2;
740 quads[3].v.ob[2] = 0;
741
742 quads[0].v.tc[0] = 0;
743 quads[0].v.tc[1] = 0;
744
745 quads[1].v.tc[1] = 0;
746 quads[1].v.tc[0] = width * 32;
747
748 quads[2].v.tc[0] = 0;
749 quads[2].v.tc[1] = height * 32;
750
751 quads[3].v.tc[0] = width * 32;
752 quads[3].v.tc[1] = height * 32;
753
754 gSPVertex(gMainGfxPos++, &quads[0], 4, 0);
755 gSP2Triangles(gMainGfxPos++, 0, 3, 1, 0, 0, 2, 3, 0);
756 } else {
757 gSPScisTextureRectangle(gMainGfxPos++, posX * 4, posY * 4, (posX + width) * 4, (posY + height) * 4, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400);
758 }
760 }
761
764 if(fpDrawContents != nullptr) {
765 if (quads != nullptr) {
766 void* mdl_address = mdl_get_next_texture_address(width * height * 2);
767 if(mdl_address != 0) {
769 gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, 0, 0, width, height);
771 gDPSetFillColor(gMainGfxPos++, PACK_FILL_COLOR(primR, primG, primB, 0));
773 gDPFillRectangle(gMainGfxPos++, 0, 0, width - 1, height - 1);
775 gDPSetScissorFrac(gMainGfxPos++, G_SC_NON_INTERLACE, 4, 4, (width - 1) * 4.0f, (height - 1) * 4.0f);
777
778 fpDrawContents((s32)drawContentsArg0, 0, 0, width, height, opacity, darkening);
779
785 gSPTexture(gMainGfxPos++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
792 guTranslateF(mtx3, 0.0f, 6.0f, 0.0f);
794 guTranslateF(mtx3, 0.0f, -height / 2, 0.0f);
797 for (idx = 0; idx < height / 6; idx++) {
799 if (idx == height / 6 - 1) {
800 extraHeight = 0;
801 if (height % 6 != 0) {
802 extraHeight = 1;
803 }
804 } else {
805 extraHeight = 1;
806 }
809 0, idx * 6, width - 1, idx * 6 + lineHeight, 0,
811 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, (160 - width / 2) * 4, 0, ((160 - width / 2) + width - 1) * 4, lineHeight * 4);
813 gSP2Triangles(gMainGfxPos++, 0, 3, 1, 0, 0, 2, 3, 0);
816 }
817 }
818 } else {
819 fpDrawContents((s32)drawContentsArg0, posX, posY, width, height, opacity, darkening);
820 }
821 }
822 if (quads != nullptr) {
826 }
827 return false;
828 }
829}
BSS s32 PopupMenu_SelectedIndex
u16 * nuGfxCfb_ptr
Definition cam_main.c:13
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
s8 flags
Definition demo_api.c:15
DefaultWindowStyle gBoxDefaultStyles[]
Definition draw_box.c:18
Mtx gBoxMatrix
Definition draw_box.c:326
BSS Vtx gBoxQuadBuffer[21][16]
Definition draw_box.c:16
WindowCorners gBoxCorners[]
Definition draw_box.c:215
#define BOX_QUAD_BUFFER_NUM
Definition draw_box.c:15
#define INTEGER_LOG2(x)
Definition draw_box.c:5
Vp gBoxViewport
Definition draw_box.c:317
s32 gBoxQuadIndex
Definition draw_box.c:315
Color_RGBA8 color1
Definition draw_box.c:11
WindowBackground gBoxBackground[]
Definition draw_box.c:194
Gfx gBoxCombineModes[]
Definition draw_box.c:308
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define guFrustumF
#define guPositionF
#define guScaleF
@ WINDOW_STYLE_MAX
Definition enums.h:5978
@ DRAW_FLAG_NO_CLIP
Definition enums.h:4590
@ DRAW_FLAG_ROTSCALE
Definition enums.h:4588
@ DRAW_FLAG_CULL_BACK
Definition enums.h:4591
@ DRAW_FLAG_ANIMATED_BACKGROUND
Definition enums.h:4589
void * mdl_get_next_texture_address(s32)
Definition model.c:4503
#define PM_RM_SHROUD
Definition macros.h:285
#define SCREEN_WIDTH
Definition macros.h:108
#define SCREEN_HEIGHT
Definition macros.h:109
#define PACK_FILL_COLOR(r, g, b, a)
Definition macros.h:174
GameStatus * gGameStatusPtr
Definition main_loop.c:31
Gfx * gMainGfxPos
Definition cam_main.c:14
u16 gMatrixListPos
Definition main_loop.c:44
DisplayContext * gDisplayContext
Definition cam_main.c:15

Variable Documentation

◆ gBoxQuadBuffer

BSS Vtx gBoxQuadBuffer[21][16]

Definition at line 16 of file draw_box.c.

Referenced by draw_box().

◆ gBoxDefaultStyles

DefaultWindowStyle gBoxDefaultStyles[]

Definition at line 18 of file draw_box.c.

18 {
19 {
20 .bgIndex = 1,
21 .cornersIndex = 0,
22 .combineModeIndex = 0,
23 .color1 = { .r = 200, .g = 191, .b = 164, .a = 255 },
24 .color2 = { .r = 128, .g = 128, .b = 128, .a = 255 }
25 },
26 {
27 .bgIndex = 1,
28 .cornersIndex = 1,
29 .combineModeIndex = 1,
30 .color1 = { .r = 255, .g = 200, .b = 128, .a = 255 },
31 .color2 = { .r = 128, .g = 128, .b = 128, .a = 255 }
32 },
33 {
34 .bgIndex = 1,
35 .cornersIndex = 2,
36 .combineModeIndex = 1,
37 .color1 = { .r = 232, .g = 196, .b = 77, .a = 255 },
38 .color2 = { .r = 163, .g = 123, .b = 0, .a = 255 }
39 },
40 {
41 .bgIndex = 0,
42 .cornersIndex = 3,
43 .combineModeIndex = 1,
44 .color1 = { .r = 226, .g = 225, .b = 216, .a = 255 },
45 .color2 = { .r = 217, .g = 208, .b = 201, .a = 255 }
46 },
47 {
48 .bgIndex = 1,
49 .cornersIndex = 4,
50 .combineModeIndex = 1,
51 .color1 = { .r = 61, .g = 74, .b = 188, .a = 255 },
52 .color2 = { .r = 0, .g = 25, .b = 28, .a = 255 }
53 },
54 {
55 .bgIndex = 1,
56 .cornersIndex = 5,
57 .combineModeIndex = 1,
58 .color1 = { .r = 235, .g = 230, .b = 119, .a = 255 },
59 .color2 = { .r = 142, .g = 90, .b = 37, .a = 255 }
60 },
61 {
62 .bgIndex = 1,
63 .cornersIndex = 6,
64 .combineModeIndex = 1,
65 .color1 = { .r = 235, .g = 230, .b = 119, .a = 255 },
66 .color2 = { .r = 142, .g = 99, .b = 37, .a = 255 }
67 },
68 {
69 .bgIndex = 1,
70 .cornersIndex = 4,
71 .combineModeIndex = 1,
72 .color1 = { .r = 215, .g = 191, .b = 116, .a = 255 },
73 .color2 = { .r = 132, .g = 70, .b = 50, .a = 255 }
74 },
75 {
76 .bgIndex = 1,
77 .cornersIndex = 4,
78 .combineModeIndex = 1,
79 .color1 = { .r = 215, .g = 191, .b = 116, .a = 255 },
80 .color2 = { .r = 132, .g = 70, .b = 50, .a = 255 }
81 },
82 {
83 .bgIndex = 1,
84 .cornersIndex = 4,
85 .combineModeIndex = 1,
86 .color1 = { .r = 141, .g = 143, .b = 255, .a = 255 },
87 .color2 = { .r = 43, .g = 69, .b = 102, .a = 255 }
88 },
89 {
90 .bgIndex = 1,
91 .cornersIndex = 8,
92 .combineModeIndex = 1,
93 .color1 = { .r = 141, .g = 143, .b = 255, .a = 255 },
94 .color2 = { .r = 43, .g = 69, .b = 102, .a = 255 }
95 },
96 {
97 .bgIndex = 1,
98 .cornersIndex = 4,
99 .combineModeIndex = 1,
100 .color1 = { .r = 170, .g = 208, .b = 128, .a = 255 },
101 .color2 = { .r = 71, .g = 123, .b = 83, .a = 255 }
102 },
103 {
104 .bgIndex = 1,
105 .cornersIndex = 8,
106 .combineModeIndex = 1,
107 .color1 = { .r = 170, .g = 208, .b = 128, .a = 255 },
108 .color2 = { .r = 71, .g = 123, .b = 83, .a = 255 }
109 },
110 {
111 .bgIndex = 1,
112 .cornersIndex = 4,
113 .combineModeIndex = 1,
114 .color1 = { .r = 200, .g = 200, .b = 90, .a = 255 },
115 .color2 = { .r = 140, .g = 140, .b = 0, .a = 255 }
116 },
117 {
118 .bgIndex = 1,
119 .cornersIndex = 8,
120 .combineModeIndex = 1,
121 .color1 = { .r = 200, .g = 200, .b = 90, .a = 255 },
122 .color2 = { .r = 140, .g = 140, .b = 0, .a = 255 }
123 },
124 {
125 .bgIndex = 1,
126 .cornersIndex = 4,
127 .combineModeIndex = 1,
128 .color1 = { .r = 235, .g = 230, .b = 119, .a = 255 },
129 .color2 = { .r = 142, .g = 90, .b = 37, .a = 255 }
130 },
131 {
132 .bgIndex = 1,
133 .cornersIndex = 4,
134 .combineModeIndex = 1,
135 .color1 = { .r = 142, .g = 212, .b = 236, .a = 255 },
136 .color2 = { .r = 67, .g = 98, .b = 69, .a = 255 }
137 },
138 {
139 .bgIndex = 1,
140 .cornersIndex = 4,
141 .combineModeIndex = 1,
142 .color1 = { .r = 167, .g = 151, .b = 119, .a = 255 },
143 .color2 = { .r = 98, .g = 55, .b = 154, .a = 255 }
144 },
145 {
146 .bgIndex = 1,
147 .cornersIndex = 7,
148 .combineModeIndex = 1,
149 .color1 = { .r = 17, .g = 151, .b = 29, .a = 255 },
150 .color2 = { .r = 8, .g = 55, .b = 14, .a = 255 }
151 },
152 {
153 .bgIndex = 1,
154 .cornersIndex = 7,
155 .combineModeIndex = 1,
156 .color1 = { .r = 110, .g = 110, .b = 200, .a = 255 },
157 .color2 = { .r = 10, .g = 10, .b = 100, .a = 255 }
158 },
159 {
160 .bgIndex = 1,
161 .cornersIndex = 4,
162 .combineModeIndex = 1,
163 .color1 = { .r = 181, .g = 60, .b = 60, .a = 255 },
164 .color2 = { .r = 76, .g = 10, .b = 0, .a = 255 }
165 },
166 {
167 .bgIndex = 1,
168 .cornersIndex = 4,
169 .combineModeIndex = 1,
170 .color1 = { .r = 174, .g = 227, .b = 235, .a = 255 },
171 .color2 = { .r = 76, .g = 110, .b = 60, .a = 255 }
172 },
173 {
174 .bgIndex = 0,
175 .cornersIndex = 3,
176 .combineModeIndex = 1,
177 .color1 = { .r = 126, .g = 125, .b = 216, .a = 255 },
178 .color2 = { .r = 217, .g = 108, .b = 201, .a = 255 }
179 }
180};

Referenced by draw_box().

◆ gBoxBackground

WindowBackground gBoxBackground[]
Initial value:
= {
{
.imgData = ui_box_bg_tile_png,
.fmt = G_IM_FMT_I,
.bitDepth = G_IM_SIZ_4b,
.width = 16,
.height = 16,
.unk_07 = { 0, 0, 0, 0},
.size = 128
},
{
.imgData = ui_box_bg_flat_png,
.fmt = G_IM_FMT_I,
.bitDepth = G_IM_SIZ_4b,
.width = 16,
.height = 1,
.unk_07 = { 0, 0, 0, 0},
.size = 8
}
}
u8 ui_box_bg_tile_png[]

Definition at line 194 of file draw_box.c.

194 {
195 {
196 .imgData = ui_box_bg_tile_png,
197 .fmt = G_IM_FMT_I,
198 .bitDepth = G_IM_SIZ_4b,
199 .width = 16,
200 .height = 16,
201 .unk_07 = { 0, 0, 0, 0},
202 .size = 128
203 },
204 {
205 .imgData = ui_box_bg_flat_png,
206 .fmt = G_IM_FMT_I,
207 .bitDepth = G_IM_SIZ_4b,
208 .width = 16,
209 .height = 1,
210 .unk_07 = { 0, 0, 0, 0},
211 .size = 8
212 }
213};

Referenced by draw_box().

◆ gBoxCorners

WindowCorners gBoxCorners[]

Definition at line 215 of file draw_box.c.

215 {
216 {
217 .imgData = ui_box_corners1_png,
218 .fmt = G_IM_FMT_IA,
219 .bitDepth = G_IM_SIZ_8b,
220 .size1 = { 16, 16},
221 .size2 = { 16, 16},
222 .size3 = { 16, 16},
223 .size4 = { 16, 16},
224 .unk_0D = { 0, 0, 0}
225 },
226 {
227 .imgData = ui_box_corners2_png,
228 .fmt = G_IM_FMT_I,
229 .bitDepth = G_IM_SIZ_4b,
230 .size1 = { 16, 16},
231 .size2 = { 16, 16},
232 .size3 = { 16, 16},
233 .size4 = { 16, 16},
234 .unk_0D = { 0, 0, 0}
235 },
236 {
237 .imgData = ui_box_corners3_png,
238 .fmt = G_IM_FMT_IA,
239 .bitDepth = G_IM_SIZ_8b,
240 .size1 = { 16, 32},
241 .size2 = { 16, 32},
242 .size3 = { 16, 16},
243 .size4 = { 16, 16},
244 .unk_0D = { 0, 0, 0}
245 },
246 {
247 .imgData = ui_box_corners4_png,
248 .fmt = G_IM_FMT_IA,
249 .bitDepth = G_IM_SIZ_8b,
250 .size1 = { 8, 8},
251 .size2 = { 8, 8},
252 .size3 = { 8, 8},
253 .size4 = { 8, 8},
254 .unk_0D = { 0, 0, 0}
255 },
256 {
257 .imgData = ui_box_corners5_png,
258 .fmt = G_IM_FMT_IA,
259 .bitDepth = G_IM_SIZ_8b,
260 .size1 = { 16, 8},
261 .size2 = { 16, 8},
262 .size3 = { 16, 8},
263 .size4 = { 16, 8},
264 .unk_0D = { 0, 0, 0}
265 },
266 {
267 .imgData = ui_box_corners6_png,
268 .fmt = G_IM_FMT_IA,
269 .bitDepth = G_IM_SIZ_8b,
270 .size1 = { 16, 8},
271 .size2 = { 16, 8},
272 .size3 = { 16, 8},
273 .size4 = { 16, 16},
274 .unk_0D = { 0, 0, 0}
275 },
276 {
277 .imgData = ui_box_corners7_png,
278 .fmt = G_IM_FMT_IA,
279 .bitDepth = G_IM_SIZ_8b,
280 .size1 = { 16, 8},
281 .size2 = { 16, 8},
282 .size3 = { 16, 8},
283 .size4 = { 16, 8},
284 .unk_0D = { 0, 0, 0}
285 },
286 {
287 .imgData = ui_box_corners8_png,
288 .fmt = G_IM_FMT_IA,
289 .bitDepth = G_IM_SIZ_8b,
290 .size1 = { 24, 24},
291 .size2 = { 24, 24},
292 .size3 = { 24, 24},
293 .size4 = { 24, 24},
294 .unk_0D = { 0, 0, 0}
295 },
296 {
297 .imgData = ui_box_corners9_png,
298 .fmt = G_IM_FMT_IA,
299 .bitDepth = G_IM_SIZ_8b,
300 .size1 = { 16, 16},
301 .size2 = { 16, 16},
302 .size3 = { 16, 16},
303 .size4 = { 16, 16},
304 .unk_0D = { 0, 0, 0}
305 }
306};
u8 ui_box_corners4_png[]

Referenced by draw_box().

◆ gBoxCombineModes

◆ gBoxQuadIndex

s32 gBoxQuadIndex = 0

Definition at line 315 of file draw_box.c.

Referenced by draw_box().

◆ gBoxViewport

Vp gBoxViewport
Initial value:
= {
.vp = {
.vscale = { 640, 480, 511, 0 },
.vtrans = { 640, 480, 511, 0 }
}
}

Definition at line 317 of file draw_box.c.

317 {
318 .vp = {
319 .vscale = { 640, 480, 511, 0 },
320 .vtrans = { 640, 480, 511, 0 }
321 }
322};

Referenced by draw_box().

◆ gBoxMatrix

Mtx gBoxMatrix
Initial value:
0.000000, 0.000000, 0.000000, -6.000000,
0.000000, 0.000000, 0.000000, 0.000000,
0.000000, 0.000000, 0.000000, 0.000000,
0.000000, 0.000000, 0.000000, 0.000000
)
#define RDP_MATRIX( Ax, Bx, Cx, Dx, Ay, By, Cy, Dy, Az, Bz, Cz, Dz, Aw, Bw, Cw, Dw)
Definition macros.h:244

Definition at line 326 of file draw_box.c.

Referenced by draw_box().