(RARCH_CONSOLE) Refactored out msg_info

This commit is contained in:
twinaphex 2013-01-11 07:49:32 +01:00
parent ca3be92255
commit 33a2816681
10 changed files with 86 additions and 60 deletions

View File

@ -225,7 +225,7 @@ void rarch_console_load_game_wrap(const char *path, unsigned extract_zip_mode)
first_file[0] = '\0';
rarch_extract_zipfile(path, first_file, sizeof(first_file), extract_zip_mode);
if(g_extern.console.rmenu.state.msg_info.enable)
if(g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_EXTRACTED_ZIPFILE, S_DELAY_180);
if(g_extern.file_state.zip_extract_mode == ZIP_EXTRACT_TO_CURRENT_DIR_AND_LOAD_FIRST_FILE)

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.lifecycle_menu_state = (1 << MODE_EMULATION);
g_extern.lifecycle_menu_state |= (1 << MODE_EMULATION);
break;
case S_HW_TEXTURE_FILTER:
g_settings.video.smooth = !g_settings.video.smooth;

View File

@ -291,7 +291,7 @@ static void populate_setting_item(void *data, unsigned input)
break;
case SETTING_EMU_SHOW_INFO_MSG:
snprintf(current_item->text, sizeof(current_item->text), "Info messages");
snprintf(current_item->setting_text, sizeof(current_item->setting_text), g_extern.console.rmenu.state.msg_info.enable ? "ON" : "OFF");
snprintf(current_item->setting_text, sizeof(current_item->setting_text), (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW)) ? "ON" : "OFF");
snprintf(current_item->comment, sizeof(current_item->comment), "INFO - Show onscreen info messages in the menu.");
break;
case SETTING_EMU_REWIND_ENABLED:
@ -671,7 +671,7 @@ int select_file(void *data, void *state)
if (g_settings.video.shader_type != RARCH_SHADER_NONE)
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, path, RARCH_SHADER_INDEX_PASS0);
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
}
else
@ -687,7 +687,7 @@ int select_file(void *data, void *state)
if (g_settings.video.shader_type != RARCH_SHADER_NONE)
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, path, RARCH_SHADER_INDEX_PASS1);
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
}
else
@ -724,7 +724,7 @@ int select_file(void *data, void *state)
}
else
{
if(g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
}
break;
@ -1088,7 +1088,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
if (g_settings.video.shader_type != RARCH_SHADER_NONE)
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, NULL, RARCH_SHADER_INDEX_PASS0);
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
}
else
@ -1108,7 +1108,7 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
if (g_settings.video.shader_type != RARCH_SHADER_NONE)
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, NULL, RARCH_SHADER_INDEX_PASS1);
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
}
else
@ -1377,16 +1377,21 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
break;
case SETTING_EMU_SHOW_INFO_MSG:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
g_extern.console.rmenu.state.msg_info.enable = !g_extern.console.rmenu.state.msg_info.enable;
{
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
g_extern.lifecycle_menu_state &= ~(1 << MODE_INFO_DRAW);
else
g_extern.lifecycle_menu_state |= (1 << MODE_INFO_DRAW);
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
g_extern.console.rmenu.state.msg_info.enable = true;
g_extern.lifecycle_menu_state |= (1 << MODE_INFO_DRAW);
break;
case SETTING_EMU_REWIND_ENABLED:
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
rarch_settings_change(S_REWIND);
if(g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
@ -1439,14 +1444,14 @@ static int set_setting_action(void *data, unsigned switchvalue, uint64_t input)
if((input & (1ULL << RMENU_DEVICE_NAV_LEFT)) || (input & (1ULL << RMENU_DEVICE_NAV_RIGHT)) || (input & (1ULL << RMENU_DEVICE_NAV_B)))
{
g_extern.console.sound.volume_level = !g_extern.console.sound.volume_level;
if(g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
}
if(input & (1ULL << RMENU_DEVICE_NAV_START))
{
g_extern.console.sound.volume_level = 0;
if(g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
}
break;
@ -2203,7 +2208,7 @@ int ingame_menu(void *data, void *state)
if(input & (1ULL << RMENU_DEVICE_NAV_B))
{
rarch_game_reset();
g_extern.lifecycle_menu_state = (1 << MODE_EMULATION);
g_extern.lifecycle_menu_state |= (1 << MODE_EMULATION);
return -1;
}
snprintf(strw_buffer, sizeof(strw_buffer), "Press [%s] to reset the game.", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_B));
@ -2212,7 +2217,8 @@ int ingame_menu(void *data, void *state)
if(input & (1ULL << RMENU_DEVICE_NAV_B))
{
menu_idx = 0;
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
/* TODO */
g_extern.lifecycle_menu_state |= (1 << MODE_MENU);
return -1;
}
snprintf(strw_buffer, sizeof(strw_buffer), "Press [%s] to return to the ROM Browser.", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_B));
@ -2399,7 +2405,7 @@ int rmenu_input_process(void *data, void *state)
if (g_extern.lifecycle_menu_state & (1 << MODE_LOAD_GAME))
{
if(g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_LOADING_ROM, 100);
g_extern.lifecycle_menu_state |= (1 << MODE_INIT);
@ -2542,7 +2548,7 @@ bool rmenu_iterate(void)
msg = msg_queue_pull(g_extern.msg_queue);
if (msg && g_extern.console.rmenu.state.msg_info.enable)
if (msg && (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW)))
device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.msg_queue_x_position, default_pos.msg_queue_y_position, default_pos.msg_queue_font_size, WHITE, msg);
device_ptr->ctx_driver->swap_buffers();

View File

@ -156,7 +156,6 @@ void menu_init(void)
menu_framebuf, RGUI_WIDTH * sizeof(uint16_t),
NULL /* _binary_console_font_bmp_start */, bitmap_bin, folder_cb, NULL);
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
rgui_iterate(rgui, RGUI_ACTION_REFRESH);
}
@ -171,13 +170,12 @@ int rmenu_input_process(void *data, void *state)
{
if (g_extern.lifecycle_menu_state & (1 << MODE_LOAD_GAME))
{
if(g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_LOADING_ROM, 100);
if (g_extern.fullpath)
g_extern.lifecycle_menu_state = (1 << MODE_INIT);
g_extern.lifecycle_menu_state |= (1 << MODE_INIT);
g_extern.lifecycle_menu_state |= (1 << MODE_INIT);
g_extern.lifecycle_menu_state &= ~(1 << MODE_LOAD_GAME);
return -1;
}

View File

@ -205,7 +205,7 @@ HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
uint64_t action = (1ULL << RMENU_DEVICE_NAV_B);
filebrowser_fetch_directory_entries(browser, action, &m_romlist, &m_rompathtitle);
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_CACHE_PARTITION, S_DELAY_180);
}
#endif
@ -383,7 +383,7 @@ HRESULT CRetroArchSettings::OnInit(XUIMessageInit * pInitData, BOOL& bHandled)
GetChildById(L"XuiBackButton", &m_back);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW)) ? L"Info messages: ON" : L"Info messages: OFF");
m_settingslist.SetText(SETTING_EMU_SHOW_DEBUG_INFO_MSG, (g_extern.lifecycle_menu_state & (1 << MODE_FPS_DRAW)) ? L"Debug Info messages: ON" : L"Debug Info messages: OFF");
m_settingslist.SetText(SETTING_EMU_MENUS, g_extern.console.rmenu.state.rmenu_hd.enable ? L"Menus: HD" : L"Menus: SD");
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
@ -419,12 +419,15 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
rarch_settings_change(S_REWIND);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_EMU_SHOW_INFO_MSG:
g_extern.console.rmenu.state.msg_info.enable = !g_extern.console.rmenu.state.msg_info.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
g_extern.lifecycle_menu_state &= ~(1 << MODE_INFO_DRAW);
else
g_extern.lifecycle_menu_state |= (1 << MODE_INFO_DRAW);
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW)) ? L"Info messages: ON" : L"Info messages: OFF");
break;
case SETTING_EMU_SHOW_DEBUG_INFO_MSG:
if (g_extern.lifecycle_menu_state & (1 << MODE_FPS_DRAW))
@ -440,7 +443,7 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
case SETTING_GAMMA_CORRECTION_ENABLED:
g_extern.console.screen.gamma_correction = g_extern.console.screen.gamma_correction ? 0 : 1;
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_SHADER:
@ -452,7 +455,7 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
hCur = app.hShaderBrowser;
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_SELECT_SHADER, S_DELAY_180);
NavigateForward(app.hShaderBrowser);
@ -465,7 +468,7 @@ HRESULT CRetroArchSettings::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
hCur = app.hShaderBrowser;
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_SELECT_SHADER, S_DELAY_180);
NavigateForward(app.hShaderBrowser);
@ -518,12 +521,15 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
rarch_settings_change(S_REWIND);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_EMU_SHOW_INFO_MSG:
g_extern.console.rmenu.state.msg_info.enable = !g_extern.console.rmenu.state.msg_info.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
g_extern.lifecycle_menu_state &= ~(1 << MODE_INFO_DRAW);
else
g_extern.lifecycle_menu_state |= (1 << MODE_INFO_DRAW);
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW)) ? L"Info messages: ON" : L"Info messages: OFF");
break;
case SETTING_EMU_SHOW_DEBUG_INFO_MSG:
if (g_extern.lifecycle_menu_state & (1 << MODE_FPS_DRAW))
@ -539,7 +545,7 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
case SETTING_GAMMA_CORRECTION_ENABLED:
g_extern.console.screen.gamma_correction = g_extern.console.screen.gamma_correction ? 0 : 1;
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_SCALE_FACTOR:
@ -584,8 +590,11 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
switch(current_index)
{
case SETTING_EMU_SHOW_INFO_MSG:
g_extern.console.rmenu.state.msg_info.enable = !g_extern.console.rmenu.state.msg_info.enable;
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, g_extern.console.rmenu.state.msg_info.enable ? L"Info messages: ON" : L"Info messages: OFF");
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
g_extern.lifecycle_menu_state &= ~(1 << MODE_INFO_DRAW);
else
g_extern.lifecycle_menu_state |= (1 << MODE_INFO_DRAW);
m_settingslist.SetText(SETTING_EMU_SHOW_INFO_MSG, (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW)) ? L"Info messages: ON" : L"Info messages: OFF");
break;
case SETTING_EMU_SHOW_DEBUG_INFO_MSG:
if (g_extern.lifecycle_menu_state & (1 << MODE_FPS_DRAW))
@ -601,14 +610,14 @@ HRESULT CRetroArchSettings::OnControlNavigate(XUIMessageControlNavigate *pContro
case SETTING_GAMMA_CORRECTION_ENABLED:
g_extern.console.screen.gamma_correction = g_extern.console.screen.gamma_correction ? 0 : 1;
m_settingslist.SetText(SETTING_GAMMA_CORRECTION_ENABLED, g_extern.console.screen.gamma_correction ? L"Gamma correction: ON" : L"Gamma correction: OFF");
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_EMU_REWIND_ENABLED:
rarch_settings_change(S_REWIND);
m_settingslist.SetText(SETTING_EMU_REWIND_ENABLED, g_settings.rewind_enable ? L"Rewind: ON" : L"Rewind: OFF");
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESTART_RARCH, S_DELAY_180);
break;
case SETTING_SCALE_FACTOR:
@ -815,7 +824,7 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
m_quickmenulist.SetText(MENU_ITEM_KEEP_ASPECT_RATIO, strw_buffer);
break;
case MENU_ITEM_OVERSCAN_AMOUNT:
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_NOT_IMPLEMENTED, S_DELAY_180);
break;
case MENU_ITEM_ORIENTATION:
@ -827,7 +836,7 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
case MENU_ITEM_RESIZE_MODE:
g_extern.console.rmenu.input_loop = INPUT_LOOP_RESIZE_MODE;
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_RESIZE_SCREEN, S_DELAY_270);
break;
case MENU_ITEM_FRAME_ADVANCE:
@ -839,7 +848,7 @@ HRESULT CRetroArchQuickMenu::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled
}
break;
case MENU_ITEM_SCREENSHOT_MODE:
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
device_ptr->ctx_driver->rmenu_screenshot_dump(NULL);
break;
case MENU_ITEM_RESET:
@ -901,7 +910,7 @@ HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHand
if (g_settings.video.shader_type != RARCH_SHADER_NONE)
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, g_settings.video.cg_shader_path, RARCH_SHADER_INDEX_PASS0);
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
}
else
@ -915,7 +924,7 @@ HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHand
if (g_settings.video.shader_type != RARCH_SHADER_NONE)
{
driver.video->set_shader(driver.video_data, (enum rarch_shader_type)g_settings.video.shader_type, g_settings.video.second_pass_shader, RARCH_SHADER_INDEX_PASS1);
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_SHADER_LOADING_SUCCEEDED, S_DELAY_180);
}
else
@ -1039,7 +1048,7 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
hCur = app.hControlsMenu;
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_CHANGE_CONTROLS, S_DELAY_180);
NavigateForward(app.hControlsMenu);
@ -1052,7 +1061,7 @@ HRESULT CRetroArchMain::OnNotifyPress( HXUIOBJ hObjPressed, int & bHandled )
RARCH_ERR("Failed to load scene.\n");
hCur = app.hCoreBrowser;
if (g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_SELECT_LIBRETRO_CORE, S_DELAY_180);
NavigateForward(app.hCoreBrowser);
@ -1141,8 +1150,6 @@ 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.lifecycle_menu_state = (1 << MODE_MENU);
}
void menu_free (void)
@ -1209,7 +1216,7 @@ bool rmenu_iterate(void)
if (g_extern.lifecycle_menu_state & (1 << MODE_LOAD_GAME))
{
if(g_extern.console.rmenu.state.msg_info.enable)
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
rarch_settings_msg(S_MSG_LOADING_ROM, 100);
g_extern.lifecycle_menu_state |= (1 << MODE_INIT);

View File

@ -381,7 +381,8 @@ static void system_process_args(int argc, char *argv[])
g_extern.lifecycle_menu_state |= (1 << MODE_MENU_DRAW);
rarch_render_cached_frame();
g_extern.lifecycle_menu_state &= ~(1 << MODE_MENU_DRAW);
g_extern.lifecycle_menu_state = (1 << MODE_INIT);
g_extern.lifecycle_menu_state &= ~(1 << MODE_MENU);
g_extern.lifecycle_menu_state |= (1 << MODE_INIT);
}
else
g_extern.console.external_launch.support = EXTERN_LAUNCHER_SALAMANDER;

