diff --git a/Cargo.lock b/Cargo.lock index cf9d38b..0f23c8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,6 +71,15 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +dependencies = [ + "winapi", +] + [[package]] name = "anyhow" version = "1.0.37" @@ -318,6 +327,21 @@ dependencies = [ "libloading 0.6.6", ] +[[package]] +name = "clap" +version = "2.33.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +dependencies = [ + "ansi_term", + "atty", + "bitflags", + "strsim", + "textwrap", + "unicode-width", + "vec_map", +] + [[package]] name = "claxon" version = "0.4.3" @@ -561,6 +585,7 @@ dependencies = [ "num", "ordered-float 2.0.1", "stderrlog", + "structopt", ] [[package]] @@ -909,6 +934,15 @@ dependencies = [ "xi-unicode", ] +[[package]] +name = "heck" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "hermit-abi" version = "0.1.17" @@ -1586,6 +1620,30 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2 1.0.24", + "quote 1.0.8", + "syn 1.0.57", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2 1.0.24", + "quote 1.0.8", + "version_check", +] + [[package]] name = "proc-macro-hack" version = "0.5.19" @@ -2183,6 +2241,36 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "structopt" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5277acd7ee46e63e5168a80734c9f6ee81b1367a7d8772a2d765df2a3705d28c" +dependencies = [ + "clap", + "lazy_static", + "structopt-derive", +] + +[[package]] +name = "structopt-derive" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ba9cdfda491b814720b6b06e0cac513d922fc407582032e8706e9f137976f90" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2 1.0.24", + "quote 1.0.8", + "syn 1.0.57", +] + [[package]] name = "syn" version = "0.15.44" @@ -2228,6 +2316,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + [[package]] name = "thiserror" version = "1.0.23" @@ -2306,6 +2403,18 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +[[package]] +name = "unicode-segmentation" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" + +[[package]] +name = "unicode-width" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" + [[package]] name = "unicode-xid" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 96c6ccf..013643a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ log = "0.4.11" stderrlog = "0.5.0" num = "0.3.1" ordered-float = "2.0.1" +structopt = "0.3.21" [dependencies.libosu] git = "https://github.com/iptq/libosu" diff --git a/README.md b/README.md new file mode 100644 index 0000000..050f100 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +wip osu editor +============== + +running on linux +---------------- + +since the editor requires libbass.so to run, run the wrapper script run.sh instead + +running on windows +------------------ + +wrapper script isn't written yet, in this case i just copied bass.dll to the project root + +roadmap +------- + +- [ ] stacking +- [ ] fix slider overlap problem +- [ ] long term: + - [ ] new framework + +license +------- + +not sure yet, probably gpl + +includes code ported from ppy/osu, which is mit-licensed diff --git a/src/game/mod.rs b/src/game/mod.rs index 17ae341..e6cd4ec 100644 --- a/src/game/mod.rs +++ b/src/game/mod.rs @@ -73,7 +73,7 @@ impl Game { let dir = path.parent().unwrap(); let song = Sound::create(dir.join(&self.beatmap.inner.audio_filename))?; - song.set_position(28.0)?; + song.set_position(65.0)?; self.song = Some(song); Ok(()) diff --git a/src/main.rs b/src/main.rs index d43a439..c1c643d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,8 @@ extern crate anyhow; #[macro_use] extern crate log; +#[macro_use] +extern crate structopt; extern crate bass_sys as bass; mod audio; @@ -11,6 +13,7 @@ mod hit_object; mod skin; use std::env; +use std::path::PathBuf; use anyhow::Result; use ggez::{ @@ -20,6 +23,15 @@ use ggez::{ use crate::game::Game; +#[derive(StructOpt)] +struct Opt { + path: Option, + + /// Verbose mode (-v, -vv, -vvv, etc) + #[structopt(short = "v", long = "verbose", parse(from_occurrences))] + verbose: usize, +} + fn main() -> Result<()> { stderrlog::new() .module("editor") diff --git a/todo.txt b/todo.txt deleted file mode 100644 index 1f185ab..0000000 --- a/todo.txt +++ /dev/null @@ -1,3 +0,0 @@ -- stacking -- don't draw overlaps between slider segments -- timeline