(Menu) Move MODE_LOAD_GAME mechanics to upper function rarch_main

This commit is contained in:
twinaphex 2013-04-28 15:00:37 +02:00
parent 05ac7919b1
commit 5aa4101620
11 changed files with 289 additions and 210 deletions

View File

@ -48,7 +48,44 @@ int main(int argc, char *argv[])
for (;;)
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_GAME))
if (g_extern.system.shutdown)
break;
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
{
char tmp[PATH_MAX];
char str[PATH_MAX];
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s...", tmp);
msg_queue_push(g_extern.msg_queue, str, 1, 1);
}
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
if (rgui->history)
{
rom_history_push(rgui->history,
g_extern.fullpath,
g_settings.libretro,
rgui->info.library_name);
}
// draw frame for loading message
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, rgui->frame_buf_show, MENU_TEXTURE_FULLSCREEN);
rarch_render_cached_frame();
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, false,
MENU_TEXTURE_FULLSCREEN);
#endif
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_GAME))
{
while ((g_extern.is_paused && !g_extern.is_oneshot) ? rarch_main_idle_iterate() : rarch_main_iterate());
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);

View File

@ -218,65 +218,102 @@ static void *android_app_entry(void *data)
menu_init();
begin_loop:
if(g_extern.lifecycle_mode_state & (1ULL << MODE_GAME))
for (;;)
{
driver.input->poll(NULL);
if (driver.video_poke->set_aspect_ratio)
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_THROTTLE_ENABLE))
audio_start_func();
// Main loop
while (rarch_main_iterate());
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_THROTTLE_ENABLE))
audio_stop_func();
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_INIT))
{
if (g_extern.main_is_init)
rarch_main_deinit();
struct rarch_main_wrap args = {0};
args.verbose = true;
args.config_path = g_extern.config_path;
args.sram_path = NULL;
args.state_path = NULL;
args.rom_path = g_extern.fullpath;
args.libretro_path = g_settings.libretro;
init_ret = rarch_main_init_wrap(&args);
if (init_ret == 0)
if (g_extern.system.shutdown)
break;
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
{
RARCH_LOG("rarch_main_init succeeded.\n");
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
{
char tmp[PATH_MAX];
char str[PATH_MAX];
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s...", tmp);
msg_queue_push(g_extern.msg_queue, str, 1, 1);
}
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
if (rgui->history)
{
rom_history_push(rgui->history,
g_extern.fullpath,
g_settings.libretro,
rgui->info.library_name);
}
// draw frame for loading message
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, rgui->frame_buf_show, MENU_TEXTURE_FULLSCREEN);
rarch_render_cached_frame();
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, false,
MENU_TEXTURE_FULLSCREEN);
#endif
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_GAME))
{
driver.input->poll(NULL);
if (driver.video_poke->set_aspect_ratio)
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_THROTTLE_ENABLE))
audio_start_func();
// Main loop
while (rarch_main_iterate());
if (g_extern.lifecycle_mode_state & (1ULL << MODE_VIDEO_THROTTLE_ENABLE))
audio_stop_func();
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_INIT))
{
if (g_extern.main_is_init)
rarch_main_deinit();
struct rarch_main_wrap args = {0};
args.verbose = true;
args.config_path = g_extern.config_path;
args.sram_path = NULL;
args.state_path = NULL;
args.rom_path = g_extern.fullpath;
args.libretro_path = g_settings.libretro;
init_ret = rarch_main_init_wrap(&args);
if (init_ret == 0)
{
RARCH_LOG("rarch_main_init succeeded.\n");
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
}
else
{
RARCH_ERR("rarch_main_init failed.\n");
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU);
}
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INIT);
}
else if(g_extern.lifecycle_mode_state & (1ULL << MODE_MENU))
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_PREINIT);
while((input_key_pressed_func(RARCH_PAUSE_TOGGLE)) ?
android_run_events(android_app) : menu_iterate());
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU);
}
else
{
RARCH_ERR("rarch_main_init failed.\n");
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU);
}
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INIT);
break;
}
else if(g_extern.lifecycle_mode_state & (1ULL << MODE_MENU))
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_PREINIT);
while((input_key_pressed_func(RARCH_PAUSE_TOGGLE)) ?
android_run_events(android_app) : menu_iterate());
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU);
}
else
goto exit;
goto begin_loop;
exit:
android_app->activityState = APP_CMD_DEAD;

View File