View File

@ -388,13 +388,13 @@ static void system_process_args(int argc, char *argv[])
switch(g_extern.console.external_launch.support)
{
case EXTERN_LAUNCHER_SALAMANDER:
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
break;
#ifdef HAVE_MULTIMAN
case EXTERN_LAUNCHER_MULTIMAN:
RARCH_LOG("Started from multiMAN, will auto-start game.\n");
strlcpy(g_extern.fullpath, argv[1], sizeof(g_extern.fullpath));
g_extern.lifecycle_menu_state = (1 << MODE_INIT);
g_extern.lifecycle_menu_state &= ~(1 << MODE_MENU);
g_extern.lifecycle_menu_state |= (1 << MODE_INIT);
break;
#endif
default:

View File

@ -92,10 +92,7 @@ static int setup_callback(void)
return thread_id;
}
void menu_init (void)
{
g_extern.lifecycle_menu_state = (1 << MODE_MENU);
}
void menu_init (void) {}
bool rmenu_iterate(void)
{
@ -103,7 +100,8 @@ 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.lifecycle_menu_state = (1 << MODE_INIT);
g_extern.lifecycle_menu_state &= ~(1 << MODE_MENU);
g_extern.lifecycle_menu_state |= (1 << MODE_INIT);
return false;
}

