aboutsummaryrefslogtreecommitdiff
path: root/games/rstnode/rst-client/src/main.rs
blob: 240f302c55dfdae6161ee5d2fa9cd79f24a2b0c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! RST Node game client

#[macro_use]
extern crate tracing;

mod assets;
mod cli;
mod color;
mod constants;
mod ctx;
mod error;
mod graphics;
mod log;
mod settings;
mod state;
mod window;

#[allow(unused)]
pub(crate) use settings::{GameSettings, GraphicsSettings, WindowSettings};
pub(crate) use state::*;

fn main() {
    // Initialise logging mechanism
    log::initialise();

    // Initialise default game settings
    let mut settings = settings::default();

    // Parse commandline arguments
    cli::parse(&mut settings);

    // Initialise window context
    let mut window = window::create(&settings);

    // Load assets tree
    let assets =
        assets::load_tree(window.ctx(), &settings).unwrap_or_else(|e| fatal!("LoadError: {}!", e));
    let state = ClientState::new(settings, assets);

    window.run(state)
}