primera implementacio de postfx

This commit is contained in:
2026-03-23 13:18:36 +01:00
parent 99cc803f21
commit 2f3161d701
23 changed files with 13306 additions and 771 deletions

View File

@@ -62,10 +62,23 @@ namespace GlobalInputs {
Notifier::get()->show({Lang::getText("[NOTIFICATIONS] 14") + " " + boolToOnOff(Options::video.vsync)});
}
// Activa o desactiva los shaders
void toggleShaders() {
Screen::toggleShaders();
Notifier::get()->show({Lang::getText("[NOTIFICATIONS] 13") + " " + boolToOnOff(Options::video.shaders)});
// Activa o desactiva los efectos PostFX
void togglePostFX() {
Screen::togglePostFX();
Notifier::get()->show({Lang::getText("[NOTIFICATIONS] 13") + " " + boolToOnOff(Options::video.postfx)});
}
// Avanza al siguiente preset PostFX
void nextPostFXPreset() {
Screen::nextPostFXPreset();
const std::string name = Options::postfx_presets.empty() ? "" : Options::postfx_presets.at(static_cast<size_t>(Options::current_postfx_preset)).name;
Notifier::get()->show({"PostFX: " + name});
}
// Activa o desactiva el supersampling 3x
void toggleSupersampling() {
Screen::toggleSupersampling();
Notifier::get()->show({"3x SS: " + boolToOnOff(Options::video.supersampling)});
}
// Cambia al siguiente idioma
@@ -169,7 +182,6 @@ namespace GlobalInputs {
{Action::TOGGLE_AUDIO, toggleAudio},
{Action::TOGGLE_AUTO_FIRE, toggleFireMode},
{Action::CHANGE_LANG, setNextLang},
{Action::TOGGLE_VIDEO_SHADERS, toggleShaders},
{Action::TOGGLE_VIDEO_INTEGER_SCALE, toggleIntegerScale},
{Action::TOGGLE_VIDEO_VSYNC, toggleVSync},
#ifdef _DEBUG
@@ -177,13 +189,29 @@ namespace GlobalInputs {
#endif
};
return std::ranges::any_of(ACTIONS, [](const auto& pair) -> auto {
if (Input::get()->checkAction(pair.first, Input::DO_NOT_ALLOW_REPEAT, Input::CHECK_KEYBOARD)) {
pair.second();
return true;
if (std::ranges::any_of(ACTIONS, [](const auto& pair) -> auto {
if (Input::get()->checkAction(pair.first, Input::DO_NOT_ALLOW_REPEAT, Input::CHECK_KEYBOARD)) {
pair.second();
return true;
}
return false;
})) {
return true;
}
// F4 con modificadores: Ctrl+F4 = supersampling, Shift+F4 = siguiente preset, F4 = toggle PostFX
if (Input::get()->checkAction(Input::Action::TOGGLE_VIDEO_POSTFX, Input::DO_NOT_ALLOW_REPEAT, Input::CHECK_KEYBOARD)) {
if ((SDL_GetModState() & SDL_KMOD_CTRL) != 0U) {
toggleSupersampling();
} else if (Options::video.postfx && ((SDL_GetModState() & SDL_KMOD_SHIFT) != 0U)) {
nextPostFXPreset();
} else {
togglePostFX();
}
return false;
});
return true;
}
return false;
}
// Comprueba el resto de entradas