Llevats tots els ifdef VERBOSE i redirigit cout a null_stream

This commit is contained in:
2024-10-17 19:31:44 +02:00
parent 50a376e582
commit 1da8f33a5e
2 changed files with 4 additions and 3 deletions

View File

@@ -58,7 +58,6 @@ Director::Director(int argc, const char *argv[])
#ifndef VERBOSE #ifndef VERBOSE
// Deshabilita todos los std::cout // Deshabilita todos los std::cout
std::ostream null_stream(nullptr); std::ostream null_stream(nullptr);
std::streambuf *orig_buf;
orig_buf = std::cout.rdbuf(null_stream.rdbuf()); orig_buf = std::cout.rdbuf(null_stream.rdbuf());
#endif #endif
@@ -707,8 +706,10 @@ int Director::run()
std::cout << "\nGame end with " << return_code << std::endl; std::cout << "\nGame end with " << return_code << std::endl;
#ifndef VERBOSE
// Habilita de nuevo los std::cout // Habilita de nuevo los std::cout
//std::cout.rdbuf(orig_buf); std::cout.rdbuf(orig_buf);
#endif
return (return_code == std::string("keyboard")) ? 0 : 1; return (return_code == std::string("keyboard")) ? 0 : 1;
} }

View File

@@ -20,7 +20,7 @@ private:
// Objetos y punteros // Objetos y punteros
SDL_Window *window_; // La ventana donde dibujamos SDL_Window *window_; // La ventana donde dibujamos
SDL_Renderer *renderer_; // El renderizador de la ventana SDL_Renderer *renderer_; // El renderizador de la ventana
//std::streambuf *orig_buf; ///< Puntero al buffer de flujo original para restaurar std::cout std::streambuf *orig_buf; ///< Puntero al buffer de flujo original para restaurar std::cout
// Variables // Variables
std::string executable_path_; // Path del ejecutable std::string executable_path_; // Path del ejecutable