#![cfg_attr(target_os = "macos", allow(unexpected_cfgs))]
mod debug_log;
mod network;
mod onboarding;
mod play;
mod update;
mod window_prefs;
#[cfg(target_os = "macos")]
#[macro_use]
extern crate objc;
use clap::Parser;
use play::GfxPlayArgs;
use tracing_subscriber::EnvFilter;
fn window_conf() -> macroquad::prelude::Conf {
window_prefs::window_conf()
}
#[macroquad::main(window_conf)]
async fn main() {
debug_log::install_panic_hook();
debug_log::session_log(&format!(
"flatland3-gfx v{} starting",
env!("CARGO_PKG_VERSION")
));
tracing_subscriber::fmt()
.with_env_filter(EnvFilter::from_default_env())
.init();
let args = GfxPlayArgs::parse();
if let Err(err) = play::run(args).await {
debug_log::session_log(&format!("flatland3-gfx exit error: {err:#}"));
eprintln!("flatland3-gfx: {err:#}");
std::process::exit(1);
}
debug_log::session_log("flatland3-gfx exit ok");
}