From 37a8780ded7e8d95cacb22bfd0108f56cf0cc52a Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 23 Dec 2009 18:10:15 +1300 Subject: [PATCH 1/6] #12 ore pips on proc --- units.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/units.ini b/units.ini index 0078c01ace..e73f5e55c8 100755 --- a/units.ini +++ b/units.ini @@ -368,7 +368,7 @@ Traits=Building, RenderBuilding, AcceptsOre, StoresOre Dimensions=3,3 Footprint=_x_ xxx x== SelectionPriority=3 -OrePips=18 +OrePips=17 LongDesc=Converts Ore and Gems into money [SILO] Description=Silo From dd72b38f51fc0b2f285ca0854ee503854b2e5bdd Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 23 Dec 2009 18:22:50 +1300 Subject: [PATCH 2/6] update Ijw.DirectX for Texture.SetData --- Ijw.DirectX | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ijw.DirectX b/Ijw.DirectX index 962a3a8025..fbb1468509 160000 --- a/Ijw.DirectX +++ b/Ijw.DirectX @@ -1 +1 @@ -Subproject commit 962a3a80251feaeb085486572932118bdd955faa +Subproject commit fbb1468509fc358522b04ffc97b59a38dc9c9902 From f26393eec7a0b7410c9849c05e671a3c7ce8ebab Mon Sep 17 00:00:00 2001 From: Alli Date: Wed, 23 Dec 2009 19:01:38 +1300 Subject: [PATCH 3/6] Fixed MoveFlash palette --- Ijw.DirectX | 2 +- OpenRa.Game/Effects/MoveFlash.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Ijw.DirectX b/Ijw.DirectX index fbb1468509..962a3a8025 160000 --- a/Ijw.DirectX +++ b/Ijw.DirectX @@ -1 +1 @@ -Subproject commit fbb1468509fc358522b04ffc97b59a38dc9c9902 +Subproject commit 962a3a80251feaeb085486572932118bdd955faa diff --git a/OpenRa.Game/Effects/MoveFlash.cs b/OpenRa.Game/Effects/MoveFlash.cs index 5a7a94b55b..bcf0b3a8da 100644 --- a/OpenRa.Game/Effects/MoveFlash.cs +++ b/OpenRa.Game/Effects/MoveFlash.cs @@ -24,7 +24,7 @@ namespace OpenRa.Game.Effects public IEnumerable Render() { - yield return new Renderable(anim.Image, pos - .5f * anim.Image.size, 0); + yield return new Renderable(anim.Image, pos - .5f * anim.Image.size, 8); } } } From 11698e97c78f46c2dc77102c7ea06cfcad7a6804 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 23 Dec 2009 20:03:08 +1300 Subject: [PATCH 4/6] grr --- Ijw.DirectX | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ijw.DirectX b/Ijw.DirectX index 962a3a8025..fbb1468509 160000 --- a/Ijw.DirectX +++ b/Ijw.DirectX @@ -1 +1 @@ -Subproject commit 962a3a80251feaeb085486572932118bdd955faa +Subproject commit fbb1468509fc358522b04ffc97b59a38dc9c9902 From 449c07c518269c2cd63d8df31240c7e6201441e8 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 23 Dec 2009 20:26:51 +1300 Subject: [PATCH 5/6] IPaletteModifier --- OpenRa.Game/Traits/TraitsInterfaces.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/OpenRa.Game/Traits/TraitsInterfaces.cs b/OpenRa.Game/Traits/TraitsInterfaces.cs index cb8903a396..9e74ade318 100644 --- a/OpenRa.Game/Traits/TraitsInterfaces.cs +++ b/OpenRa.Game/Traits/TraitsInterfaces.cs @@ -50,6 +50,7 @@ namespace OpenRa.Game.Traits interface IRenderModifier { IEnumerable ModifyRender(Actor self, IEnumerable r); } interface IDamageModifier { float GetDamageModifier(); } interface ISpeedModifier { float GetSpeedModifier(); } + interface IPaletteModifier { void AdjustPalette(Bitmap b); } interface IPips { IEnumerable GetPips(); } interface ITags { IEnumerable GetTags(); } interface IMovement From b81fbca280b67cf1bbb76b7db2c4ebc7c867ca82 Mon Sep 17 00:00:00 2001 From: Alli Date: Wed, 23 Dec 2009 20:45:51 +1300 Subject: [PATCH 6/6] added pausing and seeking for sounds, and music tracking, and volume levels --- OpenRa.Game/Sound.cs | 45 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/OpenRa.Game/Sound.cs b/OpenRa.Game/Sound.cs index 70dac031c0..41fc97adf7 100644 --- a/OpenRa.Game/Sound.cs +++ b/OpenRa.Game/Sound.cs @@ -9,6 +9,11 @@ namespace OpenRa.Game { static ISoundEngine soundEngine; static Cache sounds; + static ISound music; + //TODO: read these from somewhere? + static float soundVolume; + static float musicVolume; + static ISoundSource LoadSound(string filename) { @@ -27,6 +32,9 @@ namespace OpenRa.Game { soundEngine = new ISoundEngine(); sounds = new Cache(LoadSound); + music = null; + soundVolume = soundEngine.SoundVolume; + musicVolume = soundEngine.SoundVolume; } public static void Play(string name) @@ -35,7 +43,42 @@ namespace OpenRa.Game // todo: positioning soundEngine.Play2D(sound, false /* loop */, false, false); } - + + public static void PlayMusic(string name) + { + var sound = sounds[name]; + music = soundEngine.Play2D(sound, true /* loop */, false, false); + music.Volume = musicVolume; + } + + public static void Pause(bool doPause) + { + soundEngine.SetAllSoundsPaused(doPause); + } + + public static void setVolume(float vol) + { + soundVolume = vol; + soundEngine.SoundVolume = vol; + } + + public static void setMusicVolume(float vol) + { + musicVolume = vol; + if (music != null) + music.Volume = vol; + } + + public static void seekMusic(uint delta) + { + if (music != null) + { + music.PlayPosition += delta; + if (music.PlayPosition < 0 || music.PlayPosition > music.PlayLength) + music.PlayPosition = 0; + } + } + public static void PlayVoice(string phrase, Actor voicedUnit) { if (voicedUnit == null) return;