Compare commits

3 Commits

3 changed files with 19 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ Coffee Crisis Arcade Edition és una versió ampliada i millorada del aclamat Co
Defensa el teu cafè contra les bambolles gegants en aquest trepidant joc d'arcade! 🍵
<p align="center">
<img src="https://php.sustancia.synology.me/images/ccae_title.png" alt="Títol" />
<img src="https://php.sustancia.synology.me/images/ccae_title.png" alt="Títol" width="60%" />
</p>
## Controls
@@ -25,7 +25,8 @@ El joc està optimitzat per a ser jugat amb un mando de jocs, encara que un dels
> Nota: El joc suporta nomes un jugador amb teclat.
<p align="center">
<img src="https://php.sustancia.synology.me/images/ccae1.png" alt="Joc" />
<img src="https://php.sustancia.synology.me/images/ccae1.png" alt="Joc" width="45%" />
<img src="https://php.sustancia.synology.me/images/ccae3.png" alt="Joc" width="45%" />
</p>
## Altres tecles
@@ -43,7 +44,7 @@ El joc està optimitzat per a ser jugat amb un mando de jocs, encara que un dels
| **F10** | Reset del joc |
<p align="center">
<img src="https://php.sustancia.synology.me/images/ccae2.png" alt="Joc" />
<img src="https://php.sustancia.synology.me/images/ccae2.png" alt="Joc" width="50%" />
</p>
## Com instal·lar i jugar

View File

@@ -126,6 +126,10 @@ void Director::close()
SDL_DestroyWindow(window_);
SDL_Quit();
#ifdef ARCADE
shutdownSystem(section::options == section::Options::QUIT_WITH_CONTROLLER);
#endif
}
// Carga los parametros
@@ -762,11 +766,6 @@ int Director::run()
// Habilita de nuevo los std::cout
std::cout.rdbuf(orig_buf);
#endif
#ifdef ARCADE
// Comprueba si ha de apagar el sistema
if (section::options == section::Options::QUIT_WITH_CONTROLLER)
shutdownSystem();
#endif
return (section::options == section::Options::QUIT_WITH_CONTROLLER) ? 1 : 0;
}
@@ -794,20 +793,23 @@ std::string Director::getLangFile(lang::Code code)
#ifdef ARCADE
// Apaga el sistema
void Director::shutdownSystem()
void Director::shutdownSystem(bool shouldShutdown)
{
if (shouldShutdown)
{
#ifdef _WIN32
// Apaga el sistema en Windows
system("shutdown /s /t 0");
// Apaga el sistema en Windows
system("shutdown /s /t 5");
#elif __APPLE__
// Apaga el sistema en macOS
system("sudo shutdown -h now");
// Apaga el sistema en macOS
system("sudo shutdown -h +0.1");
#elif __linux__
// Apaga el sistema en Linux
system("shutdown -h now");
// Apaga el sistema en Linux
system("shutdown -h +0.1");
#else
// Sistema operativo no compatible
#error "Sistema operativo no soportado"
#endif
}
}
#endif // ARCADE

View File

@@ -74,7 +74,7 @@ private:
std::string getLangFile(lang::Code code);
#ifdef ARCADE
// Apaga el sistema
void shutdownSystem();
void shutdownSystem(bool shouldShutdown);
#endif
// Inicializa todo