build: unifica .clang-format/.clang-tidy i exclou external/ i spv/ amb dummies
This commit is contained in:
@@ -43,9 +43,9 @@ namespace Menu {
|
||||
static constexpr int SUBTITLE_H = 8 + 3; // línia de subtítol + gap
|
||||
|
||||
// --- Animació ---
|
||||
static constexpr float OPEN_SPEED = 8.0F; // 1.0 / 0.125s
|
||||
static constexpr float CLOSE_SPEED = 10.0F; // 1.0 / 0.1s (una mica més ràpida que l'obertura)
|
||||
static constexpr float HEIGHT_RATE = 12.0F; // smoothing exponencial de l'alçada (~150 ms al 90%)
|
||||
static constexpr float OPEN_SPEED = 8.0F; // 1.0 / 0.125s
|
||||
static constexpr float CLOSE_SPEED = 10.0F; // 1.0 / 0.1s (una mica més ràpida que l'obertura)
|
||||
static constexpr float HEIGHT_RATE = 12.0F; // smoothing exponencial de l'alçada (~150 ms al 90%)
|
||||
|
||||
// --- Items ---
|
||||
enum class ItemKind { Toggle,
|
||||
@@ -89,11 +89,11 @@ namespace Menu {
|
||||
// --- Estat ---
|
||||
static std::vector<Page> stack_;
|
||||
static std::unique_ptr<Text> font_;
|
||||
static float open_anim_{0.0F}; // 0 = tancat, 1 = obert
|
||||
static float open_anim_{0.0F}; // 0 = tancat, 1 = obert
|
||||
static float animated_h_{0.0F}; // alçada actual animada (smoothing cap al target visible)
|
||||
static Uint32 last_ticks_{0};
|
||||
static SDL_Scancode* capturing_{nullptr}; // != null → esperant tecla per assignar
|
||||
static bool closing_{false}; // true mentre l'animació de tancament és en curs
|
||||
static bool closing_{false}; // true mentre l'animació de tancament és en curs
|
||||
|
||||
// --- Transició entre pàgines ---
|
||||
static constexpr float TRANSITION_SPEED = 5.5F; // ~180 ms
|
||||
@@ -171,10 +171,9 @@ namespace Menu {
|
||||
}
|
||||
return std::string(Locale::get("menu.values.scaling_integer")); }, [](int dir) { Screen::get()->cycleScalingMode(dir); }, nullptr, nullptr, nullptr});
|
||||
|
||||
p.items.push_back({Locale::get("menu.items.texture_filter"), ItemKind::Cycle, [] {
|
||||
return std::string(Options::video.texture_filter == Options::TextureFilter::LINEAR
|
||||
? Locale::get("menu.values.linear")
|
||||
: Locale::get("menu.values.nearest")); }, [](int dir) { Screen::get()->cycleTextureFilter(dir); }, nullptr, nullptr, nullptr});
|
||||
p.items.push_back({Locale::get("menu.items.texture_filter"), ItemKind::Cycle, [] { return std::string(Options::video.texture_filter == Options::TextureFilter::LINEAR
|
||||
? Locale::get("menu.values.linear")
|
||||
: Locale::get("menu.values.nearest")); }, [](int dir) { Screen::get()->cycleTextureFilter(dir); }, nullptr, nullptr, nullptr});
|
||||
|
||||
p.items.push_back({Locale::get("menu.items.internal_resolution"), ItemKind::IntRange, [] {
|
||||
char buf[16];
|
||||
@@ -187,20 +186,16 @@ namespace Menu {
|
||||
|
||||
p.items.push_back({Locale::get("menu.items.shader_type"), ItemKind::Cycle, [] { return std::string(Screen::get()->getActiveShaderName()); }, [](int dir) {
|
||||
if (dir < 0) Screen::get()->prevShaderType();
|
||||
else Screen::get()->nextShaderType(); }, nullptr, nullptr,
|
||||
[] { return Options::video.shader_enabled; }});
|
||||
else Screen::get()->nextShaderType(); }, nullptr, nullptr, [] { return Options::video.shader_enabled; }});
|
||||
|
||||
p.items.push_back({Locale::get("menu.items.preset"), ItemKind::Cycle, [] { return std::string(Screen::get()->getCurrentPresetName()); }, [](int dir) {
|
||||
if (dir < 0) Screen::get()->prevPreset();
|
||||
else Screen::get()->nextPreset(); }, nullptr, nullptr,
|
||||
[] { return Options::video.shader_enabled; }});
|
||||
else Screen::get()->nextPreset(); }, nullptr, nullptr, [] { return Options::video.shader_enabled; }});
|
||||
|
||||
p.items.push_back({Locale::get("menu.items.supersampling"), ItemKind::Toggle, [] { return onOff(Options::video.supersampling); }, [](int) { Screen::get()->toggleSupersampling(); }, nullptr, nullptr,
|
||||
[] {
|
||||
p.items.push_back({Locale::get("menu.items.supersampling"), ItemKind::Toggle, [] { return onOff(Options::video.supersampling); }, [](int) { Screen::get()->toggleSupersampling(); }, nullptr, nullptr, [] {
|
||||
if (!Options::video.shader_enabled) return false;
|
||||
const char* name = Screen::get()->getActiveShaderName();
|
||||
return name && std::string(name) == "POSTFX";
|
||||
}});
|
||||
return name && std::string(name) == "POSTFX"; }});
|
||||
#endif
|
||||
|
||||
// Informació de render
|
||||
@@ -212,8 +207,7 @@ namespace Menu {
|
||||
}
|
||||
return std::string(Locale::get("menu.values.off")); }, [](int dir) { Overlay::cycleRenderInfo(dir); }, nullptr, nullptr, nullptr});
|
||||
|
||||
p.items.push_back({Locale::get("menu.items.uptime"), ItemKind::Toggle, [] { return onOff(Options::render_info.show_time); }, [](int) { Options::render_info.show_time = !Options::render_info.show_time; }, nullptr, nullptr,
|
||||
[] { return Options::render_info.position != Options::RenderInfoPosition::OFF; }});
|
||||
p.items.push_back({Locale::get("menu.items.uptime"), ItemKind::Toggle, [] { return onOff(Options::render_info.show_time); }, [](int) { Options::render_info.show_time = !Options::render_info.show_time; }, nullptr, nullptr, [] { return Options::render_info.position != Options::RenderInfoPosition::OFF; }});
|
||||
|
||||
return p;
|
||||
}
|
||||
@@ -285,15 +279,17 @@ namespace Menu {
|
||||
p.subtitle = std::string("v") + Texts::VERSION + " (" + Version::GIT_HASH + ")";
|
||||
|
||||
p.items.push_back({Locale::get("menu.items.restart"), ItemKind::Action, nullptr, nullptr, [] {
|
||||
if (Director::get()) Director::get()->requestRestart();
|
||||
},
|
||||
nullptr, nullptr});
|
||||
if (Director::get()) Director::get()->requestRestart();
|
||||
},
|
||||
nullptr,
|
||||
nullptr});
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
p.items.push_back({Locale::get("menu.items.exit_game"), ItemKind::Action, nullptr, nullptr, [] {
|
||||
if (Director::get()) Director::get()->requestQuit();
|
||||
},
|
||||
nullptr, nullptr});
|
||||
if (Director::get()) Director::get()->requestQuit();
|
||||
},
|
||||
nullptr,
|
||||
nullptr});
|
||||
#endif
|
||||
|
||||
return p;
|
||||
@@ -527,7 +523,8 @@ namespace Menu {
|
||||
}
|
||||
// Compta visibles — si cap, dibuixa placeholder (caixa totalment col·lapsada però oberta)
|
||||
int visible_count = 0;
|
||||
for (const auto& it : page.items) if (isVisible(it)) ++visible_count;
|
||||
for (const auto& it : page.items)
|
||||
if (isVisible(it)) ++visible_count;
|
||||
if (visible_count == 0) {
|
||||
const char* empty_text = Locale::get("menu.values.empty");
|
||||
int ew = font_->width(empty_text);
|
||||
|
||||
Reference in New Issue
Block a user