refactor: separar F5 (toggle) y X (ciclo modos) en PostFX

- X ya no incluye OFF en el ciclo; si PostFX está desactivado, no hace nada
- cycleShader() cicla solo entre los 4 modos usando postfx_effect_mode_
- Eliminar postfx_cycle_idx_ (redundante, causaba desincronización)
- postfx_effect_mode_ por defecto = 3 (completo) para que F5 active completo sin --postfx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-20 18:36:45 +01:00
parent f3b029c5b6
commit 200672756c
2 changed files with 12 additions and 21 deletions

View File

@@ -1102,24 +1102,18 @@ void Engine::setPostFXParamOverrides(float vignette, float chroma) {
} }
void Engine::cycleShader() { void Engine::cycleShader() {
static const char* names[5] = { // X no hace nada si PostFX está desactivado
"PostFX desactivado", "PostFX viñeta", "PostFX scanlines", if (!postfx_enabled_) return;
"PostFX cromática", "PostFX completo"
};
postfx_cycle_idx_ = (postfx_cycle_idx_ + 1) % 5;
int cycle = postfx_cycle_idx_;
if (cycle == 0) { // Cicla solo entre los 4 modos (sin OFF)
postfx_enabled_ = false; postfx_effect_mode_ = (postfx_effect_mode_ + 1) % 4;
postfx_uniforms_.vignette_strength = 0.0f; applyPostFXPreset(postfx_effect_mode_);
postfx_uniforms_.chroma_strength = 0.0f;
postfx_uniforms_.scanline_strength = 0.0f; static constexpr const char* names[4] = {
} else { "PostFX viñeta", "PostFX scanlines",
postfx_enabled_ = true; "PostFX cromática", "PostFX completo"
postfx_effect_mode_ = cycle - 1; };
applyPostFXPreset(postfx_effect_mode_); showNotificationForAction(names[postfx_effect_mode_]);
}
showNotificationForAction(names[cycle]);
} }
void Engine::toggleIntegerScaling() { void Engine::toggleIntegerScaling() {

View File

@@ -182,14 +182,11 @@ class Engine {
// PostFX uniforms (passed to GPU each frame) // PostFX uniforms (passed to GPU each frame)
PostFXUniforms postfx_uniforms_ = {0.0f, 0.0f, 0.0f, 0.0f}; PostFXUniforms postfx_uniforms_ = {0.0f, 0.0f, 0.0f, 0.0f};
int postfx_effect_mode_ = 0; int postfx_effect_mode_ = 3;
bool postfx_enabled_ = false; bool postfx_enabled_ = false;
float postfx_override_vignette_ = -1.f; // -1 = sin override float postfx_override_vignette_ = -1.f; // -1 = sin override
float postfx_override_chroma_ = -1.f; float postfx_override_chroma_ = -1.f;
// Cicle PostFX natiu (0=OFF, 1=Vinyeta, 2=Scanlines, 3=Cromàtica, 4=Complet)
int postfx_cycle_idx_ = 0;
// Sistema de zoom dinámico // Sistema de zoom dinámico
int current_window_zoom_ = DEFAULT_WINDOW_ZOOM; int current_window_zoom_ = DEFAULT_WINDOW_ZOOM;