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

Go to the source code of this file.

Functions

 INCLUDE_IMG ("theater/walls.png", theater_walls_png)
 
 INCLUDE_IMG ("theater/curtains.png", theater_curtains_png)
 
 INCLUDE_IMG ("theater/floor.png", theater_floor_png)
 
 INCLUDE_PAL ("theater/floor.pal", theater_floor_pal)
 
 INCLUDE_IMG ("ui/no_controller.png", ui_no_controller_png)
 
BSS UNK_FUN_PTR (gCurtainDrawCallback)
 
void initialize_curtains (void)
 
void update_curtains (void)
 
void render_curtains (void)
 
void set_curtain_scale_goal (f32 scale)
 
void set_curtain_scale (f32 scale)
 
void set_curtain_draw_callback (UNK_FUN_PTR(callback))
 
void set_curtain_fade_goal (f32 fade)
 
void set_curtain_fade (f32 fade)
 

Variables

Gfx D_800746E0 []
 
Gfx D_80075730 []
 
Gfx D_800758A0 []
 
Gfx TheaterWallShadowsGfx []
 
Gfx TheaterCurtainGfx []
 
Gfx TheaterInsetShadowsGfx []
 
Gfx TheaterFloorGfx []
 
Gfx TheaterRightWallGfx []
 
Gfx TheaterLeftWallGfx []
 
Gfx TheaterGfx []
 
Vp TheaterViewport
 
Gfx TheaterInitGfx []
 
Gfx NoControllerSetupTexGfx []
 
Gfx NoControllerGfx []
 
BSS f32 gCurtainScale
 
BSS f32 gCurtainScaleGoal
 
BSS f32 gCurtainFade
 
BSS f32 gCurtainFadeGoal
 
BSS Mtx D_8009BAA8 [2]
 

Function Documentation

◆ INCLUDE_IMG() [1/4]

INCLUDE_IMG ( "theater/walls.png" ,
theater_walls_png  )

◆ INCLUDE_IMG() [2/4]

INCLUDE_IMG ( "theater/curtains.png" ,
theater_curtains_png  )

◆ INCLUDE_IMG() [3/4]

INCLUDE_IMG ( "theater/floor.png" ,
theater_floor_png  )

◆ INCLUDE_PAL()

INCLUDE_PAL ( "theater/floor.pal" ,
theater_floor_pal  )

◆ INCLUDE_IMG() [4/4]

INCLUDE_IMG ( "ui/no_controller.png" ,
ui_no_controller_png  )

◆ UNK_FUN_PTR()

BSS UNK_FUN_PTR ( gCurtainDrawCallback )

◆ initialize_curtains()

void initialize_curtains ( void )

Definition at line 212 of file curtains.c.

212 {
214 gCurtainScale = 2.0f;
215 gCurtainScaleGoal = 2.0f;
216 gCurtainFade = 0.0f;
217 gCurtainFadeGoal = 0.0f;
218}
BSS s32 PopupMenu_SelectedIndex
BSS f32 gCurtainFadeGoal
Definition curtains.c:208
BSS f32 gCurtainScale
Definition curtains.c:205
BSS f32 gCurtainScaleGoal
Definition curtains.c:206
BSS f32 gCurtainFade
Definition curtains.c:207

Referenced by load_engine_data(), and state_step_startup().

◆ update_curtains()

void update_curtains ( void )

Definition at line 220 of file curtains.c.

220 {
221}

Referenced by step_game_loop().

◆ render_curtains()

void render_curtains ( void )

Definition at line 223 of file curtains.c.

