public void Load(string filename) { if (filename == cachedVideo) { return; } image = null; video = null; prevSprite = null; if (filename.Contains("WSA")) { if (filename.Contains("INTRO")) { LoadPalette(); } else { LoadPaletteWSA(); } anim1.ChangeSequenceGroup(filename.Replace(".", "")); anim1.Play("play"); SetSize(anim1.Image.Size.XY.ToInt2().X, anim1.Image.Size.XY.ToInt2().Y); } else { //var video1 = new CpsD2Loader(filename); //cachedVideo = filename; //Open(video1); } }
public void Load(string filename) { if (filename == cachedVideo) { return; } var video = new WsaReader(Game.ModData.DefaultFileSystem.Open(filename)); cachedVideo = filename; Open(video); }
public bool TryParseVideo(Stream s, out IVideo video) { video = null; if (!IsWsa(s)) { return(false); } video = new WsaReader(s); return(true); }
public void Open(WsaReader video) { this.video = video; stopped = true; paused = true; onComplete = () => { }; var size = Math.Max(video.Width, video.Height); var textureSize = Exts.NextPowerOf2(size); var scale = Math.Min((float)RenderBounds.Width / video.Width, (float)RenderBounds.Height / video.Height * AspectRatio); videoOrigin = new float2( RenderBounds.X + (RenderBounds.Width - scale * video.Width) / 2, RenderBounds.Y + (RenderBounds.Height - scale * video.Height * AspectRatio) / 2); // Round size to integer pixels. Round up to be consistent with the scale calculation. videoSize = new float2((int)Math.Ceiling(video.Width * scale), (int)Math.Ceiling(video.Height * AspectRatio * scale)); }
public void CloseVideo() { Stop(); video = null; }