game is now independent of hexodsp/cpal
This commit is contained in:
parent
ccf86e23e4
commit
450e448649
18 changed files with 85 additions and 230 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -1,14 +1,14 @@
|
|||
#![allow(clippy::too_many_arguments)]
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
mod audio;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
mod editor;
|
||||
|
||||
mod filters;
|
||||
mod game;
|
||||
mod levels;
|
||||
mod menu;
|
||||
mod particle_effect;
|
||||
mod audio_system;
|
||||
|
||||
use bevy::{
|
||||
asset::{Asset, HandleId, LoadState},
|
||||
|
|
@ -39,12 +39,6 @@ impl LoadingAssets {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let (audio_event_sender, audio_event_receiver) =
|
||||
crossbeam_channel::bounded::<game::AudioMsg>(512);
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
std::thread::spawn(move || audio::setup(audio_event_receiver));
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
let (first_level, use_editor) = {
|
||||
let mut args = std::env::args().skip(1);
|
||||
|
|
@ -58,12 +52,12 @@ fn main() {
|
|||
|
||||
let mut app = App::new();
|
||||
app.insert_resource(Msaa { samples: 4 })
|
||||
.insert_resource(audio_event_sender)
|
||||
.insert_resource(UseEditor(use_editor))
|
||||
.add_state(AppState::Loading)
|
||||
.insert_resource(game::FirstLevel(first_level))
|
||||
.insert_resource(ClearColor(Color::BLACK))
|
||||
.add_plugins(DefaultPlugins)
|
||||
.add_plugin(audio_system::AudioSystemPlugin)
|
||||
//.add_plugin(RapierDebugRenderPlugin::default())
|
||||
//.add_plugin(bevy_inspector_egui::WorldInspectorPlugin::new())
|
||||
.add_plugin(JsonAssetPlugin::<levels::StoredLevels>::new(&[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue