Implementado código de salida de la aplicación
This commit is contained in:
@@ -880,7 +880,7 @@ void Director::runDemoGame()
|
||||
delete demoGame;
|
||||
}
|
||||
|
||||
void Director::run()
|
||||
int Director::run()
|
||||
{
|
||||
// Bucle principal
|
||||
while (section->name != SECTION_PROG_QUIT)
|
||||
@@ -916,6 +916,9 @@ void Director::run()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const int returnCode = section->options == SECTION_OPTIONS_QUIT_NORMAL ? 0 : 1;
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
// Asigna variables a partir de dos cadenas
|
||||
|
||||
@@ -122,5 +122,5 @@ public:
|
||||
~Director();
|
||||
|
||||
// Bucle principal
|
||||
void run();
|
||||
int run();
|
||||
};
|
||||
@@ -18,12 +18,12 @@ int main(int argc, char *argv[])
|
||||
Director *director = new Director(argc, argv);
|
||||
|
||||
// Bucle principal
|
||||
director->run();
|
||||
const int exit = director->run();
|
||||
|
||||
// Destruye el objeto Director
|
||||
delete director;
|
||||
|
||||
std::cout << "\nGame end" << std::endl;
|
||||
|
||||
return 0;
|
||||
return exit;
|
||||
}
|
||||
|
||||
@@ -248,6 +248,7 @@ void Title::checkInput()
|
||||
if (input->checkInput(input_exit, DO_NOT_ALLOW_REPEAT, INPUT_USE_KEYBOARD))
|
||||
{
|
||||
section->name = SECTION_PROG_QUIT;
|
||||
section->options = SECTION_OPTIONS_QUIT_NORMAL;
|
||||
}
|
||||
|
||||
// Comprueba si se ha pulsado la tecla 1 o 2 para definir los controladores
|
||||
@@ -272,6 +273,7 @@ void Title::checkInput()
|
||||
{
|
||||
case SERVICE_EXIT:
|
||||
section->name = SECTION_PROG_QUIT;
|
||||
section->options = SECTION_OPTIONS_QUIT_SHUTDOWN;
|
||||
break;
|
||||
|
||||
case SERVICE_SHADERS:
|
||||
|
||||
Reference in New Issue
Block a user