223 {
226 }
227
230 }
231
232 if (gCurtainScale < 1.9) {
233 Matrix4f m;
234 f32 scale;
235 s8 rgb;
236
240
241 guFrustumF(m, -80.0f, 80.0f, -60.0f, 60.0f, 160.0f, 640.0f, 1.0f);
242 guMtxF2L(m, &D_8009BAA8[0]);
243
245
246 scale = gCurtainScale - 0.01;
247 if (scale < 1.0f) {
248 scale = 1.0f;
249 }
250
251 guPositionF(m, 0.0f, 0.0f, 0.0f, scale * 0.1, 0.0f, 0.0f, -320.0f);
252
253 guMtxF2L(m, &D_8009BAA8[1]);
254
256 rgb = 255.0f - (gCurtainFade * 255.0f);
257 gDPSetPrimColor(gMainGfxPos++, 0, 0, rgb, rgb, rgb, 255);
261 }
262
263 if (gCurtainDrawCallback != NULL) {
265 }
266
267 if (!(gGameStatusPtr->contBitPattern & 1)) {
271 s32 alpha = ((gGameStatusPtr->frameCounter) % 0x18) << 5;
272
273 if (alpha > 255) {
274 alpha = 255;
275 }
276
279 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0xFF, 0x20, 0x10, alpha);
281 }
282 }
283}
u16 * nuGfxCfb_ptr
Definition cam_main.c:14
f32 Matrix4f[4][4]
Gfx NoControllerGfx[]
Definition curtains.c:199
Gfx TheaterGfx[]
Definition curtains.c:139
Gfx NoControllerSetupTexGfx[]
Definition curtains.c:178
Gfx TheaterInitGfx[]
Definition curtains.c:156
BSS Mtx D_8009BAA8[2]
Definition curtains.c:210
Color_RGB8 rgb
Definition demo_api.c:16
#define guMtxF2L
#define guFrustumF
#define guPositionF
@ DEMO_STATE_NONE
Definition enums.h:3534
s32 get_game_mode(void)
Definition game_modes.c:123
@ GAME_MODE_TITLE_SCREEN
Definition game_modes.h:9
@ GAME_MODE_INTRO
Definition game_modes.h:21
#define SCREEN_WIDTH
Definition macros.h:109
GameStatus * gGameStatusPtr
Definition main_loop.c:32
Gfx * gMainGfxPos
Definition cam_main.c:15

Referenced by gfx_draw_frame().

◆ set_curtain_scale_goal()

void set_curtain_scale_goal ( f32 scale)

◆ set_curtain_scale()

void set_curtain_scale ( f32 scale)

Definition at line 289 of file curtains.c.

289 {
290 gCurtainScaleGoal = scale;
291 gCurtainScale = scale;
292}

Referenced by state_step_logos(), state_step_startup(), and state_step_title_screen().

◆ set_curtain_draw_callback()

void set_curtain_draw_callback ( UNK_FUN_PTR(callback) )

Definition at line 294 of file curtains.c.

294 {
295 gCurtainDrawCallback = callback;
296}

◆ set_curtain_fade_goal()

void set_curtain_fade_goal ( f32 fade)

Definition at line 298 of file curtains.c.

298 {
300}

Referenced by state_init_intro(), state_step_intro(), and state_step_logos().

◆ set_curtain_fade()

void set_curtain_fade ( f32 fade)

Definition at line 302 of file curtains.c.

302 {
305}

Referenced by state_step_logos(), state_step_startup(), and state_step_title_screen().

Variable Documentation

◆ D_800746E0

◆ D_80075730

◆ D_800758A0

◆ TheaterWallShadowsGfx

Gfx TheaterWallShadowsGfx[]
Initial value:

Definition at line 51 of file curtains.c.

◆ TheaterCurtainGfx

Gfx TheaterCurtainGfx[]
Initial value:
= {
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0),
gsSP2Triangles(12, 13, 14, 0, 12, 14, 15, 0),
gsSP2Triangles(15, 16, 17, 0, 15, 17, 18, 0),
gsSP2Triangles(19, 20, 21, 0, 19, 21, 22, 0),
gsSP2Triangles(13, 23, 24, 0, 13, 24, 14, 0),
gsSP2Triangles(23, 25, 26, 0, 23, 26, 24, 0),
gsSP2Triangles(25, 27, 28, 0, 25, 28, 26, 0),
gsSP2Triangles(27, 29, 30, 0, 27, 30, 28, 0),
}

Definition at line 62 of file curtains.c.

62 {
68 gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
69 gsSP2Triangles(4, 5, 6, 0, 4, 6, 7, 0),
70 gsSP2Triangles(8, 9, 10, 0, 8, 10, 11, 0),
71 gsSP2Triangles(12, 13, 14, 0, 12, 14, 15, 0),
72 gsSP2Triangles(15, 16, 17, 0, 15, 17, 18, 0),
73 gsSP2Triangles(19, 20, 21, 0, 19, 21, 22, 0),
74 gsSP2Triangles(13, 23, 24, 0, 13, 24, 14, 0),
75 gsSP2Triangles(23, 25, 26, 0, 23, 26, 24, 0),
76 gsSP2Triangles(25, 27, 28, 0, 25, 28, 26, 0),
77 gsSP2Triangles(27, 29, 30, 0, 27, 30, 28, 0),
79};

◆ TheaterInsetShadowsGfx

◆ TheaterFloorGfx

