Beispiel #1
0
 public void DisposeFinal() //Used if you will not use this sound effect on this object again
 {
     if (SoundEffect != null)
     {
         SoundEffect.Dispose();
     }
 }
Beispiel #2
0
        public static void Dispose()
        {
            Debug.Log("     Sounds...");
            string[] SoundNames = LoadedSounds.Keys.ToArray();
            for (int i = 0; i < LoadedSounds.Count; i++)
            {
                SoundEffect Snd = null;
                if (LoadedSounds.TryGetValue(SoundNames[i], out Snd))
                {
                    Snd.Dispose();
                    LoadedSounds.Remove(SoundNames[i]);
                }
            }

            Debug.Log("     Textures...");
            string[] TextureNames = Loaded2DTextures.Keys.ToArray();
            for (int i = 0; i < Loaded2DTextures.Count; i++)
            {
                Texture2D Tex = null;
                if (Loaded2DTextures.TryGetValue(TextureNames[i], out Tex))
                {
                    Tex.Dispose();
                    Loaded2DTextures.Remove(TextureNames[i]);
                }
            }

            Debug.Log("     Fonts...");
            LoadedFonts.Clear();
        }
 public override void Hide()
 {
     _music.Stop();
     _music.Dispose();
     _soundEffect.Dispose();
     base.Hide();
 }
Beispiel #4
0
 public static void Stop(SoundEffect soundEffect)
 {
     if (soundEffect != null)
     {
         soundEffect.Dispose();
     }
 }
Beispiel #5
0
 public void Dispose()
 {
     if (inner != null)
     {
         inner.Dispose();
     }
 }
Beispiel #6
0
        public override void OnExit(GameTime gameTime)
        {
            KeyboardEventDispatcher.OnKeyPressed -= OnKeyPressed;

            foreach (var button in buttons)
            {
                button.OnButtonPress -= MenuScreen_OnButtonPress;
                button.OnMouseEntry  -= MenuScreen_OnMouseEntry;
                button.Dispose();
            }
            btnUp.Dispose();
            btnDown.Dispose();
            buttons = null;
            foreach (var bt in buttonsText)
            {
                bt.Dispose();
            }
            buttonsText = null;
            foreach (var t in tPanels)
            {
                t.Dispose();
            }
            tPanels = null;
            wr.Dispose();

            seHover.Dispose();
        }
Beispiel #7
0
 public static void stop()
 {
     MediaPlayer.Stop();
     pickUp.Dispose();
     small.Dispose();
     big.Dispose();
 }
Beispiel #8
0
        static void Main()
        {
            try
            {
                log4net.Config.XmlConfigurator.Configure();
                Log = log4net.LogManager.GetLogger(typeof(Program));

                Log.Info("Starting Allegiance Forms...");

                Application.ThreadException += ApplicationOnThreadException;
                AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;

                //Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Forms.Menu());
            }
            catch (Exception e)
            {
                Log.Fatal("Entry Error - Entry", e);
            }
            finally
            {
                SoundEffect.Dispose();
            }
        }
 private void Dispose(bool isDisposing)
 {
     if (isDisposing)
     {
         _xnaSoundEffect.Dispose();
     }
 }
 public void UnloadContent()
 {
     if (playerSpriteSheet != null)
     {
         playerSpriteSheet.Dispose();
         playerDeathSound.Dispose();
     }
 }
Beispiel #11
0
        public override void OnExit(GameTime gameTime)
        {
            KeyboardEventDispatcher.OnKeyPressed -= KeyboardEventDispatcher_OnKeyPressed;

            fxFire.Dispose();
            seiFire.Dispose();
            seFire.Dispose();
        }
Beispiel #12
0
        public override void OnExit(GameTime gameTime)
        {
            KeyboardEventDispatcher.OnKeyPressed -= KeyboardEventDispatcher_OnKeyPressed;

            tImage.Dispose();
            seiTheme.Dispose();
            seTheme.Dispose();
        }
 public void UnloadContent()
 {
     if (bubblesTexture != null)
     {
         bubblesTexture.Dispose();
         bubblesSound.Dispose();
     }
 }
 public override void Close()
 {
     if (mEffect != null)
     {
         mEffect.Dispose();
         mEffect = null;
     }
 }
