Hose some more code to rarch_main_command

This commit is contained in:
twinaphex 2014-07-22 03:55:55 +02:00
parent d27ffd007f
commit 3a501e750f
3 changed files with 12 additions and 16 deletions

View File

@ -3787,19 +3787,7 @@ static int menu_common_setting_set(unsigned setting, unsigned action)
if (setting == MENU_SETTINGS_SAVESTATE_SAVE)
rarch_main_command(RARCH_CMD_SAVE_STATE);
else
{
// Disallow savestate load when we absolutely cannot change game state.
#ifdef HAVE_BSV_MOVIE
if (g_extern.bsv.movie)
break;
#endif
#ifdef HAVE_NETPLAY
if (g_extern.netplay)
break;
#endif
rarch_main_command(RARCH_CMD_LOAD_STATE);
}
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
return -1;
}
else if (action == MENU_ACTION_START)
@ -3821,7 +3809,6 @@ static int menu_common_setting_set(unsigned setting, unsigned action)
if (action == MENU_ACTION_OK)
{
rarch_main_command(RARCH_CMD_RESET);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
return -1;
}
break;

View File

@ -355,13 +355,11 @@ static int menu_lakka_iterate(unsigned action)
case 1:
global_alpha = 0.0;
rarch_main_command(RARCH_CMD_SAVE_STATE);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
return -1;
break;
case 2:
global_alpha = 0.0;
rarch_main_command(RARCH_CMD_LOAD_STATE);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
return -1;
break;
case 3:
@ -370,7 +368,6 @@ static int menu_lakka_iterate(unsigned action)
case 4:
global_alpha = 0.0;
rarch_main_command(RARCH_CMD_RESET);
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
return -1;
break;
}

View File

@ -3098,13 +3098,25 @@ void rarch_main_command(unsigned action)
#endif
break;
case RARCH_CMD_LOAD_STATE:
// Disallow savestate load when we absolutely cannot change game state.
#ifdef HAVE_BSV_MOVIE
if (g_extern.bsv.movie)
break;
#endif
#ifdef HAVE_NETPLAY
if (g_extern.netplay)
break;
#endif
rarch_load_state();
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
break;
case RARCH_CMD_RESET:
rarch_game_reset();
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
break;
case RARCH_CMD_SAVE_STATE:
rarch_save_state();
g_extern.lifecycle_state |= (1ULL << MODE_GAME);
break;
case RARCH_CMD_TAKE_SCREENSHOT:
rarch_take_screenshot();