filtre nearest o linear per al pipeline sdl
This commit is contained in:
@@ -466,6 +466,24 @@ void ServiceMenu::initializeOptions() {
|
||||
SettingsGroup::VIDEO,
|
||||
&Options::video.integer_scale));
|
||||
|
||||
// FILTER: Nearest / Linear (solo visible en el fallback SDL, sin GPU acelerada)
|
||||
{
|
||||
std::vector<std::string> filter_values = {"Nearest", "Linear"};
|
||||
auto filter_getter = []() -> std::string {
|
||||
return (Options::video.scale_mode == SDL_SCALEMODE_LINEAR) ? "Linear" : "Nearest";
|
||||
};
|
||||
auto filter_setter = [](const std::string& val) {
|
||||
Options::video.scale_mode = (val == "Linear") ? SDL_SCALEMODE_LINEAR : SDL_SCALEMODE_NEAREST;
|
||||
if (Screen::get() != nullptr) { Screen::get()->applyFilter(); }
|
||||
};
|
||||
options_.push_back(std::make_unique<ListOption>(
|
||||
Lang::getText("[SERVICE_MENU] FILTER"),
|
||||
SettingsGroup::VIDEO,
|
||||
filter_values,
|
||||
filter_getter,
|
||||
filter_setter));
|
||||
}
|
||||
|
||||
// AUDIO
|
||||
options_.push_back(std::make_unique<BoolOption>(
|
||||
Lang::getText("[SERVICE_MENU] AUDIO"),
|
||||
@@ -644,26 +662,44 @@ void ServiceMenu::setHiddenOptions() {
|
||||
}
|
||||
}
|
||||
|
||||
// Las opciones de shader solo tienen sentido cuando SDL3GPU está activo.
|
||||
// Las opciones de filtro SDL solo tienen sentido en el fallback sin GPU.
|
||||
// Ambos checks son runtime para cubrir tanto builds sin shaders como fallos de inicialización.
|
||||
const bool HW_ACCEL = Screen::isHardwareAccelerated();
|
||||
|
||||
{
|
||||
auto* option = getOptionByCaption(Lang::getText("[SERVICE_MENU] FILTER"));
|
||||
if (option != nullptr) {
|
||||
option->setHidden(HW_ACCEL);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
auto* option = getOptionByCaption(Lang::getText("[SERVICE_MENU] SHADER"));
|
||||
if (option != nullptr) {
|
||||
option->setHidden(!HW_ACCEL);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
auto* option = getOptionByCaption(Lang::getText("[SERVICE_MENU] SHADER_PRESET"));
|
||||
if (option != nullptr) {
|
||||
option->setHidden(!Options::video.shader.enabled);
|
||||
option->setHidden(!HW_ACCEL || !Options::video.shader.enabled);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
auto* option = getOptionByCaption(Lang::getText("[SERVICE_MENU] SUPERSAMPLING"));
|
||||
if (option != nullptr) {
|
||||
option->setHidden(!Options::video.shader.enabled || Options::video.shader.current_shader != Rendering::ShaderType::POSTFX);
|
||||
option->setHidden(!HW_ACCEL || !Options::video.shader.enabled || Options::video.shader.current_shader != Rendering::ShaderType::POSTFX);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
// En la versión web no tiene sentido exponer: shaders (build sin shaders),
|
||||
// permitir apagar el sistema (no aplica al navegador) ni salir del juego
|
||||
// (lo gestiona el navegador).
|
||||
// En la versión web no tiene sentido exponer: permitir apagar el sistema
|
||||
// (no aplica al navegador) ni salir del juego (lo gestiona el navegador).
|
||||
// SHADER ya queda oculto por el check de HW_ACCEL de arriba.
|
||||
for (const auto& caption : {
|
||||
Lang::getText("[SERVICE_MENU] SHADER"),
|
||||
Lang::getText("[SERVICE_MENU] ENABLE_SHUTDOWN"),
|
||||
Lang::getText("[SERVICE_MENU] QUIT")}) {
|
||||
auto* option = getOptionByCaption(caption);
|
||||
|
||||
Reference in New Issue
Block a user