This commit is contained in:
2026-10-23 03:00:20 +02:00
parent 589d22aa5e
commit 7a5c77c1c8
31 changed files with 1196 additions and 44 deletions

View File

@@ -99,6 +99,7 @@ int main(int argc, char **argv) {
float seconds = 6, pedal = 1;
TwoStrokeConfig config;
bool turbo_enabled = false;
std::string turbo_name;
for (int i = 1; i < argc; i++) {
std::string key = argv[i];
if (i + 1 >= argc)
@@ -113,8 +114,9 @@ int main(int argc, char **argv) {
else if (key == "--throttle")
pedal = std::stof(value);
else if (key == "--turbo") {
if (value != "none" && value != "vz21") throw std::runtime_error("choose none or vz21 turbo");
turbo_enabled = value == "vz21";
if (value != "none" && value != "vz21" && value != "gt17") throw std::runtime_error("choose none, vz21 or gt17 turbo");
turbo_name = value;
turbo_enabled = value != "none";
}
else if (key == "--exhaust") {
if (value == "racing") config.exhaust = TwoStrokeExhaust::Racing;
@@ -143,11 +145,16 @@ int main(int argc, char **argv) {
if (!std::filesystem::path(prefix).parent_path().empty())
std::filesystem::create_directories(std::filesystem::path(prefix).parent_path());
const int frames = int(std::lround(seconds * 44100));
if (turbo_enabled && scenario != "twin") throw std::runtime_error("turbo test uses the twin scenario");
if (turbo_name.empty() && scenario == "b205") turbo_enabled = true;
if (!turbo_name.empty() && turbo_name!="none" &&
!((turbo_name=="vz21" && scenario=="twin") || (turbo_name=="gt17" && scenario=="b205")))
throw std::runtime_error("use gt17 with b205 or vz21 with twin");
if (scenario == "twin" && turbo_enabled)
capture<TurboTwinScenario>(prefix, frames, pedal, selected, config);
else if (scenario == "twin")
capture<FourStrokeTwinScenario>(prefix, frames, pedal, selected, config);
else if (scenario == "b205" && turbo_enabled)
capture<SaabTurboScenario>(prefix, frames, pedal, selected, config);
else if (scenario == "b205")
capture<SaabB205Scenario>(prefix, frames, pedal, selected, config);
else if (scenario == "two-stroke")