Merge branch 'master' of git://github.com/chrisforbes/OpenRA
This commit is contained in:
Submodule Ijw.DirectX updated: 962a3a8025...fbb1468509
@@ -24,7 +24,7 @@ namespace OpenRa.Game.Effects
|
|||||||
|
|
||||||
public IEnumerable<Renderable> Render()
|
public IEnumerable<Renderable> 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,11 @@ namespace OpenRa.Game
|
|||||||
{
|
{
|
||||||
static ISoundEngine soundEngine;
|
static ISoundEngine soundEngine;
|
||||||
static Cache<string, ISoundSource> sounds;
|
static Cache<string, ISoundSource> sounds;
|
||||||
|
static ISound music;
|
||||||
|
//TODO: read these from somewhere?
|
||||||
|
static float soundVolume;
|
||||||
|
static float musicVolume;
|
||||||
|
|
||||||
|
|
||||||
static ISoundSource LoadSound(string filename)
|
static ISoundSource LoadSound(string filename)
|
||||||
{
|
{
|
||||||
@@ -27,6 +32,9 @@ namespace OpenRa.Game
|
|||||||
{
|
{
|
||||||
soundEngine = new ISoundEngine();
|
soundEngine = new ISoundEngine();
|
||||||
sounds = new Cache<string, ISoundSource>(LoadSound);
|
sounds = new Cache<string, ISoundSource>(LoadSound);
|
||||||
|
music = null;
|
||||||
|
soundVolume = soundEngine.SoundVolume;
|
||||||
|
musicVolume = soundEngine.SoundVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Play(string name)
|
public static void Play(string name)
|
||||||
@@ -35,7 +43,42 @@ namespace OpenRa.Game
|
|||||||
// todo: positioning
|
// todo: positioning
|
||||||
soundEngine.Play2D(sound, false /* loop */, false, false);
|
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)
|
public static void PlayVoice(string phrase, Actor voicedUnit)
|
||||||
{
|
{
|
||||||
if (voicedUnit == null) return;
|
if (voicedUnit == null) return;
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ namespace OpenRa.Game.Traits
|
|||||||
interface IRenderModifier { IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r); }
|
interface IRenderModifier { IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r); }
|
||||||
interface IDamageModifier { float GetDamageModifier(); }
|
interface IDamageModifier { float GetDamageModifier(); }
|
||||||
interface ISpeedModifier { float GetSpeedModifier(); }
|
interface ISpeedModifier { float GetSpeedModifier(); }
|
||||||
|
interface IPaletteModifier { void AdjustPalette(Bitmap b); }
|
||||||
interface IPips { IEnumerable<PipType> GetPips(); }
|
interface IPips { IEnumerable<PipType> GetPips(); }
|
||||||
interface ITags { IEnumerable<TagType> GetTags(); }
|
interface ITags { IEnumerable<TagType> GetTags(); }
|
||||||
interface IMovement
|
interface IMovement
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ Traits=Building, RenderBuilding, AcceptsOre, StoresOre
|
|||||||
Dimensions=3,3
|
Dimensions=3,3
|
||||||
Footprint=_x_ xxx x==
|
Footprint=_x_ xxx x==
|
||||||
SelectionPriority=3
|
SelectionPriority=3
|
||||||
OrePips=18
|
OrePips=17
|
||||||
LongDesc=Converts Ore and Gems into money
|
LongDesc=Converts Ore and Gems into money
|
||||||
[SILO]
|
[SILO]
|
||||||
Description=Silo
|
Description=Silo
|
||||||
|
|||||||
Reference in New Issue
Block a user