commit de acabar la jornada laboral
This commit is contained in:
@@ -86,18 +86,14 @@ bool loadOptionsFile(std::string file_path)
|
||||
bool success = true;
|
||||
|
||||
// Variables para manejar el fichero
|
||||
#ifdef VERBOSE
|
||||
const std::string file_name = file_path.substr(file_path.find_last_of("\\/") + 1);
|
||||
#endif
|
||||
std::ifstream file(file_path);
|
||||
|
||||
// Si el fichero se puede abrir
|
||||
if (file.good())
|
||||
{
|
||||
// Procesa el fichero linea a linea
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Reading file: " << file_name << std::endl;
|
||||
#endif
|
||||
std::string line;
|
||||
while (std::getline(file, line))
|
||||
{
|
||||
@@ -109,10 +105,8 @@ bool loadOptionsFile(std::string file_path)
|
||||
// Procesa las dos subcadenas
|
||||
if (!setOptions(line.substr(0, pos), line.substr(pos + 1, line.length())))
|
||||
{
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Warning: file " << file_name << std::endl;
|
||||
std::cout << "Unknown parameter " << line.substr(0, pos).c_str() << std::endl;
|
||||
#endif
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
@@ -152,22 +146,16 @@ bool loadOptionsFile(std::string file_path)
|
||||
// Guarda el fichero de configuración
|
||||
bool saveOptionsFile(std::string file_path)
|
||||
{
|
||||
#ifdef VERBOSE
|
||||
const std::string file_name = file_path.substr(file_path.find_last_of("\\/") + 1);
|
||||
#endif
|
||||
std::ofstream file(file_path);
|
||||
|
||||
if (!file.good())
|
||||
{
|
||||
#ifdef VERBOSE
|
||||
std::cout << file_name << " can't be opened" << std::endl;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Writing file: " << file_name << std::endl;
|
||||
#endif
|
||||
|
||||
// Opciones de video
|
||||
const auto value_video_mode_winow = std::to_string(static_cast<int>(ScreenVideoMode::WINDOW));
|
||||
|
||||
Reference in New Issue
Block a user