activa -Wextra -Wpedantic i neteja warnings

This commit is contained in:
2026-05-19 15:42:50 +02:00
parent b65a615be2
commit d89141e014
4 changed files with 52 additions and 14 deletions
+8 -8
View File
@@ -63,7 +63,7 @@ namespace Menu {
std::function<void(int dir)> change; // per TOGGLE/CYCLE/INT_RANGE
std::function<void()> enter; // per SUBMENU i ACTION
SDL_Scancode* scancode{nullptr}; // per KEY_BIND
std::function<bool()> visible; // nullptr ⇒ sempre visible
std::function<bool()> visible{nullptr}; // nullptr ⇒ sempre visible
};
struct Page {
@@ -102,7 +102,7 @@ namespace Menu {
// --- Transició entre pàgines ---
static constexpr float TRANSITION_SPEED = 5.5F; // ~180 ms
static Page transition_outgoing{.title = "", .items = {}, .cursor = 0};
static Page transition_outgoing{.title = "", .items = {}, .cursor = 0, .subtitle = ""};
static bool transition_active{false};
static float transition_progress{1.0F};
static int transition_dir{+1}; // +1 endavant, -1 enrere
@@ -137,7 +137,7 @@ namespace Menu {
static auto buildSystem() -> Page;
static auto buildRoot() -> Page {
Page p{.title = Locale::get("menu.titles.root"), .items = {}, .cursor = 0};
Page p{.title = Locale::get("menu.titles.root"), .items = {}, .cursor = 0, .subtitle = ""};
p.items.push_back({Locale::get("menu.items.video"), ItemKind::SUBMENU, nullptr, nullptr, [] { pushPage(buildVideo()); }, nullptr});
p.items.push_back({Locale::get("menu.items.audio"), ItemKind::SUBMENU, nullptr, nullptr, [] { pushPage(buildAudio()); }, nullptr});
p.items.push_back({Locale::get("menu.items.controls"), ItemKind::SUBMENU, nullptr, nullptr, [] { pushPage(buildControls()); }, nullptr});
@@ -147,7 +147,7 @@ namespace Menu {
}
static auto buildVideo() -> Page {
Page p{.title = Locale::get("menu.titles.video"), .items = {}, .cursor = 0};
Page p{.title = Locale::get("menu.titles.video"), .items = {}, .cursor = 0, .subtitle = ""};
// Zoom i fullscreen: sense sentit a WASM (el navegador posseix el canvas)
#ifndef __EMSCRIPTEN__
@@ -235,7 +235,7 @@ namespace Menu {
}
static auto buildControls() -> Page {
Page p{.title = Locale::get("menu.titles.controls"), .items = {}, .cursor = 0};
Page p{.title = Locale::get("menu.titles.controls"), .items = {}, .cursor = 0, .subtitle = ""};
p.items.push_back({Locale::get("menu.items.move_up"), ItemKind::KEY_BIND, nullptr, nullptr, nullptr, &Options::keys_game.up});
p.items.push_back({Locale::get("menu.items.move_down"), ItemKind::KEY_BIND, nullptr, nullptr, nullptr, &Options::keys_game.down});
p.items.push_back({Locale::get("menu.items.move_left"), ItemKind::KEY_BIND, nullptr, nullptr, nullptr, &Options::keys_game.left});
@@ -245,7 +245,7 @@ namespace Menu {
}
static auto buildAudio() -> Page {
Page p{.title = Locale::get("menu.titles.audio"), .items = {}, .cursor = 0};
Page p{.title = Locale::get("menu.titles.audio"), .items = {}, .cursor = 0, .subtitle = ""};
p.items.push_back({Locale::get("menu.items.master_enable"), ItemKind::TOGGLE, [] { return onOff(Options::audio.enabled); }, [](int) {
Options::audio.enabled = !Options::audio.enabled;
@@ -269,7 +269,7 @@ namespace Menu {
}
static auto buildGame() -> Page {
Page p{.title = Locale::get("menu.titles.game"), .items = {}, .cursor = 0};
Page p{.title = Locale::get("menu.titles.game"), .items = {}, .cursor = 0, .subtitle = ""};
p.items.push_back({Locale::get("menu.items.use_new_logo"), ItemKind::TOGGLE, [] { return yesNo(Options::game.use_new_logo); }, [](int) { Options::game.use_new_logo = !Options::game.use_new_logo; }, nullptr});
@@ -281,7 +281,7 @@ namespace Menu {
}
static auto buildSystem() -> Page {
Page p{.title = Locale::get("menu.titles.system"), .items = {}, .cursor = 0};
Page p{.title = Locale::get("menu.titles.system"), .items = {}, .cursor = 0, .subtitle = ""};
p.subtitle = std::string("v") + Texts::VERSION + " (" + Version::GIT_HASH + ")";
p.items.push_back({Locale::get("menu.items.restart"), ItemKind::ACTION, nullptr, nullptr, [] {