From a880562b4b5630366fddd8786b80aa36e77a46b6 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 1 Feb 2017 20:41:46 +0000 Subject: [PATCH] Add support for moving ISounds after creation. --- OpenRA.Game/Sound/SoundDevice.cs | 1 + OpenRA.Platforms.Default/OpenAlSoundEngine.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/OpenRA.Game/Sound/SoundDevice.cs b/OpenRA.Game/Sound/SoundDevice.cs index 6733b69933..cec1a2d8d0 100644 --- a/OpenRA.Game/Sound/SoundDevice.cs +++ b/OpenRA.Game/Sound/SoundDevice.cs @@ -46,5 +46,6 @@ namespace OpenRA float Volume { get; set; } float SeekPosition { get; } bool Playing { get; } + void SetPosition(WPos pos); } } diff --git a/OpenRA.Platforms.Default/OpenAlSoundEngine.cs b/OpenRA.Platforms.Default/OpenAlSoundEngine.cs index bd16126147..2985aa8e42 100644 --- a/OpenRA.Platforms.Default/OpenAlSoundEngine.cs +++ b/OpenRA.Platforms.Default/OpenAlSoundEngine.cs @@ -405,5 +405,10 @@ namespace OpenRA.Platforms.Default return state == AL10.AL_PLAYING; } } + + public void SetPosition(WPos pos) + { + AL10.alSource3f(Source, AL10.AL_POSITION, pos.X, pos.Y, pos.Z); + } } }