g_extern.console.rmenu.mode becomes g_extern.lifecycle_menu_state

This commit is contained in:
twinaphex 2013-01-10 18:04:04 +01:00
parent 6795d74025
commit 7a3b021b17
13 changed files with 45 additions and 43 deletions

View File

@ -73,6 +73,8 @@ enum
MODE_INIT = 1 << 2,
MODE_MENU = 1 << 3,
MODE_EXIT = 1 << 4,
MODE_LOAD_FIRST_SHADER = 1 << 5,
MODE_LOAD_SECOND_SHADER = 1 << 6,
};
enum

View File

@ -250,5 +250,5 @@ void rarch_console_load_game_wrap(const char *path, unsigned extract_zip_mode)
snprintf(g_extern.fullpath, sizeof(g_extern.fullpath), path);
do_init:
g_extern.console.rmenu.mode |= (1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_menu_state |= (1 << MODE_LOAD_GAME);
}

View File

@ -52,7 +52,7 @@ void rarch_settings_change(unsigned setting)
break;
case S_FRAME_ADVANCE:
g_extern.lifecycle_state |= (1ULL << RARCH_FRAMEADVANCE);
g_extern.console.rmenu.mode = (1ULL << MODE_EMULATION);
g_extern.lifecycle_menu_state = (1 << MODE_EMULATION);
break;
case S_HW_TEXTURE_FILTER:
g_settings.video.smooth = !g_settings.video.smooth;
@ -88,20 +88,20 @@ void rarch_settings_change(unsigned setting)
break;
case S_QUIT:
g_extern.console.rmenu.state.ingame_menu.enable = false;
g_extern.console.rmenu.mode = (1ULL << MODE_EXIT);
g_extern.lifecycle_menu_state = (1 << MODE_EXIT);
break;
case S_QUIT_RARCH:
g_extern.console.rmenu.mode = (1ULL << MODE_EXIT);
g_extern.lifecycle_menu_state = (1 << MODE_EXIT);
break;
case S_RETURN_TO_GAME:
g_extern.console.rmenu.mode = (1ULL << MODE_EMULATION);
g_extern.lifecycle_menu_state = (1 << MODE_EMULATION);
break;
case S_RETURN_TO_LAUNCHER:
g_extern.console.external_launch.enable = true;
g_extern.console.rmenu.mode = (1ULL << MODE_EXIT);
g_extern.lifecycle_menu_state = (1 << MODE_EXIT);
break;
case S_RETURN_TO_MENU:
g_extern.console.rmenu.mode = (1ULL << MODE_MENU);
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
break;
case S_ROTATION_DECREMENT:
if(g_extern.console.screen.orientation > 0)
@ -112,7 +112,7 @@ void rarch_settings_change(unsigned setting)
g_extern.console.screen.orientation++;
break;
case S_START_RARCH:
g_extern.console.rmenu.mode = (1ULL << MODE_INIT);
g_extern.lifecycle_menu_state = (1 << MODE_INIT);
break;
case S_REWIND:
g_settings.rewind_enable = !g_settings.rewind_enable;

View File

@ -268,7 +268,7 @@ int main(int argc, char *argv[])
system_process_args(argc, argv);
begin_loop:
if(g_extern.console.rmenu.mode & (1ULL << MODE_EMULATION))
if(g_extern.lifecycle_menu_state & (1 << MODE_EMULATION))
{
driver.input->poll(NULL);
driver.video->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
@ -276,7 +276,7 @@ begin_loop:
while(rarch_main_iterate());
audio_stop_func();
}
else if (g_extern.console.rmenu.mode & (1ULL << MODE_INIT))
else if (g_extern.lifecycle_menu_state & (1 << MODE_INIT))
{
if(g_extern.main_is_init)
rarch_main_deinit();
@ -295,16 +295,16 @@ begin_loop:
if (init_ret == 0)
{
RARCH_LOG("rarch_main_init succeeded.\n");
g_extern.console.rmenu.mode = (1ULL << MODE_EMULATION);
g_extern.lifecycle_menu_state = (1 << MODE_EMULATION);
}
else
{
RARCH_ERR("rarch_main_init failed.\n");
g_extern.console.rmenu.mode = (1ULL << MODE_MENU);
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
rarch_settings_msg(S_MSG_ROM_LOADING_ERROR, S_DELAY_180);
}
}
else if(g_extern.console.rmenu.mode & (1ULL << MODE_MENU))
else if(g_extern.lifecycle_menu_state & (1 << MODE_MENU))
while(rmenu_iterate());
else
goto begin_shutdown;

View File

