New: refeta la lògica d'eixir o apagar el sistema
This commit is contained in:
@@ -122,10 +122,8 @@ void Director::close()
|
||||
// Libera todos los recursos de SDL
|
||||
SDL_Quit();
|
||||
|
||||
#ifdef ARCADE
|
||||
// Si está en modo arcade, apaga el sistema si corresponde
|
||||
shutdownSystem(section::options == section::Options::QUIT_WITH_CONTROLLER);
|
||||
#endif
|
||||
// Apaga el sistema
|
||||
shutdownSystem(section::options == section::Options::SHUTDOWN);
|
||||
}
|
||||
|
||||
// Carga los parametros
|
||||
@@ -671,26 +669,9 @@ int Director::run()
|
||||
}
|
||||
}
|
||||
|
||||
std::string return_code;
|
||||
switch (section::options)
|
||||
{
|
||||
case section::Options::QUIT_WITH_KEYBOARD:
|
||||
return_code = "with keyboard";
|
||||
break;
|
||||
case section::Options::QUIT_WITH_CONTROLLER:
|
||||
return_code = "with controller";
|
||||
break;
|
||||
default:
|
||||
return_code = "from event";
|
||||
break;
|
||||
}
|
||||
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "\nGame end %s", return_code.c_str());
|
||||
|
||||
return (section::options == section::Options::QUIT_WITH_CONTROLLER) ? 1 : 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef ARCADE
|
||||
// Apaga el sistema
|
||||
void Director::shutdownSystem(bool should_shutdown)
|
||||
{
|
||||
@@ -710,5 +691,4 @@ void Director::shutdownSystem(bool should_shutdown)
|
||||
#error "Sistema operativo no soportado"
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif // ARCADE
|
||||
}
|
||||
Reference in New Issue
Block a user