Skip to content

Commit

Permalink
feat[mixer]: allow freesrc parameter into Mix_LoadMUS_RW
Browse files Browse the repository at this point in the history
  • Loading branch information
sypwex committed Jun 2, 2024
1 parent 146cff6 commit 08c172c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sdl2/mixer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ pub trait LoaderRWops<'a> {
/// Load src for use as a sample.
fn load_wav(&self) -> Result<Chunk, String>;

fn load_music(&'a self) -> Result<Music<'a>, String>;
fn load_music(&'a self, freesrc: i32) -> Result<Music<'a>, String>;
}

impl<'a> LoaderRWops<'a> for RWops<'a> {
Expand All @@ -315,8 +315,8 @@ impl<'a> LoaderRWops<'a> for RWops<'a> {
}

/// Load src for use as music.
fn load_music(&self) -> Result<Music<'a>, String> {
let raw = unsafe { mixer::Mix_LoadMUS_RW(self.raw(), 0) };
fn load_music(&self, freesrc: i32) -> Result<Music<'a>, String> {
let raw = unsafe { mixer::Mix_LoadMUS_RW(self.raw(), freesrc) };
if raw.is_null() {
Err(get_error())
} else {
Expand Down

0 comments on commit 08c172c

Please sign in to comment.