diff --git a/gendarme/openal.ignore b/gendarme/openal.ignore index 8e6b289..fb11c9b 100644 --- a/gendarme/openal.ignore +++ b/gendarme/openal.ignore @@ -98,6 +98,7 @@ M: System.Void OpenAL.AL10::alGenBuffers(System.IntPtr,System.UInt32&) M: System.Void OpenAL.AL10::alDeleteBuffers(System.IntPtr,System.UInt32[]) M: System.Void OpenAL.AL10::alDeleteBuffers(System.IntPtr,System.UInt32&) M: System.Boolean OpenAL.AL10::alIsBuffer(System.UInt32) +M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.IntPtr,System.IntPtr,System.IntPtr) M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Byte[],System.IntPtr,System.IntPtr) M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Int16[],System.IntPtr,System.IntPtr) M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Single[],System.IntPtr,System.IntPtr) @@ -262,6 +263,7 @@ M: System.Void OpenAL.AL10::alGenBuffers(System.IntPtr,System.UInt32&) M: System.Void OpenAL.AL10::alDeleteBuffers(System.IntPtr,System.UInt32[]) M: System.Void OpenAL.AL10::alDeleteBuffers(System.IntPtr,System.UInt32&) M: System.Boolean OpenAL.AL10::alIsBuffer(System.UInt32) +M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.IntPtr,System.IntPtr,System.IntPtr) M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Byte[],System.IntPtr,System.IntPtr) M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Int16[],System.IntPtr,System.IntPtr) M: System.Void OpenAL.AL10::alBufferData(System.UInt32,System.Int32,System.Single[],System.IntPtr,System.IntPtr) diff --git a/gendarme/sdl2.ignore b/gendarme/sdl2.ignore index 6f89099..5a07329 100644 --- a/gendarme/sdl2.ignore +++ b/gendarme/sdl2.ignore @@ -167,7 +167,6 @@ M: System.Int32 SDL2.SDL::SDL_GetTextureColorMod(System.IntPtr,System.Byte&,Syst M: System.Int32 SDL2.SDL::SDL_LockTexture(System.IntPtr,SDL2.SDL/SDL_Rect&,System.IntPtr&,System.Int32&) M: System.Int32 SDL2.SDL::SDL_LockTexture(System.IntPtr,System.IntPtr,System.IntPtr&,System.Int32&) M: System.Int32 SDL2.SDL::SDL_QueryTexture(System.IntPtr,System.UInt32&,System.Int32&,System.Int32&,System.Int32&) -M: System.Int32 SDL2.SDL::SDL_QueryTexturePixels(System.IntPtr,System.IntPtr&,System.Int32&) M: System.Int32 SDL2.SDL::SDL_RenderClear(System.IntPtr) M: System.Int32 SDL2.SDL::SDL_RenderCopy(System.IntPtr,System.IntPtr,SDL2.SDL/SDL_Rect&,SDL2.SDL/SDL_Rect&) M: System.Int32 SDL2.SDL::SDL_RenderCopy(System.IntPtr,System.IntPtr,System.IntPtr,SDL2.SDL/SDL_Rect&) @@ -470,6 +469,7 @@ M: SDL2.SDL/SDL_bool SDL2.SDL::SDL_RemoveTimer(System.Int32) M: SDL2.SDL/SDL_bool SDL2.SDL::SDL_GetWindowWMInfo(System.IntPtr,SDL2.SDL/SDL_SysWMinfo&) M: System.String SDL2.SDL::SDL_GetBasePath() M: System.String SDL2.SDL::SDL_GetPrefPath(System.String,System.String) +M: SDL2.SDL/SDL_PowerState SDL2.SDL::SDL_GetPowerInfo(System.Int32&,System.Int32&) M: System.Int32 SDL2.SDL::SDL_GetCPUCount() M: System.Int32 SDL2.SDL::SDL_GetSystemRAM() T: SDL2.SDL/SDL_bool @@ -571,6 +571,7 @@ T: SDL2.SDL/INTERNAL_mir_wminfo T: SDL2.SDL/INTERNAL_android_wminfo T: SDL2.SDL/INTERNAL_SysWMDriverUnion T: SDL2.SDL/SDL_SysWMinfo +T: SDL2.SDL/SDL_PowerState T: SDL2.SDL_image M: System.Void SDL2.SDL_image::SDL_IMAGE_VERSION(SDL2.SDL/SDL_version&) M: SDL2.SDL/SDL_version SDL2.SDL_image::IMG_LinkedVersion() @@ -923,6 +924,7 @@ T: SDL2.SDL/INTERNAL_mir_wminfo T: SDL2.SDL/INTERNAL_android_wminfo T: SDL2.SDL/INTERNAL_SysWMDriverUnion T: SDL2.SDL/SDL_SysWMinfo +T: SDL2.SDL/SDL_PowerState T: SDL2.SDL_image/IMG_InitFlags T: SDL2.SDL_mixer/MIX_InitFlags T: SDL2.SDL_mixer/Mix_Fading @@ -1068,7 +1070,6 @@ M: System.Int32 SDL2.SDL::SDL_GetTextureColorMod(System.IntPtr,System.Byte&,Syst M: System.Int32 SDL2.SDL::SDL_LockTexture(System.IntPtr,SDL2.SDL/SDL_Rect&,System.IntPtr&,System.Int32&) M: System.Int32 SDL2.SDL::SDL_LockTexture(System.IntPtr,System.IntPtr,System.IntPtr&,System.Int32&) M: System.Int32 SDL2.SDL::SDL_QueryTexture(System.IntPtr,System.UInt32&,System.Int32&,System.Int32&,System.Int32&) -M: System.Int32 SDL2.SDL::SDL_QueryTexturePixels(System.IntPtr,System.IntPtr&,System.Int32&) M: System.Int32 SDL2.SDL::SDL_RenderClear(System.IntPtr) M: System.Int32 SDL2.SDL::SDL_RenderCopy(System.IntPtr,System.IntPtr,SDL2.SDL/SDL_Rect&,SDL2.SDL/SDL_Rect&) M: System.Int32 SDL2.SDL::SDL_RenderCopy(System.IntPtr,System.IntPtr,System.IntPtr,SDL2.SDL/SDL_Rect&) @@ -1348,6 +1349,7 @@ M: SDL2.SDL/SDL_bool SDL2.SDL::SDL_RemoveTimer(System.Int32) M: SDL2.SDL/SDL_bool SDL2.SDL::SDL_GetWindowWMInfo(System.IntPtr,SDL2.SDL/SDL_SysWMinfo&) M: System.String SDL2.SDL::SDL_GetBasePath() M: System.String SDL2.SDL::SDL_GetPrefPath(System.String,System.String) +M: SDL2.SDL/SDL_PowerState SDL2.SDL::SDL_GetPowerInfo(System.Int32&,System.Int32&) M: System.Int32 SDL2.SDL::SDL_GetCPUCount() M: System.Int32 SDL2.SDL::SDL_GetSystemRAM() M: System.IntPtr SDL2.SDL_image::INTERNAL_IMG_LinkedVersion() @@ -1487,6 +1489,7 @@ T: SDL2.SDL/SDL_BlendMode T: SDL2.SDL/SDL_TextureAccess T: SDL2.SDL/SDL_TextureModulate T: SDL2.SDL/SDL_Scancode +T: SDL2.SDL/SDL_PowerState T: SDL2.SDL_mixer/Mix_Fading R: Gendarme.Rules.Naming.DoNotUseReservedInEnumValueNamesRule diff --git a/lib/OpenAL-CS b/lib/OpenAL-CS index 1babf1e..bd9bc29 160000 --- a/lib/OpenAL-CS +++ b/lib/OpenAL-CS @@ -1 +1 @@ -Subproject commit 1babf1e4baf88d843b98bf1ff7d651a2a1e7e36d +Subproject commit bd9bc29f4949274aa12f081dc2b9ae8179071fa1 diff --git a/lib/SDL2-CS b/lib/SDL2-CS index 9b6f16a..cceef27 160000 --- a/lib/SDL2-CS +++ b/lib/SDL2-CS @@ -1 +1 @@ -Subproject commit 9b6f16a23821fadd22da5eb81810410a301c81a3 +Subproject commit cceef27e502483e5b89f779d315e8ac315b07ba6 diff --git a/src/Audio/DynamicSoundEffectInstance.cs b/src/Audio/DynamicSoundEffectInstance.cs index 09d9b92..e34ab44 100644 --- a/src/Audio/DynamicSoundEffectInstance.cs +++ b/src/Audio/DynamicSoundEffectInstance.cs @@ -163,7 +163,8 @@ namespace Microsoft.Xna.Framework.Audio AudioDevice.ALDevice.SetBufferData( newBuf, channels, - buffer, // TODO: offset -flibit + buffer, + offset, count, sampleRate ); @@ -344,9 +345,13 @@ namespace Microsoft.Xna.Framework.Audio #region Public FNA Extension Methods - /* THIS IS AN EXTENSION OF THE XNA4 API! */ public void SubmitFloatBufferEXT(float[] buffer) { + SubmitFloatBufferEXT(buffer, 0, buffer.Length); + } + + public void SubmitFloatBufferEXT(float[] buffer, int offset, int count) + { /* Float samples are the typical format received from decoders. * We currently use this for the VideoPlayer. * -flibit @@ -364,6 +369,8 @@ namespace Microsoft.Xna.Framework.Audio newBuf, channels, buffer, + offset, + count, sampleRate ); diff --git a/src/Audio/IALDevice.cs b/src/Audio/IALDevice.cs index 0d5137d..d587340 100644 --- a/src/Audio/IALDevice.cs +++ b/src/Audio/IALDevice.cs @@ -37,6 +37,7 @@ namespace Microsoft.Xna.Framework.Audio IALBuffer buffer, AudioChannels channels, byte[] data, + int offset, int count, int sampleRate ); @@ -44,6 +45,8 @@ namespace Microsoft.Xna.Framework.Audio IALBuffer buffer, AudioChannels channels, float[] data, + int offset, + int count, int sampleRate ); diff --git a/src/Audio/NullDevice.cs b/src/Audio/NullDevice.cs index ef3a129..cfa52dd 100644 --- a/src/Audio/NullDevice.cs +++ b/src/Audio/NullDevice.cs @@ -92,6 +92,7 @@ namespace Microsoft.Xna.Framework.Audio IALBuffer buffer, AudioChannels channels, byte[] data, + int offset, int count, int sampleRate ) { @@ -102,6 +103,8 @@ namespace Microsoft.Xna.Framework.Audio IALBuffer buffer, AudioChannels channels, float[] data, + int offset, + int count, int sampleRate ) { // No-op, duh. diff --git a/src/Audio/OpenALDevice.cs b/src/Audio/OpenALDevice.cs index 5489fd2..65fd81a 100644 --- a/src/Audio/OpenALDevice.cs +++ b/src/Audio/OpenALDevice.cs @@ -327,16 +327,19 @@ namespace Microsoft.Xna.Framework.Audio IALBuffer buffer, AudioChannels channels, byte[] data, + int offset, int count, int sampleRate ) { + GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned); AL10.alBufferData( (buffer as OpenALBuffer).Handle, XNAToShort[(int) channels], - data, // TODO: offset -flibit + handle.AddrOfPinnedObject() + offset, (IntPtr) count, (IntPtr) sampleRate ); + handle.Free(); #if VERBOSE_AL_DEBUGGING CheckALError(); #endif @@ -346,15 +349,19 @@ namespace Microsoft.Xna.Framework.Audio IALBuffer buffer, AudioChannels channels, float[] data, + int offset, + int count, int sampleRate ) { + GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned); AL10.alBufferData( (buffer as OpenALBuffer).Handle, XNAToFloat[(int) channels], - data, - (IntPtr) (data.Length * 4), + handle.AddrOfPinnedObject() + offset, + (IntPtr) (count * 4), (IntPtr) sampleRate ); + handle.Free(); #if VERBOSE_AL_DEBUGGING CheckALError(); #endif