From 419a25e86dcdbae4910c6ea47ce908395bb3005f Mon Sep 17 00:00:00 2001 From: Villermen Date: Mon, 7 Jul 2014 19:36:41 +0200 Subject: [PATCH 1/2] Make Mix_LoadWAV_RW public It works just fine and other extension libraries have this RW function public too. Why does this one have to be private/internal? --- src/SDL2_mixer.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/SDL2_mixer.cs b/src/SDL2_mixer.cs index d5b31f4..4f9b654 100644 --- a/src/SDL2_mixer.cs +++ b/src/SDL2_mixer.cs @@ -176,15 +176,16 @@ namespace SDL2 * THIS IS AN RWops FUNCTION! */ /* IntPtr refers to a Mix_Chunk* */ - [DllImport(nativeLibName, EntryPoint = "Mix_LoadWAV_RW", CallingConvention = CallingConvention.Cdecl)] - private static extern IntPtr INTERNAL_Mix_LoadWAV_RW( + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr Mix_LoadWAV_RW( IntPtr src, int freesrc ); + public static IntPtr Mix_LoadWAV(string file) { IntPtr rwops = SDL.INTERNAL_SDL_RWFromFile(file, "rb"); - return INTERNAL_Mix_LoadWAV_RW(rwops, 1); + return Mix_LoadWAV_RW(rwops, 1); } /* IntPtr refers to a Mix_Music* */ From 1b0674efbe9760912b74124d9713f8cf3b8b01b9 Mon Sep 17 00:00:00 2001 From: Villermen Date: Mon, 7 Jul 2014 22:09:00 +0200 Subject: [PATCH 2/2] Added comments to publicized method --- src/SDL2_mixer.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/SDL2_mixer.cs b/src/SDL2_mixer.cs index 4f9b654..2f09a58 100644 --- a/src/SDL2_mixer.cs +++ b/src/SDL2_mixer.cs @@ -172,16 +172,15 @@ namespace SDL2 out int channels ); - /* These are for Mix_LoadWAV, which is a macro in the C header. - * THIS IS AN RWops FUNCTION! - */ /* IntPtr refers to a Mix_Chunk* */ + /* THIS IS AN RWops FUNCTION! */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Mix_LoadWAV_RW( IntPtr src, int freesrc ); + /* IntPtr refers to a Mix_Chunk* */ public static IntPtr Mix_LoadWAV(string file) { IntPtr rwops = SDL.INTERNAL_SDL_RWFromFile(file, "rb");