Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
game_modes.h File Reference

Go to the source code of this file.

Enumerations

enum  GameMode {
  GAME_MODE_STARTUP , GAME_MODE_LOGOS , GAME_MODE_TITLE_SCREEN , GAME_MODE_ENTER_DEMO_WORLD ,
  GAME_MODE_ENTER_WORLD , GAME_MODE_WORLD , GAME_MODE_CHANGE_MAP , GAME_MODE_GAME_OVER ,
  GAME_MODE_BATTLE , GAME_MODE_END_BATTLE , GAME_MODE_PAUSE , GAME_MODE_UNPAUSE ,
  GAME_MODE_FILE_SELECT , GAME_MODE_END_FILE_SELECT , GAME_MODE_INTRO , GAME_MODE_DEMO
}
 

Functions

void set_game_mode (s32 mode)
 
s32 get_game_mode (void)
 
void set_game_mode_render_frontUI (void(*fn)(void))
 
void clear_game_mode (void)
 
void step_game_mode (void)
 
void render_game_mode_backUI (void)
 
void render_game_mode_frontUI (void)
 

Enumeration Type Documentation

◆ GameMode

enum GameMode
Enumerator
GAME_MODE_STARTUP 
GAME_MODE_LOGOS 
GAME_MODE_TITLE_SCREEN 
GAME_MODE_ENTER_DEMO_WORLD 
GAME_MODE_ENTER_WORLD 
GAME_MODE_WORLD 
GAME_MODE_CHANGE_MAP 
GAME_MODE_GAME_OVER 
GAME_MODE_BATTLE 
GAME_MODE_END_BATTLE 
GAME_MODE_PAUSE 
GAME_MODE_UNPAUSE 
GAME_MODE_FILE_SELECT 
GAME_MODE_END_FILE_SELECT 
GAME_MODE_INTRO 
GAME_MODE_DEMO 

Definition at line 6 of file game_modes.h.

6 {
23};
@ GAME_MODE_PAUSE
Definition game_modes.h:17
@ GAME_MODE_END_BATTLE
Definition game_modes.h:16
@ GAME_MODE_LOGOS
Definition game_modes.h:8
@ GAME_MODE_UNPAUSE
Definition game_modes.h:18
@ GAME_MODE_DEMO
Definition game_modes.h:22
@ GAME_MODE_ENTER_WORLD
Definition game_modes.h:11
@ GAME_MODE_GAME_OVER
Definition game_modes.h:14
@ GAME_MODE_BATTLE
Definition game_modes.h:15
@ GAME_MODE_WORLD
Definition game_modes.h:12
@ GAME_MODE_END_FILE_SELECT
Definition game_modes.h:20
@ GAME_MODE_FILE_SELECT
Definition game_modes.h:19
@ GAME_MODE_ENTER_DEMO_WORLD
Definition game_modes.h:10
@ GAME_MODE_CHANGE_MAP
Definition game_modes.h:13
@ GAME_MODE_TITLE_SCREEN
Definition game_modes.h:9
@ GAME_MODE_INTRO
Definition game_modes.h:21
@ GAME_MODE_STARTUP
Definition game_modes.h:7

Function Documentation

◆ set_game_mode()

void set_game_mode ( s32 mode)

Definition at line 127 of file game_modes.c.

127 {
128 GameModeData const* template = &GameModeTemplates[modeID];
129 CurGameModeID = modeID;
130
132 CurGameMode.init = template->init;
133 CurGameMode.step = template->step;
134 CurGameMode.renderBackUI = template->renderBackUI;
135
136 if (CurGameMode.init == NULL) {
138 }
139 if (CurGameMode.step == NULL) {
141 }
142 if (CurGameMode.renderBackUI == NULL) {
144 }
145
148}
BSS s32 CurGameModeID
Definition game_modes.c:117
void game_mode_nop(void)
Definition game_modes.c:120
BSS GameModeData CurGameMode
Definition game_modes.c:118
const GameModeData GameModeTemplates[]
Definition game_modes.c:18
@ MODE_FLAG_NEEDS_STEP
Definition game_modes.c:6
@ MODE_FLAG_INITIALIZED
Definition game_modes.c:5
void(* renderFrontUI)(void)
Definition game_modes.c:15
void(* init)(void)
Definition game_modes.c:12
void(* renderBackUI)(void)
Definition game_modes.c:14
void(* step)(void)
Definition game_modes.c:13

Referenced by btl_state_update_end_battle(), btl_state_update_end_demo_battle(), check_input_open_menus(), filemenu_main_handle_input(), filemenu_yesno_handle_input(), goto_map(), load_battle(), load_engine_data(), pause_handle_input(), state_step_change_map(), state_step_demo(), state_step_end_battle(), state_step_enter_world(), state_step_exit_file_select(), state_step_game_over(), state_step_intro(), state_step_logos(), state_step_startup(), state_step_title_screen(), state_step_unpause(), and step_game_loop().

◆ get_game_mode()

s32 get_game_mode ( void )

◆ set_game_mode_render_frontUI()

void set_game_mode_render_frontUI ( void(*)(void) fn)

Definition at line 154 of file game_modes.c.

154 {
157
158 if (fn == NULL) {
160 }
161}
@ MODE_FLAG_HAS_FRONT_UI
Definition game_modes.c:7

Referenced by state_init_title_screen(), and state_init_world().

◆ clear_game_mode()

void clear_game_mode ( void )

Definition at line 150 of file game_modes.c.

150 {
152}
@ MODE_FLAG_NONE
Definition game_modes.c:4

Referenced by load_engine_data().

◆ step_game_mode()

void step_game_mode ( void )

Definition at line 163 of file game_modes.c.

163 {
165 return;
166 }
167
168 CurGameMode.flags &= ~MODE_FLAG_NEEDS_STEP;
170}

Referenced by step_game_loop().

◆ render_game_mode_backUI()

void render_game_mode_backUI ( void )

Definition at line 172 of file game_modes.c.

172 {
174 return;
175 }
176
178}

Referenced by gfx_draw_frame().

◆ render_game_mode_frontUI()

void render_game_mode_frontUI ( void )

Definition at line 180 of file game_modes.c.

180 {
182 return;
183 }
184
186 return;
187 }
188
191 }
192}

Referenced by gfx_draw_frame().