This commit is contained in:
Michael Zhang 2021-01-15 12:07:20 -06:00
parent 59a76e2db7
commit 073952598d
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
12 changed files with 74 additions and 7 deletions

17
Cargo.lock generated
View file

@ -935,9 +935,17 @@ dependencies = [
name = "framework" name = "framework"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"ndk-glue",
"winit", "winit",
] ]
[[package]]
name = "framework-example-2048"
version = "0.1.0"
dependencies = [
"framework",
]
[[package]] [[package]]
name = "fuchsia-zircon" name = "fuchsia-zircon"
version = "0.3.3" version = "0.3.3"
@ -1332,6 +1340,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"js-sys",
"wasm-bindgen",
"web-sys",
] ]
[[package]] [[package]]
@ -1743,6 +1754,10 @@ dependencies = [
"ws2_32-sys", "ws2_32-sys",
] ]
[[package]]
name = "multibuild"
version = "0.1.0"
[[package]] [[package]]
name = "ndk" name = "ndk"
version = "0.2.1" version = "0.2.1"
@ -3404,7 +3419,9 @@ dependencies = [
"percent-encoding", "percent-encoding",
"raw-window-handle", "raw-window-handle",
"smithay-client-toolkit", "smithay-client-toolkit",
"wasm-bindgen",
"wayland-client", "wayland-client",
"web-sys",
"winapi 0.3.9", "winapi 0.3.9",
"x11-dl", "x11-dl",
] ]

View file

@ -11,6 +11,8 @@ debug = true
members = [ members = [
"bass-sys", "bass-sys",
"framework", "framework",
"framework-example-2048",
"multibuild",
] ]
[dependencies] [dependencies]
@ -33,3 +35,9 @@ rev = "81677d5ed88936c4a3e64af951ff0ae523c2d403"
[features] [features]
clippy = [] clippy = []
[package.metadata.android]
apk_label = "OSU editor"
target_sdk_version = 30
min_sdk_version = 26
fullscreen = true

View file

@ -0,0 +1,11 @@
[package]
name = "framework-example-2048"
version = "0.1.0"
authors = ["Michael Zhang <mail@mzhang.io>"]
edition = "2018"
[lib]
crate-type = ["lib", "cdylib"]
[dependencies]
framework = { path = "../framework" }

View file

View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

View file

@ -5,4 +5,7 @@ authors = ["Michael Zhang <mail@mzhang.io>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
winit = "0.24.0" winit = { version = "0.24.0", features = ["web-sys"] }
[target.'cfg(target_os = "android")'.dependencies]
ndk-glue = "0.2.1"

View file

@ -0,0 +1,12 @@
windowing:
- winit on desktop
- probably doesn't exist on mobile?
- simulated in browser?
rendering:
- gfx can probably handle all platforms
audio:
- un4seen bass for desktop
- shim for wrapping audio APIs

View file

@ -1,4 +0,0 @@
use framework::Game;
fn main() {
}

View file

@ -2,3 +2,8 @@ mod game;
mod renderer; mod renderer;
pub use crate::game::Game; pub use crate::game::Game;
#[cfg_attr(target_os = "android", ndk_glue::main(backtrace = "on"))]
pub fn android_main() {
println!("hello, world!");
}

9
multibuild/Cargo.toml Normal file
View file

@ -0,0 +1,9 @@
[package]
name = "multibuild"
version = "0.1.0"
authors = ["Michael Zhang <mail@mzhang.io>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

3
multibuild/src/main.rs Normal file
View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}

View file

@ -223,8 +223,8 @@ impl Game {
} }
let mut playfield_hitobjects = Vec::new(); let mut playfield_hitobjects = Vec::new();
let preempt = (self.beatmap.inner.difficulty.approach_preempt() as f64) / 1000.0; let preempt = 1.5 * (self.beatmap.inner.difficulty.approach_preempt() as f64) / 1000.0;
let fade_in = (self.beatmap.inner.difficulty.approach_fade_time() as f64) / 1000.0; let fade_in = 1.5 * (self.beatmap.inner.difficulty.approach_fade_time() as f64) / 1000.0;
// TODO: tighten this loop even more by binary searching for the start of the timeline and // TODO: tighten this loop even more by binary searching for the start of the timeline and
// playfield hitobjects rather than looping through the entire beatmap, better yet, just // playfield hitobjects rather than looping through the entire beatmap, better yet, just