fix by me
This commit is contained in:
15
src/main.rs
15
src/main.rs
@@ -17,7 +17,6 @@ use iced::{
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
use std::f32::consts::PI;
|
||||
use std::time::Instant;
|
||||
|
||||
@@ -55,7 +54,6 @@ struct MyApp {
|
||||
show_save_panel: bool,
|
||||
paused: bool,
|
||||
audio_manager: AudioManager,
|
||||
default_sound: StaticSoundData,
|
||||
all_sounds: Vec<String>,
|
||||
all_saves: Vec<String>,
|
||||
current_delta: f32,
|
||||
@@ -65,12 +63,10 @@ impl MyApp {
|
||||
fn new() -> (Self, Task<Message>) {
|
||||
let manager = AudioManager::<DefaultBackend>::new(AudioManagerSettings::default())
|
||||
.expect("Error to load AudioManager");
|
||||
let sound_data = StaticSoundData::from_file("assets/tick.ogg").expect("Fail to load audio");
|
||||
(
|
||||
Self {
|
||||
time_last_frame: Instant::now(),
|
||||
audio_manager: manager,
|
||||
default_sound: sound_data.clone(),
|
||||
show_save_panel: true,
|
||||
paused: false,
|
||||
all_sounds: load_path_sounds(),
|
||||
@@ -270,17 +266,6 @@ impl MyApp {
|
||||
}
|
||||
}
|
||||
|
||||
fn dummy_sound() -> StaticSoundData {
|
||||
StaticSoundData::from_file("assets/tick.ogg").expect("Fail to load audio")
|
||||
}
|
||||
fn dummy_instant() -> Instant {
|
||||
Instant::now()
|
||||
}
|
||||
fn dummy_audio_manager() -> AudioManager {
|
||||
AudioManager::<DefaultBackend>::new(AudioManagerSettings::default())
|
||||
.expect("Error to load AudioManager")
|
||||
}
|
||||
|
||||
fn load_path_sounds() -> Vec<String> {
|
||||
let mut entries: Vec<String> = fs::read_dir("./assets")
|
||||
.unwrap()
|
||||
|
||||
Reference in New Issue
Block a user