@ -2340,21 +2340,21 @@ void rmenu_input_process(void *data, void *state)
(void)data;
rmenu_state_t *rstate = (rmenu_state_t*)state;
if (g_extern.console.rmenu.mode & (1ULL << MODE_LOAD_GAME))
if (g_extern.lifecycle_menu_state & (1 << MODE_LOAD_GAME))
{
if(g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_LOADING_ROM, 100);
g_extern.console.rmenu.mode = (1ULL << MODE_INIT);
g_extern.lifecycle_menu_state = (1 << MODE_INIT);
}
if (!(g_extern.frame_count < g_extern.delay_timer[0]))
{
bool rmenu_enable = (((rstate->old_state & (1ULL << RMENU_DEVICE_NAV_L3)) && (rstate->old_state & (1ULL << RMENU_DEVICE_NAV_R3)) && g_extern.main_is_init));
if (g_extern.console.rmenu.mode & (1ULL << MODE_MENU))
if (g_extern.lifecycle_menu_state & (1 << MODE_MENU))
if (rmenu_enable)
g_extern.console.rmenu.mode = (1ULL << MODE_EMULATION);
g_extern.lifecycle_menu_state = (1 << MODE_EMULATION);
}
}
@ -2486,10 +2486,10 @@ bool rmenu_iterate(void)
device_ptr->ctx_driver->set_blend(false);
if (quit)
g_extern.console.rmenu.mode = (1ULL << MODE_EXIT);
g_extern.lifecycle_menu_state = (1 << MODE_EXIT);
if((!(g_extern.console.rmenu.mode & (1ULL << MODE_MENU))
&& !(g_extern.console.rmenu.mode & (1ULL << MODE_LOAD_GAME))) ||
if((!(g_extern.lifecycle_menu_state & (1 << MODE_MENU))
&& !(g_extern.lifecycle_menu_state & (1 << MODE_LOAD_GAME))) ||
repeat == 0)
goto deinit;

View File

@ -156,7 +156,7 @@ void menu_init(void)
menu_framebuf, RGUI_WIDTH * sizeof(uint16_t),
NULL /* _binary_console_font_bmp_start */, bitmap_bin, folder_cb, NULL);
g_extern.console.rmenu.mode = (1ULL << MODE_MENU);
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
rgui_iterate(rgui, RGUI_ACTION_REFRESH);
}
@ -235,13 +235,13 @@ bool rmenu_iterate(void)
old_input_state = input_state;
if (g_extern.console.rmenu.mode & (1ULL << MODE_LOAD_GAME))
if (g_extern.lifecycle_menu_state & (1 << MODE_LOAD_GAME))
{
if(g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_LOADING_ROM, 100);
if (g_extern.fullpath)
g_extern.console.rmenu.mode = (1ULL << MODE_INIT);
g_extern.lifecycle_menu_state = (1 << MODE_INIT);
}
if (!(g_extern.frame_count < g_extern.delay_timer[0]))
@ -249,12 +249,12 @@ bool rmenu_iterate(void)
bool rmenu_enable = ((trigger_state & (1ULL << GX_DEVICE_NAV_MENU)) && g_extern.main_is_init);
bool quit_key_pressed = (trigger_state & (1ULL << GX_DEVICE_NAV_QUIT));
if (g_extern.console.rmenu.mode & (1ULL << MODE_MENU))
g_extern.console.rmenu.mode = quit_key_pressed ? (1ULL << MODE_EXIT) : rmenu_enable ? (1ULL << MODE_EMULATION) : (1ULL << MODE_MENU);
if (g_extern.lifecycle_menu_state & (1 << MODE_MENU))
g_extern.lifecycle_menu_state = quit_key_pressed ? (1 << MODE_EXIT) : rmenu_enable ? (1 << MODE_EMULATION) : (1 << MODE_MENU);
}
if(!(g_extern.console.rmenu.mode & (1ULL << MODE_MENU))
&& !(g_extern.console.rmenu.mode & (1ULL << MODE_LOAD_GAME)))
if(!(g_extern.lifecycle_menu_state & (1 << MODE_MENU))
&& !(g_extern.lifecycle_menu_state & (1 << MODE_LOAD_GAME)))
goto deinit;
return true;

View File

