/// <summary> /// Constructor for SuneAnimation /// </summary> /// <param name="sound">Sound system</param> /// <param name="Text">Text printer</param> public SuneAnimation(ref Sound sound, ref Text2D Text) { ticks = 0; oldTicks = 0; soundOldTicks = 0; soundOldTicks = 0; currentImage = 0; sh = new SuneTxtHandler(ref Text, false); snd = sound; //text = Text; LastPlayedDate = string.Empty; image = Util.LoadTexture(Util.CurrentExecutionPath + "/gfx/sune_sprite.bmp"); //snd.CreateSound(Sound.FileType.WAV, Util.CurrentExecutionPath + "/Samples/laugh.wav", "Sune"); snd.CreateSound(Sound.FileType.Ogg, Util.CurrentExecutionPath + "/Samples/laugh.ogg", "Sune"); }
/// <summary> /// Dispose method /// </summary> /// <param name="disposing">Is it disposing?</param> protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { // free managed resources Util.DeleteTexture(ref image); sh.Dispose(); // bugging dispose out!? //sh.Close(); sh = null; currentImage = 0; } // free native resources if there are any. System.Diagnostics.Debug.WriteLine(this.GetType().ToString() + " disposed."); disposed = true; } }