cambios en el fichero de configuración para hacer más facil la selección de modos de video y filtros

This commit is contained in:
2024-07-06 00:19:28 +02:00
parent abb0151560
commit 78a689760d
3 changed files with 28 additions and 34 deletions

View File

@@ -615,28 +615,23 @@ bool Director::saveConfigFile()
// Opciones de video
file << "## VIDEO\n";
file << "## video.mode [0, SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP]\n";
file << "## video.filter [FILTER_NEAREST, FILTER_LINEAL]\n";
file << "## video.mode [0: window, 1: full screen]\n";
file << "## video.filter [0: nearest, 1: lineal]\n";
file << "\n";
if (options->video.mode == 0)
if (options->video.mode == VIDEO_MODE_WINDOW)
{
file << "video.mode=0\n";
}
else if (options->video.mode == SDL_WINDOW_FULLSCREEN)
else if (options->video.mode == VIDEO_MODE_FULLSCREEN)
{
file << "video.mode=SDL_WINDOW_FULLSCREEN\n";
}
else if (options->video.mode == SDL_WINDOW_FULLSCREEN_DESKTOP)
{
file << "video.mode=SDL_WINDOW_FULLSCREEN_DESKTOP\n";
file << "video.mode=1\n";
}
file << "video.window.size=" + std::to_string(options->video.window.size) + "\n";
options->video.filter == FILTER_NEAREST ? file << "video.filter=FILTER_NEAREST\n" : file << "video.filter=FILTER_LINEAL\n";
options->video.filter == FILTER_NEAREST ? file << "video.filter=0\n" : file << "video.filter=1\n";
file << "video.shaders=" + boolToString(options->video.shaders) + "\n";
file << "video.vSync=" + boolToString(options->video.vSync) + "\n";
@@ -831,17 +826,13 @@ bool Director::setOptions(options_t *options, std::string var, std::string value
// Opciones de video
if (var == "video.mode")
{
if (value == "SDL_WINDOW_FULLSCREEN_DESKTOP")
if (value == "0")
{
options->video.mode = SDL_WINDOW_FULLSCREEN_DESKTOP;
}
else if (value == "SDL_WINDOW_FULLSCREEN")
{
options->video.mode = SDL_WINDOW_FULLSCREEN;
options->video.mode = VIDEO_MODE_WINDOW;
}
else
{
options->video.mode = 0;
options->video.mode = VIDEO_MODE_FULLSCREEN;
}
}
@@ -856,13 +847,13 @@ bool Director::setOptions(options_t *options, std::string var, std::string value
else if (var == "video.filter")
{
if (value == "FILTER_LINEAL")
if (value == "0")
{
options->video.filter = FILTER_LINEAL;
options->video.filter = FILTER_NEAREST;
}
else
{
options->video.filter = FILTER_NEAREST;
options->video.filter = FILTER_LINEAL;
}
}