Skip to content
Snippets Groups Projects
Verified Commit c391d06f authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

refactor: small clippy fixes

parent c53c2728
No related branches found
No related tags found
1 merge request!19Initial tentative audio support 🔉
Pipeline #2271 failed
...@@ -109,7 +109,7 @@ impl Emulator { ...@@ -109,7 +109,7 @@ impl Emulator {
pub fn start_graphics(&mut self, sdl: &Sdl, screen_scale: f32) { pub fn start_graphics(&mut self, sdl: &Sdl, screen_scale: f32) {
self.graphics = Some(Graphics::new( self.graphics = Some(Graphics::new(
&sdl, sdl,
self.title, self.title,
DISPLAY_WIDTH as u32, DISPLAY_WIDTH as u32,
DISPLAY_HEIGHT as u32, DISPLAY_HEIGHT as u32,
...@@ -305,19 +305,16 @@ impl Emulator { ...@@ -305,19 +305,16 @@ impl Emulator {
last_frame = self.system.ppu_frame(); last_frame = self.system.ppu_frame();
} }
match self.audio.as_mut() { if let Some(audio) = self.audio.as_mut() {
Some(audio) => { // obtains the new audio buffer and queues it into the audio
// obtains the new audio buffer and queues it into the audio // subsystem ready to be processed
// subsystem ready to be processed let audio_buffer = self
let audio_buffer = self .system
.system .audio_buffer()
.audio_buffer() .iter()
.iter() .map(|v| *v as f32 / 14.0)
.map(|v| *v as f32 / 14.0) .collect::<Vec<f32>>();
.collect::<Vec<f32>>(); audio.device.queue_audio(&audio_buffer).unwrap();
audio.device.queue_audio(&audio_buffer).unwrap();
}
None => (),
} }
// clears the audio buffer to prevent it from // clears the audio buffer to prevent it from
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment