parametres per saltarse el benchmark i per limitar el maxim de pilotes en els modes automatics

This commit is contained in:
2026-03-12 08:56:59 +01:00
parent 8e2e681b2c
commit ff6aaef7c6
3 changed files with 45 additions and 1 deletions

View File

@@ -288,7 +288,8 @@ bool Engine::initialize(int width, int height, int zoom, bool fullscreen, AppMod
}
// Benchmark de rendimiento (determina max_auto_scenario_ para modos automáticos)
runPerformanceBenchmark();
if (!skip_benchmark_)
runPerformanceBenchmark();
// Precalentar caché: shapes PNG (evitar I/O en primera activación de PNG_SHAPE)
{
@@ -554,6 +555,21 @@ void Engine::switchTexture() {
switchTextureInternal(true); // Mostrar notificación en modo manual
}
// Control manual del benchmark (--skip-benchmark, --max-balls)
void Engine::setSkipBenchmark() {
skip_benchmark_ = true;
}
void Engine::setMaxBallsOverride(int n) {
skip_benchmark_ = true;
int best = DEMO_AUTO_MIN_SCENARIO;
for (int i = DEMO_AUTO_MIN_SCENARIO; i <= DEMO_AUTO_MAX_SCENARIO; ++i) {
if (BALL_COUNT_SCENARIOS[i] <= n) best = i;
else break;
}
max_auto_scenario_ = best;
}
// Escenario custom (--custom-balls)
void Engine::setCustomScenario(int balls) {
custom_scenario_balls_ = balls;