Skip to content

Commit

Permalink
sound fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrDIMAS committed Sep 14, 2019
1 parent 43f8fae commit 02b016b
Show file tree
Hide file tree
Showing 7 changed files with 513 additions and 929 deletions.
11 changes: 11 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ lto = false

[dependencies]
rg3d-core = { path = "../rg3d-core" }
rg3d-sound = { path = "../rg3d-sound" }
rg3d = { path = "../rg3d" }
rand = "0.7.0"
glutin = "0.21.0"
Binary file added data/Sonic_Mayhem_Collapse.wav
Binary file not shown.
Binary file removed data/Sonic_Mayhem_Collapse_22050.wav
Binary file not shown.
Binary file modified save.bin
Binary file not shown.
1,421 changes: 492 additions & 929 deletions save.txt

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use std::{
time::Instant,
rc::Rc,
io::Write,
sync::{Arc, Mutex}
};

use rg3d::{
Expand Down Expand Up @@ -46,6 +47,10 @@ use rg3d_core::{
Visit,
},
};
use rg3d_sound::{
buffer::{Buffer, BufferKind},
source::{Source, SourceKind}
};

pub struct MenuState {
save_game: Option<()>,
Expand Down Expand Up @@ -84,6 +89,10 @@ impl Game {
}))
}

let buffer = Buffer::new(Path::new("data/Sonic_Mayhem_Collapse.wav"), BufferKind::Stream).unwrap();
let source = Source::new(SourceKind::Flat, Arc::new(Mutex::new(buffer))).unwrap();
engine.get_sound_context().lock().unwrap().add_source(source);

let mut game = Game {
menu: Menu {
state: Rc::new(RefCell::new(MenuState {
Expand Down

0 comments on commit 02b016b

Please sign in to comment.