feat(effects): heat-haze sinusoidal al fons del títol (configurable a ui.yaml)
This commit is contained in:
1 parent
9233bd8d75
commit
1fc3ab8e31
9 files changed
+150
-3
No files matched your search
@@ -102,6 +102,12 @@ UiConfig::UiConfig()
|
||||
title_copyright_color_(Defaults::UI::Title::COPYRIGHT_COLOR),
|
||||
title_blink_visible_ms_(Defaults::UI::Title::BLINK_VISIBLE_MS),
|
||||
title_blink_hidden_ms_(Defaults::UI::Title::BLINK_HIDDEN_MS),
|
||||
title_heat_haze_{
|
||||
.enabled = Defaults::UI::Title::HeatHaze::ENABLED,
|
||||
.amplitude_px = Defaults::UI::Title::HeatHaze::AMPLITUDE_PX,
|
||||
.wavelength_px = Defaults::UI::Title::HeatHaze::WAVELENGTH_PX,
|
||||
.speed_hz = Defaults::UI::Title::HeatHaze::SPEED_HZ,
|
||||
},
|
||||
menu_select_sound_(Defaults::UI::MENU_SELECT_SOUND),
|
||||
menu_accept_sound_(Defaults::UI::MENU_ACCEPT_SOUND),
|
||||
hud_font_{.name = Defaults::UI::Font::HUD_NAME, .gif = Defaults::UI::Font::HUD_GIF, .fnt = Defaults::UI::Font::HUD_FNT, .kerning = Defaults::UI::Font::HUD_KERNING},
|
||||
@@ -218,6 +224,13 @@ void UiConfig::load(const std::string& file_path) {
|
||||
readColorIndex(t, "copyright_color", title_copyright_color_);
|
||||
readField(t, "blink_visible_ms", title_blink_visible_ms_);
|
||||
readField(t, "blink_hidden_ms", title_blink_hidden_ms_);
|
||||
if (t.contains("heat_haze")) {
|
||||
const auto& hh = t["heat_haze"];
|
||||
readField(hh, "enabled", title_heat_haze_.enabled);
|
||||
readField(hh, "amplitude_px", title_heat_haze_.amplitude_px);
|
||||
readField(hh, "wavelength_px", title_heat_haze_.wavelength_px);
|
||||
readField(hh, "speed_hz", title_heat_haze_.speed_hz);
|
||||
}
|
||||
}
|
||||
|
||||
if (yaml.contains("notifier")) {
|
||||
|
||||
@@ -82,12 +82,20 @@ class UiConfig {
|
||||
[[nodiscard]] auto pauseExitMs() const -> int { return pause_exit_ms_; }
|
||||
|
||||
// Escena TITLE (placeholder visual fins que tinguem artwork).
|
||||
struct TitleHeatHaze {
|
||||
bool enabled;
|
||||
float amplitude_px;
|
||||
float wavelength_px;
|
||||
float speed_hz;
|
||||
};
|
||||
|
||||
[[nodiscard]] auto titleDurationMs() const -> int { return title_duration_ms_; }
|
||||
[[nodiscard]] auto titleBgColor() const -> Uint8 { return title_bg_color_; }
|
||||
[[nodiscard]] auto titleTextColor() const -> Uint8 { return title_text_color_; }
|
||||
[[nodiscard]] auto titleCopyrightColor() const -> Uint8 { return title_copyright_color_; }
|
||||
[[nodiscard]] auto titleBlinkVisibleMs() const -> int { return title_blink_visible_ms_; }
|
||||
[[nodiscard]] auto titleBlinkHiddenMs() const -> int { return title_blink_hidden_ms_; }
|
||||
[[nodiscard]] auto titleHeatHaze() const -> const TitleHeatHaze& { return title_heat_haze_; }
|
||||
|
||||
// Corbes d'easing triades al YAML. Si el nom no és conegut, s'usa
|
||||
// Easing::linear com a fallback.
|
||||
@@ -159,6 +167,7 @@ class UiConfig {
|
||||
Uint8 title_copyright_color_;
|
||||
int title_blink_visible_ms_;
|
||||
int title_blink_hidden_ms_;
|
||||
TitleHeatHaze title_heat_haze_;
|
||||
|
||||
std::string menu_select_sound_;
|
||||
std::string menu_accept_sound_;
|
||||
|
||||
Reference in new issue
Block a user