2019-06-22 22:26:52 +03:00
|
|
|
mod abtest;
|
2019-10-31 06:44:27 +03:00
|
|
|
mod challenges;
|
2019-04-29 02:29:19 +03:00
|
|
|
mod common;
|
2019-06-22 19:48:42 +03:00
|
|
|
mod debug;
|
2019-06-22 21:03:37 +03:00
|
|
|
mod edit;
|
2019-04-24 01:08:36 +03:00
|
|
|
mod game;
|
2019-04-29 19:56:01 +03:00
|
|
|
mod helpers;
|
2019-06-22 23:01:42 +03:00
|
|
|
mod mission;
|
2018-08-10 23:28:34 +03:00
|
|
|
mod render;
|
2019-04-25 19:41:19 +03:00
|
|
|
mod sandbox;
|
2019-06-22 23:53:03 +03:00
|
|
|
mod splash_screen;
|
2019-06-22 23:45:05 +03:00
|
|
|
mod tutorial;
|
2018-08-10 23:28:34 +03:00
|
|
|
mod ui;
|
|
|
|
|
2019-09-19 03:29:34 +03:00
|
|
|
use crate::ui::Flags;
|
|
|
|
use abstutil::CmdArgs;
|
|
|
|
use sim::SimFlags;
|
2018-03-13 18:04:21 +03:00
|
|
|
|
|
|
|
fn main() {
|
2019-09-19 03:29:34 +03:00
|
|
|
let mut args = CmdArgs::new();
|
2019-11-01 23:33:02 +03:00
|
|
|
|
|
|
|
// TODO Lift this out of the game crate entirely.
|
|
|
|
if args.enabled("--prebake") {
|
|
|
|
challenges::prebake();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-09-19 03:29:34 +03:00
|
|
|
let mut flags = Flags {
|
|
|
|
sim_flags: SimFlags::from_args(&mut args),
|
|
|
|
kml: args.optional("--kml"),
|
|
|
|
draw_lane_markings: !args.enabled("--dont_draw_lane_markings"),
|
2019-09-19 20:42:16 +03:00
|
|
|
num_agents: args.optional_parse("--num_agents", |s| s.parse()),
|
2019-10-08 00:54:42 +03:00
|
|
|
textures: args.enabled("--textures"),
|
2019-11-07 21:00:44 +03:00
|
|
|
dev: args.enabled("--dev"),
|
2019-09-19 03:29:34 +03:00
|
|
|
};
|
2019-11-21 08:57:52 +03:00
|
|
|
if flags.dev {
|
2019-09-19 03:29:34 +03:00
|
|
|
flags.sim_flags.rng_seed = Some(42);
|
|
|
|
}
|
2019-10-07 19:45:53 +03:00
|
|
|
let mut settings = ezgui::Settings::new("A/B Street", (1800.0, 800.0));
|
|
|
|
if args.enabled("--enable_profiler") {
|
|
|
|
settings.enable_profiling();
|
|
|
|
}
|
2019-10-07 20:39:09 +03:00
|
|
|
if let Some(n) = args.optional_parse("--font_size", |s| s.parse::<usize>()) {
|
|
|
|
settings.default_font_size(n);
|
|
|
|
}
|
2019-09-19 03:29:34 +03:00
|
|
|
args.done();
|
|
|
|
|
2019-10-07 19:45:53 +03:00
|
|
|
ezgui::run(settings, |ctx| game::Game::new(flags, ctx));
|
2019-04-22 03:18:09 +03:00
|
|
|
}
|