@ -48,6 +48,41 @@ int rarch_main(int argc, char *argv[])
{
if (g_extern.system.shutdown)
break;
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
{
char tmp[PATH_MAX];
char str[PATH_MAX];
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s...", tmp);
msg_queue_push(g_extern.msg_queue, str, 1, 1);
}
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
if (rgui->history)
{
rom_history_push(rgui->history,
g_extern.fullpath,
g_settings.libretro,
rgui->info.library_name);
}
// draw frame for loading message
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, rgui->frame_buf_show, MENU_TEXTURE_FULLSCREEN);
rarch_render_cached_frame();
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, false,
MENU_TEXTURE_FULLSCREEN);
#endif
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_GAME))
{
while ((g_extern.is_paused && !g_extern.is_oneshot) ? rarch_main_idle_iterate() : rarch_main_iterate());

View File

@ -142,6 +142,41 @@ int rarch_main(int argc, char *argv[])
{
if (g_extern.system.shutdown)
break;
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
{
char tmp[PATH_MAX];
char str[PATH_MAX];
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s...", tmp);
msg_queue_push(g_extern.msg_queue, str, 1, 1);
}
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
if (rgui->history)
{
rom_history_push(rgui->history,
g_extern.fullpath,
g_settings.libretro,
rgui->info.library_name);
}
// draw frame for loading message
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, rgui->frame_buf_show, MENU_TEXTURE_FULLSCREEN);
rarch_render_cached_frame();
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, false,
MENU_TEXTURE_FULLSCREEN);
#endif
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_GAME))
{
driver.input->poll(NULL);

View File

@ -100,6 +100,41 @@ void* rarch_main_ios(void* args)
{
if (g_extern.system.shutdown)
break;
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
{
char tmp[PATH_MAX];
char str[PATH_MAX];
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s...", tmp);
msg_queue_push(g_extern.msg_queue, str, 1, 1);
}
#if defined(HAVE_RGUI) || defined(HAVE_RMENU) || defined(HAVE_RMENU_XUI)
if (rgui->history)
{
rom_history_push(rgui->history,
g_extern.fullpath,
g_settings.libretro,
rgui->info.library_name);
}
// draw frame for loading message
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, rgui->frame_buf_show, MENU_TEXTURE_FULLSCREEN);
rarch_render_cached_frame();
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, false,
MENU_TEXTURE_FULLSCREEN);
#endif
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
}
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_GAME))
{
while ((g_extern.is_paused && !g_extern.is_oneshot) ? rarch_main_idle_iterate() : rarch_main_iterate())

View File

@ -497,13 +497,6 @@ bool menu_iterate(void)
rgui->old_input_state = input_state;
input_entry_ret = rgui_iterate(rgui);
#ifdef HAVE_RGUI
#define MENU_TEXTURE_FULLSCREEN false
#else
#define MENU_TEXTURE_FULLSCREEN true
#endif
// draw last frame for loading messages
if (driver.video_poke && driver.video_poke->set_texture_enable)
driver.video_poke->set_texture_enable(driver.video_data, rgui->frame_buf_show, MENU_TEXTURE_FULLSCREEN);

View File

@ -17,6 +17,12 @@
#ifndef MENU_COMMON_H__
#define MENU_COMMON_H__
#ifdef HAVE_RGUI
#define MENU_TEXTURE_FULLSCREEN false
#else
#define MENU_TEXTURE_FULLSCREEN true
#endif
#ifndef __cplusplus
#include <stdbool.h>
#else

View File

@ -2205,12 +2205,7 @@ int rgui_iterate(rgui_handle_t *rgui)
// Dunno what to do for Wii here ...
strlcpy(g_extern.fullpath, path, sizeof(g_extern.fullpath));
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
rom_history_push(rgui->history,
g_extern.fullpath,
g_settings.libretro,
rgui->info.library_name);
rgui->need_refresh = true;
ret = -1;
@ -2218,27 +2213,8 @@ int rgui_iterate(rgui_handle_t *rgui)
else
{
fill_pathname_join(g_extern.fullpath, dir, path, sizeof(g_extern.fullpath));
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
{
char tmp[PATH_MAX];
char str[PATH_MAX];
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s ...", tmp);
msg_queue_push(g_extern.msg_queue, str, 1, 1);
}
if (rgui->history)
{
rom_history_push(rgui->history,
g_extern.fullpath,
g_settings.libretro,
rgui->info.library_name);
}
rgui->need_refresh = true; // in case of zip extract
rgui->msg_force = true;
ret = -1;
@ -2343,15 +2319,6 @@ int rgui_input_postprocess(void *data, uint64_t old_state)
int ret = 0;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
{
if (g_extern.fullpath)
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);
ret = -1;
}
if ((rgui->trigger_state & (1ULL << DEVICE_NAV_MENU)) &&
g_extern.main_is_init &&
!g_extern.libretro_dummy)

View File

@ -243,11 +243,11 @@ static void menu_stack_pop(unsigned menu_type)
case INGAME_MENU_SCREENSHOT:
rgui->frame_buf_show = true;
break;
#ifdef HAVE_SHADER_MANAGER
case INGAME_MENU_SHADER_MANAGER:
case INGAME_MENU_VIDEO_OPTIONS:
selected = FIRST_INGAME_MENU_SETTING;
rgui->frame_buf_show = true;
break;
#ifdef HAVE_SHADER_MANAGER
case CGP_CHOICE:
selected = FIRST_SHADERMAN_SETTING;
break;
@ -279,11 +279,9 @@ static void menu_stack_push(unsigned menu_type, bool prev_dir)
case INGAME_MENU:
selected = FIRST_INGAME_MENU_SETTING;
break;
#ifdef HAVE_SHADER_MANAGER
case INGAME_MENU_SHADER_MANAGER:
case INGAME_MENU_VIDEO_OPTIONS:
selected = FIRST_SHADERMAN_SETTING;
break;
#endif
case GENERAL_VIDEO_MENU:
selected = FIRST_VIDEO_SETTING;
break;
@ -364,9 +362,7 @@ static void display_menubar(uint8_t menu_type)
break;
case CONTROLS_MENU:
case INGAME_MENU_CORE_OPTIONS:
#ifdef HAVE_SHADER_MANAGER
case INGAME_MENU_SHADER_MANAGER:
#endif
case INGAME_MENU_VIDEO_OPTIONS:
case INGAME_MENU_RESIZE:
if (driver.input->set_keybinds)
driver.input->set_keybinds(&key_label_l, 0, 0, 0, (1ULL << KEYBINDS_ACTION_GET_BIND_LABEL));
@ -414,11 +410,9 @@ static void display_menubar(uint8_t menu_type)
case INGAME_MENU_CORE_OPTIONS:
strlcpy(title, "Core Options", sizeof(title));
break;
#ifdef HAVE_SHADER_MANAGER
case INGAME_MENU_SHADER_MANAGER:
strlcpy(title, "ShaderMan", sizeof(title));
case INGAME_MENU_VIDEO_OPTIONS:
strlcpy(title, "Video Options", sizeof(title));
break;
#endif
case INGAME_MENU_RESIZE:
strlcpy(title, "Resize Menu", sizeof(title));
break;
@ -1010,7 +1004,7 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
if (input & (1ULL << DEVICE_NAV_START))
g_settings.video.font_size = 1.0f;
break;
case INGAME_MENU_ASPECT_RATIO:
case SETTING_ASPECT_RATIO:
if (input & (1ULL << DEVICE_NAV_LEFT))
{
settings_set(1ULL << S_ASPECT_RATIO_DECREMENT);
@ -1231,17 +1225,6 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
if (input & (1ULL << DEVICE_NAV_START))
g_settings.rewind_granularity = 1;
break;
case SETTING_RARCH_DEFAULT_EMU:
if ((input & (1ULL << DEVICE_NAV_LEFT)) || (input & (1ULL << DEVICE_NAV_RIGHT)) || (input & (1ULL << DEVICE_NAV_B)))
{
menu_stack_push(LIBRETRO_CHOICE, true);
filebrowser_set_root_and_ext(rgui->browser, EXT_EXECUTABLES, default_paths.core_dir);
set_libretro_core_as_launch = true;
}
if (input & (1ULL << DEVICE_NAV_START))
{
}
break;
case SETTING_QUIT_RARCH:
if ((input & (1ULL << DEVICE_NAV_LEFT)) || (input & (1ULL << DEVICE_NAV_RIGHT)) || (input & (1ULL << DEVICE_NAV_B)) || (input & (1ULL << DEVICE_NAV_B)))
{
@ -1558,7 +1541,7 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
rarch_state_slot_increase();
break;
case INGAME_MENU_ROTATION:
case SETTING_ROTATION:
if (input & (1ULL << DEVICE_NAV_LEFT))
{
settings_set(1ULL << S_ROTATION_DECREMENT);
@ -1654,10 +1637,10 @@ static int set_setting_action(uint8_t menu_type, unsigned switchvalue, uint64_t
}
break;
#ifdef HAVE_SHADER_MANAGER
case INGAME_MENU_SHADER_MANAGER_MODE:
case INGAME_MENU_VIDEO_OPTIONS_MODE:
if (input & (1ULL << DEVICE_NAV_B))
{
menu_stack_push(INGAME_MENU_SHADER_MANAGER, false);
menu_stack_push(INGAME_MENU_VIDEO_OPTIONS, false);
}
break;
case SHADERMAN_LOAD_CGP:
@ -1862,14 +1845,14 @@ static int select_setting(void *data, uint64_t input)
first_setting = FIRST_INGAME_MENU_SETTING;
max_settings = MAX_NO_OF_INGAME_MENU_SETTINGS;
break;
#ifdef HAVE_SHADER_MANAGER
case INGAME_MENU_SHADER_MANAGER:
case INGAME_MENU_VIDEO_OPTIONS:
first_setting = FIRST_SHADERMAN_SETTING;
max_settings = MAX_NO_OF_SHADERMAN_SETTINGS;
#ifdef HAVE_SHADER_MANAGER
switch (rgui->shader.passes)
{
case 0:
max_settings = MAX_NO_OF_SHADERMAN_SETTINGS;
break;
case 1:
max_settings = SHADERMAN_SHADER_0_SCALE+1;
@ -1896,8 +1879,8 @@ static int select_setting(void *data, uint64_t input)
max_settings = SHADERMAN_SHADER_7_SCALE+1;
break;
}
break;
#endif
break;
}
float y_increment = POSITION_Y_START;
@ -1952,17 +1935,17 @@ static int select_setting(void *data, uint64_t input)
break;
#ifndef HAVE_SHADER_MANAGER
case SETTING_HW_TEXTURE_FILTER:
strlcpy(text, "Hardware filtering", sizeof(text));
strlcpy(text, "Default Filter", sizeof(text));
if (g_settings.video.smooth)
{
strlcpy(setting_text, "Bilinear", sizeof(setting_text));
strlcpy(comment, "INFO - Hardware filtering is set to Bilinear.",
strlcpy(setting_text, "Linear", sizeof(setting_text));
strlcpy(comment, "INFO - Default Filter is set to Linear.",
sizeof(comment));
}
else
{
strlcpy(setting_text, "Point", sizeof(setting_text));
strlcpy(comment, "INFO - Hardware filtering is set to Point.",
strlcpy(setting_text, "Nearest", sizeof(setting_text));
strlcpy(comment, "INFO - Default Filter is set to Nearest.",
sizeof(comment));
}
break;
@ -2071,12 +2054,6 @@ static int select_setting(void *data, uint64_t input)
snprintf(setting_text, sizeof(setting_text), "%d", g_settings.rewind_granularity);
strlcpy(comment, "INFO - Set the amount of frames to 'rewind'.", sizeof(comment));
break;
case SETTING_RARCH_DEFAULT_EMU:
strlcpy(text, "Default libretro core", sizeof(text));
fill_pathname_base(fname, g_settings.libretro, sizeof(fname));
strlcpy(setting_text, fname, sizeof(setting_text));
strlcpy(comment, "INFO - Select a default libretro core.", sizeof(comment));
break;
case SETTING_QUIT_RARCH:
strlcpy(text, "Quit RetroArch and save settings ", sizeof(text));
strlcpy(setting_text, "", sizeof(setting_text));
@ -2244,12 +2221,12 @@ static int select_setting(void *data, uint64_t input)
snprintf(setting_text, sizeof(setting_text), "%d", g_extern.state_slot);
strlcpy(comment, "Save to current state slot.", sizeof(comment));
break;
case INGAME_MENU_ASPECT_RATIO:
case SETTING_ASPECT_RATIO:
strlcpy(text, "Aspect Ratio", sizeof(text));
strlcpy(setting_text, aspectratio_lut[g_settings.video.aspect_ratio_idx].name, sizeof(setting_text));
strlcpy(comment, "Change the aspect ratio of the screen.", sizeof(comment));
break;
case INGAME_MENU_ROTATION:
case SETTING_ROTATION:
strlcpy(text, "Rotation", sizeof(text));
strlcpy(setting_text, rotation_lut[g_extern.console.screen.orientation], sizeof(setting_text));
strlcpy(comment, "Change orientation of the screen.", sizeof(comment));
@ -2264,13 +2241,11 @@ static int select_setting(void *data, uint64_t input)
strlcpy(setting_text, "", sizeof(setting_text));
strlcpy(comment, "Set core-specific options.", sizeof(comment));
break;
#ifdef HAVE_SHADER_MANAGER
case INGAME_MENU_SHADER_MANAGER_MODE:
strlcpy(text, "Shader Manager...", sizeof(text));
case INGAME_MENU_VIDEO_OPTIONS_MODE:
strlcpy(text, "Video Options...", sizeof(text));
strlcpy(setting_text, "", sizeof(setting_text));
strlcpy(comment, "Set and manage shader options.", sizeof(comment));
strlcpy(comment, "Set and manage video options.", sizeof(comment));
break;
#endif
case INGAME_MENU_FRAME_ADVANCE:
strlcpy(text, "Frame Advance", sizeof(text));
strlcpy(setting_text, "", sizeof(setting_text));
@ -2494,9 +2469,7 @@ static int select_setting(void *data, uint64_t input)
{
if (rgui->menu_type != CONTROLS_MENU
#ifdef HAVE_SHADER_MANAGER
|| rgui->menu_type != INGAME_MENU_SHADER_MANAGER
#endif
|| rgui->menu_type != INGAME_MENU_VIDEO_OPTIONS
|| rgui->menu_type != INGAME_MENU
)
menu_stack_push(rgui->menu_type + 1, false);
@ -2542,6 +2515,7 @@ static int select_rom(void *data, uint64_t input)
strlcpy(g_extern.fullpath,
rgui->browser->current_dir.path, sizeof(g_extern.fullpath));
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
return -1;
}
}
else if (input & (1ULL << DEVICE_NAV_L1))
@ -3035,23 +3009,6 @@ int rgui_input_postprocess(void *data, uint64_t old_state)
DEVICE_CAST device_ptr = (DEVICE_CAST)driver.video_data;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
{
char tmp[PATH_MAX];
char str[PATH_MAX];
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s...", tmp);
msg_queue_push(g_extern.msg_queue, str, 1, 1);
}
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);
ret = -1;
}
if ((rgui->trigger_state & (1ULL << DEVICE_NAV_MENU)) &&
g_extern.main_is_init)
{
@ -3140,9 +3097,7 @@ int rgui_iterate(rgui_handle_t *rgui)
case PATH_MENU:
case CONTROLS_MENU:
case INGAME_MENU:
#ifdef HAVE_SHADER_MANAGER
case INGAME_MENU_SHADER_MANAGER:
#endif
case INGAME_MENU_VIDEO_OPTIONS:
return select_setting(rgui, rgui->trigger_state);
}

View File

@ -65,9 +65,7 @@ enum
INGAME_MENU,
INGAME_MENU_RESIZE,
INGAME_MENU_CORE_OPTIONS,
#ifdef HAVE_SHADER_MANAGER
INGAME_MENU_SHADER_MANAGER,
#endif
INGAME_MENU_VIDEO_OPTIONS,
INGAME_MENU_SCREENSHOT,
};
@ -75,18 +73,7 @@ enum
#ifndef HAVE_RMENU_XUI
enum
{
#ifdef __CELLOS_LV2__
SETTING_CHANGE_RESOLUTION,
SETTING_PAL60_MODE,
#endif
SETTING_FONT_SIZE,
#ifndef HAVE_SHADER_MANAGER
SETTING_HW_TEXTURE_FILTER,
#endif
#ifdef _XBOX1
SETTING_FLICKER_FILTER,
SETTING_SOFT_DISPLAY_FILTER,
#endif
SETTING_REFRESH_RATE,
SETTING_THROTTLE_MODE,
SETTING_TRIPLE_BUFFERING,
@ -101,7 +88,6 @@ enum
SETTING_EMU_SHOW_DEBUG_INFO_MSG,
SETTING_EMU_SHOW_INFO_MSG,
SETTING_EMU_SKIN,
SETTING_RARCH_DEFAULT_EMU,
SETTING_QUIT_RARCH,
SETTING_EMU_DEFAULT_ALL,
SETTING_EMU_REWIND_ENABLED,
@ -147,23 +133,30 @@ enum
INGAME_MENU_CHANGE_LIBRETRO_CORE,
INGAME_MENU_CORE_OPTIONS_MODE,
INGAME_MENU_CHANGE_GAME,
#ifdef HAVE_SHADER_MANAGER
INGAME_MENU_SHADER_MANAGER_MODE,
#endif
INGAME_MENU_VIDEO_OPTIONS_MODE,
INGAME_MENU_SETTINGS,
INGAME_MENU_LOAD_STATE,
INGAME_MENU_SAVE_STATE,
INGAME_MENU_SCREENSHOT_MODE,
INGAME_MENU_RETURN_TO_GAME,
INGAME_MENU_RESET,
INGAME_MENU_ASPECT_RATIO,
INGAME_MENU_RESIZE_MODE,
INGAME_MENU_ROTATION,
INGAME_MENU_FRAME_ADVANCE,
#ifdef HAVE_MULTIMAN
INGAME_MENU_RETURN_TO_MULTIMAN,
#endif
INGAME_MENU_QUIT_RETROARCH,
#ifdef __CELLOS_LV2__
SETTING_CHANGE_RESOLUTION,
SETTING_PAL60_MODE,
#endif
SETTING_HW_TEXTURE_FILTER,
#ifdef _XBOX1
SETTING_FLICKER_FILTER,
SETTING_SOFT_DISPLAY_FILTER,
#endif
SETTING_ASPECT_RATIO,
SETTING_ROTATION,
#ifdef HAVE_SHADER_MANAGER
SHADERMAN_AUTOSTART_CGP_ON_STARTUP,
SHADERMAN_LOAD_CGP,
@ -194,9 +187,13 @@ enum
SHADERMAN_SHADER_7,
SHADERMAN_SHADER_7_FILTER,
SHADERMAN_SHADER_7_SCALE,
SHADERMAN_SHADER_LAST = SHADERMAN_SHADER_0_SCALE + (3 * (RGUI_MAX_SHADERS - 1)),
SHADERMAN_LAST,
#endif
#ifdef HAVE_SHADER_MANAGER
SHADERMAN_SHADER_LAST = SHADERMAN_SHADER_0_SCALE + (3 * (RGUI_MAX_SHADERS - 1)),
#else
SHADERMAN_SHADER_LAST = SETTING_ROTATION,
#endif
SHADERMAN_LAST,
SETTING_LAST_LAST,
};
#endif
@ -210,9 +207,7 @@ enum
#define FIRST_CONTROLS_SETTING_PAGE_1 SETTING_PATH_DEFAULT_ALL+1
#define FIRST_CONTROL_BIND SETTING_CONTROLS_RETRO_DEVICE_ID_JOYPAD_B
#define FIRST_INGAME_MENU_SETTING SETTING_LAST+1
#ifdef HAVE_SHADER_MANAGER
#define FIRST_SHADERMAN_SETTING INGAME_MENU_QUIT_RETROARCH+1
#endif
#define MAX_NO_OF_VIDEO_SETTINGS SETTING_DEFAULT_VIDEO_ALL+1
#define MAX_NO_OF_AUDIO_SETTINGS SETTING_DEFAULT_AUDIO_ALL+1

View File

@ -714,9 +714,10 @@ HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
wcstombs(str_buffer, (const wchar_t *)XuiListGetText(m_list, index), sizeof(str_buffer));
if (path_file_exists(rgui->browser->list->elems[index].data))
{
snprintf(path, sizeof(path), "%s\\%s", rgui->browser->current_dir.directory_path, str_buffer);
strlcpy(g_extern.fullpath, path, sizeof(g_extern.fullpath));
snprintf(g_extern.fullpath, sizeof(g_extern.fullpath), "%s\\%s",
rgui->browser->current_dir.directory_path, str_buffer);
g_extern.lifecycle_mode_state |= (1ULL << MODE_LOAD_GAME);
process_input_ret = -1;
}
else if(rgui->browser->list->elems[index].attr.b)
{
@ -1735,23 +1736,6 @@ bool menu_iterate(void)
XINPUT_STATE state;
XInputGetState(0, &state);
if (g_extern.lifecycle_mode_state & (1ULL << MODE_LOAD_GAME))
{
if (g_extern.lifecycle_mode_state & (1ULL << MODE_INFO_DRAW))
{
char tmp[PATH_MAX];
char str[PATH_MAX];
fill_pathname_base(tmp, g_extern.fullpath, sizeof(tmp));
snprintf(str, sizeof(str), "INFO - Loading %s...", tmp);
msg_queue_push(g_extern.msg_queue, str, 1, 1);
}
g_extern.lifecycle_mode_state |= (1ULL << MODE_INIT);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_LOAD_GAME);
process_input_ret = -1;
}
/* FIXME - hack for now */
if (rgui->delay_count > 30)
{