supersampling implementat

This commit is contained in:
2026-03-22 21:55:18 +01:00
parent c87779cc09
commit 1ecb427106
10 changed files with 67 additions and 32 deletions

View File

@@ -93,6 +93,11 @@ namespace GlobalInputs {
Notifier::get()->show({Locale::get()->get(Options::video.postfx ? "ui.postfx_enabled" : "ui.postfx_disabled")});
}
void handleToggleSupersampling() {
Screen::get()->toggleSupersampling();
Notifier::get()->show({Locale::get()->get(Options::video.supersampling ? "ui.supersampling_enabled" : "ui.supersampling_disabled")});
}
void handleNextPostFXPreset() {
if (!Options::postfx_presets.empty()) {
Options::current_postfx_preset = (Options::current_postfx_preset + 1) % static_cast<int>(Options::postfx_presets.size());
@@ -146,10 +151,13 @@ namespace GlobalInputs {
}
}
if (Input::get()->checkAction(InputAction::TOGGLE_POSTFX, Input::DO_NOT_ALLOW_REPEAT)) {
if (Options::video.postfx && ((SDL_GetModState() & SDL_KMOD_SHIFT) != 0U)) {
return InputAction::NEXT_POSTFX_PRESET;
if ((SDL_GetModState() & SDL_KMOD_CTRL) != 0U) {
return InputAction::TOGGLE_SUPERSAMPLING; // Ctrl+F4
}
return InputAction::TOGGLE_POSTFX;
if (Options::video.postfx && ((SDL_GetModState() & SDL_KMOD_SHIFT) != 0U)) {
return InputAction::NEXT_POSTFX_PRESET; // Shift+F4
}
return InputAction::TOGGLE_POSTFX; // F4
}
if (Input::get()->checkAction(InputAction::NEXT_PALETTE, Input::DO_NOT_ALLOW_REPEAT)) {
return InputAction::NEXT_PALETTE;
@@ -225,6 +233,10 @@ namespace GlobalInputs {
handleNextPostFXPreset();
break;
case InputAction::TOGGLE_SUPERSAMPLING:
handleToggleSupersampling();
break;
case InputAction::NEXT_PALETTE:
handleNextPalette();
break;

View File

@@ -26,6 +26,7 @@ enum class InputAction : int { // Acciones de entrada posibles en el juego
TOGGLE_INTEGER_SCALE,
TOGGLE_POSTFX,
NEXT_POSTFX_PRESET,
TOGGLE_SUPERSAMPLING,
TOGGLE_BORDER,
TOGGLE_MUSIC,
NEXT_PALETTE,