reestructurat el apartat de video de config.yaml
This commit is contained in:
@@ -150,23 +150,23 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
||||
if (!Screen::get()->isHardwareAccelerated()) { return "No GPU acceleration"; }
|
||||
static const std::array<std::string_view, 3> DOWNSCALE_NAMES = {"Bilinear", "Lanczos2", "Lanczos3"};
|
||||
if (!args.empty() && args[0] == "SIZE") {
|
||||
if (!Options::video.supersampling) { return "Supersampling is OFF: no texture"; }
|
||||
if (!Options::video.supersampling.enabled) { return "Supersampling is OFF: no texture"; }
|
||||
const auto [w, h] = Screen::get()->getSsTextureSize();
|
||||
if (w == 0) { return "SS texture: not active"; }
|
||||
return "SS texture: " + std::to_string(w) + "x" + std::to_string(h);
|
||||
}
|
||||
if (!args.empty() && args[0] == "UPSCALE") {
|
||||
if (args.size() == 1) {
|
||||
Screen::get()->setLinearUpscale(!Options::video.linear_upscale);
|
||||
return std::string("Upscale: ") + (Options::video.linear_upscale ? "Linear" : "Nearest");
|
||||
Screen::get()->setLinearUpscale(!Options::video.supersampling.linear_upscale);
|
||||
return std::string("Upscale: ") + (Options::video.supersampling.linear_upscale ? "Linear" : "Nearest");
|
||||
}
|
||||
if (args[1] == "NEAREST") {
|
||||
if (!Options::video.linear_upscale) { return "Upscale already Nearest"; }
|
||||
if (!Options::video.supersampling.linear_upscale) { return "Upscale already Nearest"; }
|
||||
Screen::get()->setLinearUpscale(false);
|
||||
return "Upscale: Nearest";
|
||||
}
|
||||
if (args[1] == "LINEAR") {
|
||||
if (Options::video.linear_upscale) { return "Upscale already Linear"; }
|
||||
if (Options::video.supersampling.linear_upscale) { return "Upscale already Linear"; }
|
||||
Screen::get()->setLinearUpscale(true);
|
||||
return "Upscale: Linear";
|
||||
}
|
||||
@@ -174,14 +174,14 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
||||
}
|
||||
if (!args.empty() && args[0] == "DOWNSCALE") {
|
||||
if (args.size() == 1) {
|
||||
return std::string("Downscale: ") + std::string(DOWNSCALE_NAMES[static_cast<size_t>(Options::video.downscale_algo)]);
|
||||
return std::string("Downscale: ") + std::string(DOWNSCALE_NAMES[static_cast<size_t>(Options::video.supersampling.downscale_algo)]);
|
||||
}
|
||||
int algo = -1;
|
||||
if (args[1] == "BILINEAR") { algo = 0; }
|
||||
if (args[1] == "LANCZOS2") { algo = 1; }
|
||||
if (args[1] == "LANCZOS3") { algo = 2; }
|
||||
if (algo == -1) { return "usage: ss downscale [bilinear|lanczos2|lanczos3]"; }
|
||||
if (Options::video.downscale_algo == algo) {
|
||||
if (Options::video.supersampling.downscale_algo == algo) {
|
||||
return std::string("Downscale already ") + std::string(DOWNSCALE_NAMES[static_cast<size_t>(algo)]);
|
||||
}
|
||||
Screen::get()->setDownscaleAlgo(algo);
|
||||
@@ -189,15 +189,15 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
||||
}
|
||||
if (args.empty()) {
|
||||
Screen::get()->toggleSupersampling();
|
||||
return std::string("PostFX Supersampling ") + (Options::video.supersampling ? "ON" : "OFF");
|
||||
return std::string("PostFX Supersampling ") + (Options::video.supersampling.enabled ? "ON" : "OFF");
|
||||
}
|
||||
if (args[0] == "ON") {
|
||||
if (Options::video.supersampling) { return "Supersampling already ON"; }
|
||||
if (Options::video.supersampling.enabled) { return "Supersampling already ON"; }
|
||||
Screen::get()->toggleSupersampling();
|
||||
return "PostFX Supersampling ON";
|
||||
}
|
||||
if (args[0] == "OFF") {
|
||||
if (!Options::video.supersampling) { return "Supersampling already OFF"; }
|
||||
if (!Options::video.supersampling.enabled) { return "Supersampling already OFF"; }
|
||||
Screen::get()->toggleSupersampling();
|
||||
return "PostFX Supersampling OFF";
|
||||
}
|
||||
@@ -214,15 +214,15 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
||||
if (!Screen::get()->isHardwareAccelerated()) { return "No GPU acceleration"; }
|
||||
if (args.empty()) {
|
||||
Screen::get()->toggleShaders();
|
||||
return std::string("Shader ") + (Options::video.postfx ? "ON" : "OFF");
|
||||
return std::string("Shader ") + (Options::video.shader.enabled ? "ON" : "OFF");
|
||||
}
|
||||
if (args[0] == "ON") {
|
||||
if (Options::video.postfx) { return "Shader already ON"; }
|
||||
if (Options::video.shader.enabled) { return "Shader already ON"; }
|
||||
Screen::get()->toggleShaders();
|
||||
return "Shader ON";
|
||||
}
|
||||
if (args[0] == "OFF") {
|
||||
if (!Options::video.postfx) { return "Shader already OFF"; }
|
||||
if (!Options::video.shader.enabled) { return "Shader already OFF"; }
|
||||
Screen::get()->toggleShaders();
|
||||
return "Shader OFF";
|
||||
}
|
||||
@@ -237,27 +237,27 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
||||
if (args[0] == "NEXT") {
|
||||
// SHADER NEXT PRESET → cicla presets del shader activo
|
||||
if (args.size() >= 2 && args[1] == "PRESET") {
|
||||
if (Options::current_shader == Rendering::ShaderType::CRTPI) {
|
||||
if (Options::video.shader.current_shader == Rendering::ShaderType::CRTPI) {
|
||||
if (Options::crtpi_presets.empty()) { return "No CrtPi presets available"; }
|
||||
Options::current_crtpi_preset =
|
||||
(Options::current_crtpi_preset + 1) %
|
||||
Options::video.shader.current_crtpi_preset =
|
||||
(Options::video.shader.current_crtpi_preset + 1) %
|
||||
static_cast<int>(Options::crtpi_presets.size());
|
||||
Screen::get()->reloadCrtPi();
|
||||
return "CrtPi preset: " +
|
||||
Options::crtpi_presets[static_cast<size_t>(Options::current_crtpi_preset)].name;
|
||||
Options::crtpi_presets[static_cast<size_t>(Options::video.shader.current_crtpi_preset)].name;
|
||||
}
|
||||
if (Options::postfx_presets.empty()) { return "No PostFX presets available"; }
|
||||
Options::current_postfx_preset =
|
||||
(Options::current_postfx_preset + 1) %
|
||||
Options::video.shader.current_postfx_preset =
|
||||
(Options::video.shader.current_postfx_preset + 1) %
|
||||
static_cast<int>(Options::postfx_presets.size());
|
||||
Screen::get()->reloadPostFX();
|
||||
return "PostFX preset: " +
|
||||
Options::postfx_presets[static_cast<size_t>(Options::current_postfx_preset)].name;
|
||||
Options::postfx_presets[static_cast<size_t>(Options::video.shader.current_postfx_preset)].name;
|
||||
}
|
||||
// SHADER NEXT → cicla entre tipos de shader (PostFX ↔ CrtPi)
|
||||
Screen::get()->nextShader();
|
||||
return std::string("Shader: ") +
|
||||
(Options::current_shader == Rendering::ShaderType::CRTPI ? "CrtPi" : "PostFX");
|
||||
(Options::video.shader.current_shader == Rendering::ShaderType::CRTPI ? "CrtPi" : "PostFX");
|
||||
}
|
||||
return "usage: shader [on|off|next [preset]|postfx|crtpi]";
|
||||
},
|
||||
@@ -373,12 +373,12 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
||||
return "Not allowed in kiosk mode";
|
||||
}
|
||||
if (args[0] == "AUTO") {
|
||||
Options::video.gpu_preferred_driver.clear();
|
||||
Options::video.gpu.preferred_driver.clear();
|
||||
Options::saveToFile();
|
||||
return "Driver: auto (restart)";
|
||||
}
|
||||
if (args[0] == "NONE") {
|
||||
Options::video.gpu_preferred_driver = "none";
|
||||
Options::video.gpu.preferred_driver = "none";
|
||||
Options::saveToFile();
|
||||
return "Driver: none (SDL fallback, restart)";
|
||||
}
|
||||
@@ -394,7 +394,7 @@ static const std::vector<ConsoleCommand> COMMANDS = {
|
||||
if (!found) {
|
||||
return "Unknown driver: " + driver_lower + ". Use DRIVER LIST or NONE";
|
||||
}
|
||||
Options::video.gpu_preferred_driver = driver_lower;
|
||||
Options::video.gpu.preferred_driver = driver_lower;
|
||||
Options::saveToFile();
|
||||
return "Driver: " + driver_lower + " (restart)";
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user