diff --git a/OpenRa.Game/Sound.cs b/OpenRa.Game/Sound.cs new file mode 100644 index 0000000000..8b48b6a3d7 --- /dev/null +++ b/OpenRa.Game/Sound.cs @@ -0,0 +1,60 @@ +using IjwFramework.Collections; +using IrrKlang; +using OpenRa.FileFormats; +using OpenRa.Game.GameRules; + +namespace OpenRa.Game +{ + static class Sound + { + static ISoundEngine soundEngine; + static Cache sounds; + + static ISoundSource LoadSound(string filename) + { + var data = AudLoader.LoadSound(FileSystem.Open(filename)); + return soundEngine.AddSoundSourceFromPCMData(data, filename, + new AudioFormat() + { + ChannelCount = 1, + FrameCount = data.Length / 2, + Format = SampleFormat.Signed16Bit, + SampleRate = 22050 + }); + } + + public static void Initialize() + { + soundEngine = new ISoundEngine(); + sounds = new Cache(LoadSound); + } + + public static void Play(string name) + { + var sound = sounds[name]; + // todo: positioning + soundEngine.Play2D(sound, false /* loop */, false, false); + } + + public static void PlayVoice(string phrase, Actor voicedUnit) + { + if (voicedUnit == null) return; + + var mi = voicedUnit.unitInfo as MobileInfo; + if (mi == null) return; + + var vi = Rules.VoiceInfo[mi.Voice]; + + var clip = vi.Pools.Value[phrase].GetNext(); + if (clip == null) + return; + + var variants = (voicedUnit.Owner.Race == Race.Soviet) + ? vi.SovietVariants : vi.AlliedVariants; + + var variant = variants[voicedUnit.ActorID % variants.Length]; + + Play(clip + variant); + } + } +} diff --git a/artsrc/bits.psd b/artsrc/bits.psd new file mode 100644 index 0000000000..e9b91efd0f Binary files /dev/null and b/artsrc/bits.psd differ diff --git a/interior.pal b/interior.pal deleted file mode 100644 index bb63fcdd50..0000000000 Binary files a/interior.pal and /dev/null differ diff --git a/makedist.cmd b/makedist.cmd new file mode 100644 index 0000000000..7807942a83 --- /dev/null +++ b/makedist.cmd @@ -0,0 +1,15 @@ +rmdir /s /q ..\openra-bin +mkdir ..\openra-bin +copy *.mix ..\openra-bin\ +copy *.ini ..\openra-bin\ +copy *.rem ..\openra-bin\ +copy *.til ..\openra-bin\ +copy INSTALL ..\openra-bin\ +copy LICENSE ..\openra-bin\ +copy *.fx ..\openra-bin\ +copy *.xml ..\openra-bin\ +copy specialbin.png ..\openra-bin\ +copy OpenRA.Server\bin\debug\OpenRA.Server ..\openra-bin\ +copy SequenceEditor\bin\x86\debug\SequenceEditor.exe ..\openra-bin\ +copy OpenRA.Game\bin\x86\debug\*.dll ..\openra-bin\ +copy OpenRA.Game\bin\x86\debug\OpenRa.Game.exe ..\openra-bin\ \ No newline at end of file