Gfx TheaterFloorGfx[]
Initial value:
= {
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsSP2Triangles(4, 5, 0, 0, 4, 0, 3, 0),
gsSP2Triangles(1, 6, 7, 0, 1, 7, 2, 0),
gsSP2Triangles(3, 8, 9, 0, 3, 9, 10, 0),
gsSP2Triangles(11, 4, 3, 0, 11, 3, 10, 0),
gsSP2Triangles(12, 13, 14, 0, 12, 14, 15, 0),
gsSP2Triangles(8, 12, 15, 0, 8, 15, 9, 0),
gsSP2Triangles(6, 16, 13, 0, 6, 13, 7, 0),
gsSP2Triangles(14, 17, 18, 0, 19, 14, 18, 0),
gsSP2Triangles(20, 11, 21, 0, 11, 22, 21, 0),
gsSP2Triangles(23, 19, 18, 0, 23, 18, 24, 0),
gsSP2Triangles(22, 23, 24, 0, 22, 24, 21, 0),
}
Gfx D_800746E0[]
Definition curtains.c:13

Definition at line 93 of file curtains.c.

93 {
100 gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
101 gsSP2Triangles(4, 5, 0, 0, 4, 0, 3, 0),
102 gsSP2Triangles(1, 6, 7, 0, 1, 7, 2, 0),
103 gsSP2Triangles(3, 8, 9, 0, 3, 9, 10, 0),
104 gsSP2Triangles(11, 4, 3, 0, 11, 3, 10, 0),
105 gsSP2Triangles(12, 13, 14, 0, 12, 14, 15, 0),
106 gsSP2Triangles(8, 12, 15, 0, 8, 15, 9, 0),
107 gsSP2Triangles(6, 16, 13, 0, 6, 13, 7, 0),
108 gsSP2Triangles(14, 17, 18, 0, 19, 14, 18, 0),
109 gsSP2Triangles(20, 11, 21, 0, 11, 22, 21, 0),
110 gsSP2Triangles(23, 19, 18, 0, 23, 18, 24, 0),
111 gsSP2Triangles(22, 23, 24, 0, 22, 24, 21, 0),
113};

◆ TheaterRightWallGfx

◆ TheaterLeftWallGfx

◆ TheaterGfx

◆ TheaterViewport

Vp TheaterViewport
Initial value:
= {
{
{(SCREEN_WIDTH/2)*4, (SCREEN_HEIGHT/2)*4, 0x200 - 1, 0},
{(SCREEN_WIDTH/2)*4, (SCREEN_HEIGHT/2)*4, 0x200 - 1, 0},
}
}
#define SCREEN_HEIGHT
Definition macros.h:110

Definition at line 149 of file curtains.c.

149 {
150 {
151 {(SCREEN_WIDTH/2)*4, (SCREEN_HEIGHT/2)*4, 0x200 - 1, 0},
152 {(SCREEN_WIDTH/2)*4, (SCREEN_HEIGHT/2)*4, 0x200 - 1, 0},
153 }
154};

◆ TheaterInitGfx

Gfx TheaterInitGfx[]
Initial value:

Definition at line 156 of file curtains.c.

Referenced by render_curtains().

◆ NoControllerSetupTexGfx

Gfx NoControllerSetupTexGfx[]
Initial value:

Definition at line 178 of file curtains.c.

Referenced by render_curtains().

◆ NoControllerGfx

Gfx NoControllerGfx[]
Initial value:
= {
gsSPTextureRectangle(0x0180, 0x0260, 0x0380, 0x02E0, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400),
}

Definition at line 199 of file curtains.c.

199 {
200 gsSPTextureRectangle(0x0180, 0x0260, 0x0380, 0x02E0, G_TX_RENDERTILE, 0, 0, 0x0400, 0x0400),
201 gsDPPipeSync(),
203};

Referenced by render_curtains().

◆ gCurtainScale

BSS f32 gCurtainScale

Definition at line 205 of file curtains.c.

Referenced by initialize_curtains(), render_curtains(), and set_curtain_scale().

◆ gCurtainScaleGoal

BSS f32 gCurtainScaleGoal

◆ gCurtainFade

BSS f32 gCurtainFade

Definition at line 207 of file curtains.c.

Referenced by initialize_curtains(), render_curtains(), and set_curtain_fade().

◆ gCurtainFadeGoal

BSS f32 gCurtainFadeGoal

◆ D_8009BAA8

BSS Mtx D_8009BAA8[2]

Definition at line 210 of file curtains.c.

Referenced by render_curtains().