summaryrefslogtreecommitdiff
path: root/game/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'game/src/main.rs')
-rw-r--r--game/src/main.rs68
1 files changed, 24 insertions, 44 deletions
diff --git a/game/src/main.rs b/game/src/main.rs
index a44f317..1ab49fe 100644
--- a/game/src/main.rs
+++ b/game/src/main.rs
@@ -1,49 +1,29 @@
-#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
-mod arch {
- use argh::FromArgs;
- use game::Game;
- use graphics::WindowBuilder;
+use argh::FromArgs;
+use game::Game;
+use graphics::WindowBuilder;
- /// Play a dungeon crawl game
- #[derive(FromArgs)]
- struct Args {
- /// enable vsync
- #[argh(switch)]
- vsync: bool,
- /// enable verbose logging
- #[argh(switch, short = 'v')]
- verbose: bool,
- /// set the map seed
- #[argh(option)]
- seed: Option<u64>,
- }
-
- pub fn main() -> graphics::Result<()> {
- // Parse arguments
- let args: Args = argh::from_env();
- // Load the window
- let window = WindowBuilder::new()
- .vsync(args.vsync)
- .verbose(args.verbose)
- .build()?;
- Game::new(window, args.seed).run();
- Ok(())
- }
-}
-
-#[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "windows")))]
-mod arch {
- use game::Game;
- use graphics::WindowBuilder;
-
- pub fn main() -> graphics::Result<()> {
- // Load the window
- let window = WindowBuilder::new().build()?;
- Game::new(window, None).run();
- Ok(())
- }
+/// Play a dungeon crawl game
+#[derive(FromArgs)]
+struct Args {
+ /// enable vsync
+ #[argh(switch)]
+ vsync: bool,
+ /// enable verbose logging
+ #[argh(switch, short = 'v')]
+ verbose: bool,
+ /// set the map seed
+ #[argh(option)]
+ seed: Option<u64>,
}
pub fn main() -> graphics::Result<()> {
- arch::main()
+ // Parse arguments
+ let args: Args = argh::from_env();
+ // Load the window
+ let window = WindowBuilder::new()
+ .vsync(args.vsync)
+ .verbose(args.verbose)
+ .build()?;
+ Game::new(window, args.seed).run();
+ Ok(())
}