Add RETRO_ENVIRONMENT_SHUTDOWN.

This commit is contained in:
Themaister 2012-05-22 20:14:07 +02:00
parent 5185fb7baa
commit d2b55f38cd
4 changed files with 11 additions and 1 deletions

View File

@ -316,6 +316,10 @@ static bool environment_cb(unsigned cmd, void *data)
break;
}
case RETRO_ENVIRONMENT_SHUTDOWN:
g_extern.system.shutdown = true;
break;
default:
RARCH_LOG("Environ UNSUPPORTED (#%u).\n", cmd);
return false;

View File

@ -315,6 +315,7 @@ struct global
char *environment_split;
unsigned rotation;
bool shutdown;
} system;
struct

View File

@ -111,6 +111,10 @@ extern "C" {
#define RETRO_ENVIRONMENT_SET_MESSAGE 6 // const struct retro_message * --
// Sets a message to be displayed in implementation-specific manner for a certain amount of 'frames'.
// Should not be used for trivial messages, which should simply be logged to stderr.
#define RETRO_ENVIRONMENT_SHUTDOWN 7 // N/A (NULL) --
// Requests the frontend to shutdown.
// Should only be used if game has a specific
// way to shutdown the game from a menu item or similar.
struct retro_message
{

View File

@ -2411,7 +2411,8 @@ bool rarch_main_iterate(void)
// Time to drop?
if (input_key_pressed_func(RARCH_QUIT_KEY) ||
!video_alive_func())
!video_alive_func() ||
g_extern.system.shutdown)
return false;
// Checks for stuff like fullscreen, save states, etc.