From e11cabb9e205d08f93ed314aca8f2877d0332a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Valor=20Mart=C3=ADnez?= Date: Sun, 12 Feb 2023 19:30:33 +0100 Subject: [PATCH] =?UTF-8?q?Ya=20se=20puede=20usar=20el=20mando=20durante?= =?UTF-8?q?=20todo=20el=20juego=20La=20ventana=20ya=20cambia=20de=20tama?= =?UTF-8?q?=C3=B1o=20y=20de=20modo=20segun=20el=20estandar=20de=20jailgame?= =?UTF-8?q?s=20La=20carpeta=20de=20datos=20ya=20se=20crea=20segun=20el=20e?= =?UTF-8?q?standar=20de=20jailgames?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/director.cpp | 21 ++++++++++----------- source/director.h | 2 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/source/director.cpp b/source/director.cpp index a993ea4..238b97c 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -25,7 +25,12 @@ Director::Director(int argc, char *argv[]) checkProgramArguments(argc, argv); // Crea la carpeta del sistema donde guardar datos - createSystemFolder(); + createSystemFolder("jailgames"); +#ifndef DEBUG + createSystemFolder("jailgames/coffee_crisis"); +#else + createSystemFolder("jailgames/coffee_crisis_debug"); +#endif // Crea el objeto que controla los ficheros de recursos asset = new Asset(executablePath); @@ -411,24 +416,18 @@ void Director::checkProgramArguments(int argc, char *argv[]) } // Crea la carpeta del sistema donde guardar datos -void Director::createSystemFolder() +void Director::createSystemFolder(std::string folder) { -#ifdef DEBUG - const std::string folderName = "coffee_crisis_debug"; -#else - const std::string folderName = "coffee_crisis"; -#endif - #ifdef _WIN32 - systemFolder = std::string(getenv("APPDATA")) + "/" + folderName; + systemFolder = std::string(getenv("APPDATA")) + "/" + folder; #elif __APPLE__ struct passwd *pw = getpwuid(getuid()); const char *homedir = pw->pw_dir; - systemFolder = std::string(homedir) + "/Library/Application Support/" + folderName; + systemFolder = std::string(homedir) + "/Library/Application Support" + "/" + folder; #elif __linux__ struct passwd *pw = getpwuid(getuid()); const char *homedir = pw->pw_dir; - systemFolder = std::string(homedir) + "/." + folderName; + systemFolder = std::string(homedir) + "/." + folder; #endif struct stat st = {0}; diff --git a/source/director.h b/source/director.h index 5094bd1..fa89f8f 100644 --- a/source/director.h +++ b/source/director.h @@ -81,7 +81,7 @@ private: void checkProgramArguments(int argc, char *argv[]); // Crea la carpeta del sistema donde guardar datos - void createSystemFolder(); + void createSystemFolder(std::string folder); // Establece el valor de la variable void setSection(section_t section);