@ -1116,7 +1116,7 @@ void menu_init (void)
browser = (filebrowser_t*)filebrowser_init(default_paths.filebrowser_startup_dir, g_extern.system.valid_extensions);
tmp_browser = (filebrowser_t*)filebrowser_init(default_paths.filebrowser_startup_dir, "");
g_extern.console.rmenu.mode = (1ULL << MODE_MENU);
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
}
void menu_free (void)
@ -1182,13 +1182,13 @@ bool rmenu_iterate(void)
XINPUT_STATE state;
XInputGetState(0, &state);
if (g_extern.console.rmenu.mode & (1ULL << MODE_LOAD_GAME))
if (g_extern.lifecycle_menu_state & (1 << MODE_LOAD_GAME))
{
if(g_extern.console.rmenu.state.msg_info.enable)
rarch_settings_msg(S_MSG_LOADING_ROM, 100);
if (g_extern.fullpath)
g_extern.console.rmenu.mode = (1ULL << MODE_INIT);
g_extern.lifecycle_menu_state = (1 << MODE_INIT);
}
@ -1198,9 +1198,9 @@ bool rmenu_iterate(void)
&& (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.main_is_init));
if (g_extern.console.rmenu.mode & (1ULL << MODE_MENU))
if (g_extern.lifecycle_menu_state & (1 << MODE_MENU))
if (rmenu_enable)
g_extern.console.rmenu.mode = (1ULL << MODE_EMULATION);
g_extern.lifecycle_menu_state = (1 << MODE_EMULATION);
}
rarch_render_cached_frame();
@ -1227,8 +1227,8 @@ bool rmenu_iterate(void)
device_ptr->ctx_driver->swap_buffers();
if(!(g_extern.console.rmenu.mode & (1ULL << MODE_MENU))
&& !(g_extern.console.rmenu.mode & (1ULL << MODE_LOAD_GAME)))
if(!(g_extern.lifecycle_menu_state & (1 << MODE_MENU))
&& !(g_extern.lifecycle_menu_state & (1 << MODE_LOAD_GAME)))
goto deinit;
return true;

View File

@ -382,7 +382,7 @@ static void system_process_args(int argc, char *argv[])
rarch_render_cached_frame();
g_extern.draw_menu = false;
g_extern.console.rmenu.mode = (1ULL << MODE_INIT);
g_extern.lifecycle_menu_state = (1 << MODE_INIT);
}
else
g_extern.console.external_launch.support = EXTERN_LAUNCHER_SALAMANDER;

View File

@ -387,7 +387,7 @@ static void system_process_args(int argc, char *argv[])
switch(g_extern.console.external_launch.support)
{
case EXTERN_LAUNCHER_SALAMANDER:
g_extern.console.rmenu.mode = (1ULL << MODE_MENU);
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
break;
#ifdef HAVE_MULTIMAN
case EXTERN_LAUNCHER_MULTIMAN:

View File

@ -94,7 +94,7 @@ static int setup_callback(void)
void menu_init (void)
{
g_extern.console.rmenu.mode = (1ULL << MODE_MENU);
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
}
bool rmenu_iterate(void)
@ -103,7 +103,7 @@ bool rmenu_iterate(void)
snprintf(game_rom, sizeof(game_rom), "%s%s", default_paths.port_dir, "dkc.sfc");
RARCH_LOG("game ROM: %s\n", game_rom);
rarch_console_load_game_wrap(game_rom, 0);
g_extern.console.rmenu.mode = (1ULL << MODE_INIT);
g_extern.lifecycle_menu_state = (1 << MODE_INIT);
return false;
}

View File

@ -477,7 +477,6 @@ struct global
{
struct
{
unsigned mode;
unsigned input_loop;
float font_size;
@ -565,6 +564,7 @@ struct global
bool draw_menu;
uint64_t lifecycle_state;
unsigned lifecycle_menu_state;
struct
{

View File

@ -2782,7 +2782,7 @@ bool rarch_main_iterate(void)
if (g_extern.system.shutdown)
{
#ifdef HAVE_RMENU
g_extern.console.rmenu.mode = (1ULL << MODE_EXIT);
g_extern.lifecycle_menu_state = (1 << MODE_EXIT);
#endif
return false;
}
@ -2797,7 +2797,7 @@ bool rarch_main_iterate(void)
if (rmenu_enable || (g_extern.console.rmenu.state.ingame_menu.enable && !rmenu_enable))
{
g_extern.console.rmenu.mode = (1ULL << MODE_MENU);
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
g_extern.delay_timer[0] = g_extern.frame_count + 30;
}
#endif
@ -2849,7 +2849,7 @@ bool rarch_main_iterate(void)
{
g_extern.lifecycle_state &= ~(1ULL << RARCH_FRAMEADVANCE);
g_extern.console.rmenu.state.ingame_menu.enable = true;
g_extern.console.rmenu.mode = (1ULL << MODE_MENU);
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
return false;
}
#endif

View File

@ -294,7 +294,7 @@ void config_set_defaults(void)
g_extern.audio_data.mute = 0;
g_extern.verbose = true;
g_extern.console.rmenu.mode = (1ULL << MODE_MENU);
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
g_extern.console.rmenu.font_size = 1.0f;
g_extern.console.sound.mode = SOUND_MODE_NORMAL;
g_extern.console.screen.viewports.custom_vp.width = 0;