Eliminat tots els options.console
This commit is contained in:
@@ -108,7 +108,7 @@ void Director::initInput()
|
||||
#ifdef VERBOSE
|
||||
input->setVerbose(true);
|
||||
#else
|
||||
input->setVerbose(options.console);
|
||||
input->setVerbose(false);
|
||||
#endif
|
||||
// Busca si hay mandos conectados
|
||||
input->discoverGameControllers();
|
||||
@@ -216,10 +216,9 @@ bool Director::initSDL()
|
||||
// Inicializa SDL
|
||||
if (SDL_Init(SDL_INIT_EVERYTHING) < 0)
|
||||
{
|
||||
if (options.console)
|
||||
{
|
||||
std::cout << "SDL could not initialize!\nSDL Error: " << SDL_GetError() << std::endl;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
std::cout << "SDL could not initialize!\nSDL Error: " << SDL_GetError() << std::endl;
|
||||
#endif
|
||||
success = false;
|
||||
}
|
||||
else
|
||||
@@ -227,48 +226,44 @@ bool Director::initSDL()
|
||||
// Inicia el generador de numeros aleatorios
|
||||
std::srand(static_cast<unsigned int>(SDL_GetTicks()));
|
||||
|
||||
#ifdef VERBOSE
|
||||
// Muestra información de la pantalla
|
||||
if (options.console)
|
||||
/*std::cout << "\nDisplay modes list:" << std::endl;
|
||||
for (int i = 0; i < SDL_GetNumDisplayModes(0); ++i)
|
||||
{
|
||||
/*std::cout << "\nDisplay modes list:" << std::endl;
|
||||
for (int i = 0; i < SDL_GetNumDisplayModes(0); ++i)
|
||||
{
|
||||
SDL_DisplayMode DM;
|
||||
SDL_GetDisplayMode(0,i,&DM);
|
||||
std::cout << " - " + std::to_string(DM.w) + "x" + std::to_string(DM.h) + " @ " + std::to_string(DM.refresh_rate) + "Hz" << std::endl;
|
||||
}*/
|
||||
|
||||
SDL_DisplayMode DM;
|
||||
SDL_GetCurrentDisplayMode(0, &DM);
|
||||
std::cout << "\nCurrent display mode: " + std::to_string(DM.w) + "x" + std::to_string(DM.h) + " @ " + std::to_string(DM.refresh_rate) + "Hz" << std::endl;
|
||||
std::cout << "Window resolution : " + std::to_string(param.game.width) + "x" + std::to_string(param.game.height) + " x" + std::to_string(options.video.window.size) << std::endl;
|
||||
}
|
||||
SDL_GetDisplayMode(0,i,&DM);
|
||||
std::cout << " - " + std::to_string(DM.w) + "x" + std::to_string(DM.h) + " @ " + std::to_string(DM.refresh_rate) + "Hz" << std::endl;
|
||||
}*/
|
||||
|
||||
SDL_DisplayMode DM;
|
||||
SDL_GetCurrentDisplayMode(0, &DM);
|
||||
std::cout << "\nCurrent display mode: " + std::to_string(DM.w) + "x" + std::to_string(DM.h) + " @ " + std::to_string(DM.refresh_rate) + "Hz" << std::endl;
|
||||
std::cout << "Window resolution : " + std::to_string(param.game.width) + "x" + std::to_string(param.game.height) + " x" + std::to_string(options.video.window.size) << std::endl;
|
||||
#endif
|
||||
|
||||
// Establece el filtro de la textura
|
||||
if (!SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, std::to_string(options.video.filter).c_str()))
|
||||
{
|
||||
if (options.console)
|
||||
{
|
||||
std::cout << "Warning: texture filtering not enabled!\n";
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Warning: texture filtering not enabled!\n";
|
||||
#endif
|
||||
}
|
||||
#ifndef NO_SHADERS
|
||||
if (!SDL_SetHint(SDL_HINT_RENDER_DRIVER, "opengl"))
|
||||
{
|
||||
if (options.console)
|
||||
{
|
||||
std::cout << "Warning: opengl not enabled!\n";
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Warning: opengl not enabled!\n";
|
||||
#endif // VERBOSE
|
||||
}
|
||||
#endif
|
||||
// Crea la ventana
|
||||
#endif // NO_SHADERS
|
||||
// Crea la ventana
|
||||
window = SDL_CreateWindow(WINDOW_CAPTION, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, param.game.width * options.video.window.size, param.game.height * options.video.window.size, SDL_WINDOW_HIDDEN);
|
||||
if (window == nullptr)
|
||||
{
|
||||
if (options.console)
|
||||
{
|
||||
std::cout << "Window could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Window could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
|
||||
#endif
|
||||
success = false;
|
||||
}
|
||||
else
|
||||
@@ -287,10 +282,9 @@ bool Director::initSDL()
|
||||
|
||||
if (renderer == nullptr)
|
||||
{
|
||||
if (options.console)
|
||||
{
|
||||
std::cout << "Renderer could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Renderer could not be created!\nSDL Error: " << SDL_GetError() << std::endl;
|
||||
#endif
|
||||
success = false;
|
||||
}
|
||||
else
|
||||
@@ -307,10 +301,9 @@ bool Director::initSDL()
|
||||
}
|
||||
}
|
||||
|
||||
if (options.console)
|
||||
{
|
||||
std::cout << std::endl;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
std::cout << std::endl;
|
||||
#endif
|
||||
return success;
|
||||
}
|
||||
|
||||
@@ -479,11 +472,6 @@ void Director::checkProgramArguments(int argc, char *argv[])
|
||||
// Comprueba el resto de parametros
|
||||
for (int i = 1; i < argc; ++i)
|
||||
{
|
||||
if (strcmp(argv[i], "--console") == 0)
|
||||
{
|
||||
options.console = true;
|
||||
}
|
||||
|
||||
if (strcmp(argv[i], "--320x240") == 0)
|
||||
{
|
||||
paramFileArgument = argv[i];
|
||||
|
||||
Reference in New Issue
Block a user