editor/src/main.rs

46 lines
929 B
Rust
Raw Normal View History

2021-01-08 07:21:39 +00:00
#![feature(vec_into_raw_parts)]
2021-01-05 10:17:41 +00:00
#[macro_use]
extern crate anyhow;
#[macro_use]
extern crate log;
extern crate bass_sys as bass;
mod audio;
mod game;
2021-01-08 07:21:39 +00:00
mod math;
2021-01-08 10:51:04 +00:00
mod skin;
2021-01-08 07:21:39 +00:00
mod slider_render;
use std::env;
2021-01-05 10:17:41 +00:00
use anyhow::Result;
use ggez::{
conf::{WindowMode, WindowSetup},
event, ContextBuilder,
};
use crate::game::Game;
fn main() -> Result<()> {
stderrlog::new()
.module("editor")
.module("bass_sys")
.verbosity(2)
.init()
.unwrap();
let cb = ContextBuilder::new("osu_editor", "ggez")
.add_resource_path("skin")
2021-01-05 10:17:41 +00:00
.window_setup(WindowSetup::default().title("OSU editor"))
.window_mode(WindowMode::default().dimensions(1024.0, 768.0));
let (ctx, event_loop) = &mut cb.build()?;
let mut game = Game::new()?;
2021-01-08 07:21:39 +00:00
let path = env::args().nth(1).unwrap();
game.load_beatmap(path)?;
2021-01-05 10:17:41 +00:00
event::run(ctx, event_loop, &mut game)?;
Ok(())
}