Beispiel #15
0
        public void Dispose()
        {
            if (mSoundEffect != null)
            {
                mSoundEffect.Dispose();
            }

            mSoundEffect = null;
        }
Beispiel #16
0
        /// <summary>
        /// Unload content.
        /// </summary>
        protected override void UnloadContent()
        {
            _sndBeep.Dispose();

            if (FlxG.state != null)
            {
                FlxG.state.destroy();
            }
        }
Beispiel #17
0
 protected override void DisposeData()
 {
     base.DisposeData();
     if (effect != null)
     {
         effect.Dispose();
     }
     effect = null;
 }
        public void Uninitialize()
        {
            monoSoundEffect.Dispose();
            stereoSoundEffect.Dispose();
            continousMonoSoundEffect.Dispose();
            continousStereoSoundEffect.Dispose();

            defaultEngine.Dispose();
        }
Beispiel #19
0
 /// <summary>
 /// UnloadContent will be called once per game and is the place to unload
 /// all content.
 /// </summary>
 protected override void UnloadContent()
 {
     _grassTexture.Dispose();
     _menuMove.Dispose();
     _menuSelect.Dispose();
     _menuBack.Dispose();
     _hud.Dispose();
     _soundEffect.Dispose();
 }
Beispiel #20
0
 /// <summary>
 /// Frees up all resources used by this GDSoundStorageItem
 /// </summary>
 /// <param name="force">Whether to free up all SoundEffects strips and frames</param>
 public void Free(bool force)
 {
     // If the freeing is forced, remove all SoundEffects from memory
     if (force)
     {
         SoundFx.Dispose();
         SoundFx = null;
     }
 }
Beispiel #21
0
        public override void OnExit(GameTime gameTime)
        {
            KeyboardEventDispatcher.OnKeyPressed -= KeyboardEventDispatcher_OnKeyPressed;

            rtLightning.Dispose();
            rtLightningPrev.Dispose();
            tLightning.Dispose();
            seLightning.Dispose();
            seThunder.Dispose();
        }
        public void ReleaseEffect()
        {
            if (--mInstanceCount > 0)
            {
                return;
            }

            mSound?.Dispose();
            mSound = null;
        }
Beispiel #23
0
 public void Dispose()
 {
     if (Sound != null)
     {
         if (dispose_sound)
         {
             Sound.Dispose();
         }
     }
 }
Beispiel #24
0
 public override void Dispose()
 {
     base.Dispose();
     foreach (SoundEffectInstance sf in freeObject)
     {
         sf.Dispose();
     }
     freeObject.Clear();
     sound.Dispose();
 }
Beispiel #25
0
 public void Dispose()
 {
     if (_isDisposed)
     {
         return;
     }
     _soundEffectInstance.Stop();
     _soundEffectInstance.Dispose();
     _soundEffect.Dispose();
     _isDisposed = true;
 }
Beispiel #26
0
 public void dispose()
 {
     for (int i = 0; i < _thisInstancesId.Count; i++)
     {
         if (_thisInstancesId[i] != -1)
         {
             instances[(int)_thisInstancesId[i]].Dispose();
         }
     }
     _sound.Dispose();
 }
        /// <summary>
        /// UnloadContent will be called once per game and is the place to unload
        /// game-specific content.
        /// </summary>
        protected override void UnloadContent()
        {
            playerBulletSound.Dispose();
            enemyBulletSound.Dispose();

            playerHitSound.Dispose();

            gameOverSound.Dispose();

            dropPowerUpSound.Dispose();
            pickUpPowerUpSound.Dispose();
        }
        protected override void DisposeManagedResources()
        {
            if (effect != null)
            {
                effect.Dispose();
            }

            if (sfxInstance != null)
            {
                sfxInstance.Dispose();
            }
        }
Beispiel #29
0
        public void Dispose()
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException(this.ToString());
            }
            IsDisposed = true;

            if (soundFile != null)
            {
                soundFile.Dispose();
            }
        }
 public void Kill()
 {
     if (fscMode)
     {
         HITVM.Get().StopFSC(fsc);
     }
     else
     {
         inst.Stop();
         inst.Dispose();
         sfx.Dispose();
     }
 }