View File

@ -109,6 +109,7 @@ enum menu_enums
MODE_MENU_PREINIT,
MODE_MENU_INGAME,
MODE_MENU_DRAW,
MODE_INFO_DRAW,
MODE_FPS_DRAW,
MODE_EXIT,
MODE_LOAD_FIRST_SHADER,
@ -497,7 +498,6 @@ struct global
struct
{
rarch_boolean_state_t msg_info;
rarch_boolean_state_t rmenu_widescreen;
rarch_boolean_state_t rmenu_hd;
} state;

View File

@ -241,6 +241,8 @@ void config_set_defaults(void)
#ifdef RARCH_CONSOLE
/* TODO - will be refactored - I'm aware this is messy right now */
g_extern.lifecycle_menu_state = 0;
g_extern.lifecycle_menu_state |= ((1 << MODE_INFO_DRAW) | (1 << MODE_MENU));
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
strlcpy(g_settings.video.cg_shader_path, default_paths.shader_file, sizeof(g_settings.video.cg_shader_path));
strlcpy(g_settings.video.second_pass_shader, default_paths.shader_file, sizeof(g_settings.video.second_pass_shader));
@ -281,7 +283,8 @@ void config_set_defaults(void)
g_extern.console.screen.gamma_correction = DEFAULT_GAMMA;
g_extern.console.screen.state.screenshots.enable = true;
g_extern.console.screen.state.throttle.enable = true;
g_extern.console.rmenu.state.msg_info.enable = true;
g_extern.console.screen.state.triple_buffering.enable = true;
g_extern.console.main_wrap.state.default_savestate_dir.enable = false;
g_extern.console.main_wrap.state.default_sram_dir.enable = false;
@ -294,7 +297,6 @@ void config_set_defaults(void)
g_extern.audio_data.mute = 0;
g_extern.verbose = true;
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;
@ -492,7 +494,16 @@ bool config_load_file(const char *path)
CONFIG_GET_STRING_EXTERN(console.main_wrap.paths.default_rom_startup_dir, "default_rom_startup_dir");
CONFIG_GET_BOOL_EXTERN(console.screen.gamma_correction, "gamma_correction");
CONFIG_GET_BOOL_EXTERN(console.rmenu.state.msg_info.enable, "info_msg_enable");
bool msg_enable = false;
if (config_get_bool(conf, "info_msg_enable", &msg_enable))
{
if (msg_enable)
g_extern.lifecycle_menu_state |= (1 << MODE_INFO_DRAW);
else
g_extern.lifecycle_menu_state &= ~(1 << MODE_INFO_DRAW);
}
CONFIG_GET_BOOL_EXTERN(console.screen.state.screenshots.enable, "screenshots_enable");
CONFIG_GET_BOOL_EXTERN(console.screen.state.throttle.enable, "throttle_enable");
CONFIG_GET_BOOL_EXTERN(console.screen.state.triple_buffering.enable, "triple_buffering_enable");
@ -1112,7 +1123,12 @@ bool config_save_file(const char *path)
#endif
config_set_bool(conf, "throttle_enable", g_extern.console.screen.state.throttle.enable);
config_set_bool(conf, "triple_buffering_enable", g_extern.console.screen.state.triple_buffering.enable);
config_set_bool(conf, "info_msg_enable", g_extern.console.rmenu.state.msg_info.enable);
if (g_extern.lifecycle_menu_state & (1 << MODE_INFO_DRAW))
config_set_bool(conf, "info_msg_enable", true);
else
config_set_bool(conf, "info_msg_enable", false);
config_set_int(conf, "current_resolution_id", g_extern.console.screen.resolutions.current.id);
config_set_int(conf, "custom_viewport_width", g_extern.console.screen.viewports.custom_vp.width);
config_set_int(conf, "custom_viewport_height", g_extern.console.screen.viewports.custom_vp.height);