Cambiando printf a std::cout

This commit is contained in:
2022-10-30 22:23:24 +01:00
parent 995b3516e6
commit 531ac94bc0
7 changed files with 25 additions and 29 deletions

View File

@@ -85,7 +85,7 @@ bool Director::loadConfig()
if (file.good())
{
// Procesa el fichero linea a linea
printf("Reading file config.txt\n");
std::cout << "Reading file config.txt\n";
while (std::getline(file, line))
{
// Comprueba que la linea no sea un comentario
@@ -96,14 +96,15 @@ bool Director::loadConfig()
// Procesa las dos subcadenas
if (!setOptions(options, line.substr(0, pos), line.substr(pos + 1, line.length())))
{
printf("Warning: file %s\n, unknown parameter \"%s\"\n", "config.txt", line.substr(0, pos).c_str());
std::cout << "Warning: file config.txt\n";
std::cout << "unknown parameter " << line.substr(0, pos).c_str() << std::endl;
success = false;
}
}
}
// Cierra el fichero
printf("Closing file config.txt\n\n");
std::cout << "Closing file config.txt\n\n";
file.close();
}
@@ -634,7 +635,7 @@ bool Director::initSDL()
// Inicializa SDL
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER | SDL_INIT_AUDIO) < 0)
{
printf("SDL could not initialize!\nSDL Error: %s\n", SDL_GetError());
std::cout << "SDL could not initialize!\nSDL Error: " << SDL_GetError() << std::endl;
success = false;
}
else
@@ -645,14 +646,14 @@ bool Director::initSDL()
// Establece el filtro de la textura a nearest
if (!SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, std::to_string(options->filter).c_str()))
{
printf("Warning: Nearest texture filtering not enabled!\n");
std::cout << "Warning: Nearest texture filtering not enabled!\n";
}
// Crea la ventana
window = SDL_CreateWindow(WINDOW_CAPTION, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, options->screenWidth, options->screenHeight, SDL_WINDOW_SHOWN | SDL_WINDOW_ALLOW_HIGHDPI);
if (window == nullptr)
{
printf("Window could not be created!\nSDL Error: %s\n", SDL_GetError());
std::cout << "Window could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
success = false;
}
else
@@ -665,7 +666,7 @@ bool Director::initSDL()
if (renderer == nullptr)
{
printf("Renderer could not be created!\nSDL Error: %s\n", SDL_GetError());
std::cout << "Renderer could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
success = false;
}
else
@@ -682,7 +683,7 @@ bool Director::initSDL()
}
}
printf("\n");
std::cout << std::endl;
return success;
}