papermario
Decompilation of Paper Mario
 
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Loading...
Searching...
No Matches
draw_box.c File Reference

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
Color_RGBA8 color1
Color_RGBA8 color2
u8 combineModeIndex
u8 cornersIndex

Macro Definition Documentation

◆ BOX_QUAD_BUFFER_NUM

#define BOX_QUAD_BUFFER_NUM   21

Referenced by draw_box().

◆ 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)

Referenced by draw_box().

Function Documentation

◆ 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 )

◆ INCLUDE_IMG() [1/11]

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

◆ INCLUDE_IMG() [2/11]

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

◆ INCLUDE_IMG() [3/11]

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

◆ INCLUDE_IMG() [4/11]

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

◆ INCLUDE_IMG() [5/11]

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

◆ INCLUDE_IMG() [6/11]

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

◆ INCLUDE_IMG() [7/11]

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

◆ INCLUDE_IMG() [8/11]

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

◆ INCLUDE_IMG() [9/11]

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

◆ INCLUDE_IMG() [10/11]

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

◆ INCLUDE_IMG() [11/11]

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

Variable Documentation

◆ 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
}
}
s8 ui_box_bg_tile_png[]

Referenced by draw_box().

◆ gBoxCombineModes

Gfx gBoxCombineModes[]
Initial value:
= {
gsDPSetCombineMode(PM_CC_BOX1_OPAQUE, PM_CC_BOX1_CYC2),
gsDPSetCombineMode(PM_CC_BOX2_OPAQUE, PM_CC_BOX2_CYC2),
}
#define PM_CC_BOX1_TRANSPARENT
Definition macros.h:468
#define PM_CC_BOX2_TRANSPARENT
Definition macros.h:469
#define PM_CC_BOX1_CYC2
Definition macros.h:471
#define PM_CC_BOX2_OPAQUE
Definition macros.h:467
#define PM_CC_BOX2_CYC2
Definition macros.h:472
#define PM_CC_BOX1_OPAQUE
Definition macros.h:466

Referenced by draw_box().

◆ gBoxCorners

WindowCorners gBoxCorners[]

Referenced by draw_box().

◆ gBoxDefaultStyles

DefaultWindowStyle gBoxDefaultStyles[]

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

Referenced by draw_box().

◆ gBoxQuadBuffer

BSS Vtx gBoxQuadBuffer[21][16]

Referenced by draw_box().

◆ gBoxQuadIndex

s32 gBoxQuadIndex = 0

Referenced by draw_box().

◆ gBoxViewport

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

Referenced by draw_box().