/// <summary> /// Spielt einen Ton ab (ogg) /// </summary> /// <param name="audiofile">Audiodatei (ogg)</param> /// <param name="playLooping">Looped playback?</param> /// <param name="volume">Lautstärke</param> /// <returns>ID des verwendeten Audiokanals</returns> public int SoundPlay(string audiofile, bool playLooping = false, float volume = 1.0f) { return(GLAudioEngine.SoundPlay(audiofile, playLooping, volume)); }
/// <summary> /// Stoppt die Wiedergabe aller Töne /// </summary> public void SoundStopAll() { GLAudioEngine.SoundStopAll(); }
internal void Dispose() { GLAudioEngine.SoundStopAll(); lock (_gameObjects) { _gameObjects.Clear(); _gameObjectsTBA.Clear(); _gameObjectsTBR.Clear(); } lock (_particleObjects) { _particleObjects.Clear(); _particleObjectsTBA.Clear(); _particleObjectsTBR.Clear(); } lock (_hudObjects) { _hudObjects.Clear(); _hudObjectsTBA.Clear(); _hudObjectsTBR.Clear(); } lock (_lightObjects) { _lightObjects.Clear(); _lightObjectsTBA.Clear(); _lightObjectsTBR.Clear(); } lock (_explosionObjects) { _explosionObjects.Clear(); _explosionObjectsTBA.Clear(); _explosionObjectsTBR.Clear(); } lock (KWEngine.Models) { List <string> removableModels = new List <string>(); foreach (string m in KWEngine.Models.Keys) { if (KWEngine.Models[m].AssemblyMode != SceneImporter.AssemblyMode.Internal) { KWEngine.Models[m].Dispose(); removableModels.Add(m); } } foreach (string m in removableModels) { KWEngine.Models.Remove(m); } } if (KWEngine.CustomTextures.ContainsKey(this)) { Dictionary <string, int> dict = KWEngine.CustomTextures[this]; foreach (int texId in dict.Values) { GL.DeleteTexture(texId); } dict.Clear(); KWEngine.CustomTextures.Remove(this); } }
/// <summary> /// Stoppt einen bestimmten Ton /// </summary> /// <param name="audiofile">zu stoppender Ton</param> public void SoundStop(string audiofile) { GLAudioEngine.SoundStop(audiofile); }
/// <summary> /// Stoppt den angegebenen Audiokanal /// </summary> /// <param name="sourceId">Lanalnummer</param> protected static void SoundStop(int sourceId) { GLAudioEngine.SoundStop(sourceId); }
/// <summary> /// Ändert die Lautstärke eines Tons /// </summary> /// <param name="sourceId">id der Audiospur</param> /// <param name="gain">Lautstärke (0.0f bis 1.0f)</param> public static void SoundChangeGain(int sourceId, float gain) { GLAudioEngine.SoundChangeGain(sourceId, gain); }
/// <summary> /// Lädt eine Audiodatei in den Arbeitsspeicher /// </summary> /// <param name="audiofile">Audiodatei</param> protected static void SoundPreload(string audiofile) { GLAudioEngine.SoundPreload(audiofile); }
/// <summary> /// Stoppt den angegebenen Audiokanal /// </summary> /// <param name="sourceId">Lanalnummer</param> public static void SoundStop(int sourceId) { GLAudioEngine.SoundStop(sourceId); }
/// <summary> /// Lädt eine Audiodatei in den Arbeitsspeicher /// </summary> /// <param name="audiofile">Audiodatei</param> public static void SoundPreload(string audiofile) { GLAudioEngine.SoundPreload(audiofile); }
internal void Dispose() { GLAudioEngine.SoundStopAll(); lock (_gameObjects) { _gameObjects.Clear(); _gameObjectsTBA.Clear(); _gameObjectsTBR.Clear(); } lock (_particleObjects) { _particleObjects.Clear(); _particleObjectsTBA.Clear(); _particleObjectsTBR.Clear(); } lock (_hudObjects) { _hudObjects.Clear(); _hudObjectsTBA.Clear(); _hudObjectsTBR.Clear(); } lock (_lightObjects) { CurrentWindow.InitializeFramebuffersLightsList(); for (int i = 0; i < _lightObjects.Count; i++) { if (_lightObjects[i].IsShadowCaster) { _lightObjects[i] = null; } } _lightObjects.Clear(); for (int i = 0; i < _lightObjectsTBA.Count; i++) { if (_lightObjectsTBA[i].IsShadowCaster) { _lightObjectsTBA[i] = null; } } _lightObjectsTBA.Clear(); for (int i = 0; i < _lightObjectsTBR.Count; i++) { if (_lightObjectsTBR[i].IsShadowCaster) { _lightObjectsTBR[i] = null; } } _lightObjectsTBR.Clear(); } lock (_explosionObjects) { _explosionObjects.Clear(); _explosionObjectsTBA.Clear(); _explosionObjectsTBR.Clear(); } lock (KWEngine.Models) { List <string> removableModels = new List <string>(); foreach (string m in KWEngine.Models.Keys) { if (KWEngine.Models[m].AssemblyMode != SceneImporter.AssemblyMode.Internal) { KWEngine.Models[m].Dispose(); removableModels.Add(m); } } foreach (string m in removableModels) { KWEngine.Models.Remove(m); } } if (KWEngine.CustomTextures.ContainsKey(this)) { Dictionary <string, int> dict = KWEngine.CustomTextures[this]; foreach (int texId in dict.Values) { GL.DeleteTexture(texId); } dict.Clear(); KWEngine.CustomTextures.Remove(this); } GL.Flush(); GL.Finish(); GC.Collect(GC.MaxGeneration); }