Example #1
0
        public static STexture GetSkinVideoTexture(string VideoName)
        {
            int SkinIndex = GetSkinIndex();

            if (SkinIndex != -1)
            {
                for (int i = 0; i < _Skins[SkinIndex].VideoList.Count; i++)
                {
                    SkinElement sk = _Skins[SkinIndex].VideoList[i];
                    if (sk.Name == VideoName)
                    {
                        float Time = 0f;
                        if (sk.VideoIndex == -1)
                        {
                            sk.VideoIndex = CVideo.VdLoad(GetVideoFilePath(sk.Name));
                            CVideo.VdSetLoop(sk.VideoIndex, true);
                        }
                        CVideo.VdGetFrame(sk.VideoIndex, ref sk.Texture, Time, ref Time);
                        _Skins[SkinIndex].VideoList[i] = sk;
                        return(sk.Texture);
                    }
                }
            }
            return(new STexture(-1));
        }
Example #2
0
        public void PreLoad()
        {
            float VideoTime = 0f;

            while (_VideoTexture.index == -1 && VideoTime < 1f)
            {
                float dummy = 0f;
                CVideo.VdGetFrame(_VideoStream, ref _VideoTexture, 0, ref dummy);
                VideoTime += 0.05f;
            }
        }
Example #3
0
 public static STexture GetVideoTexture()
 {
     if (_Video != -1)
     {
         float vtime = 0f;
         CVideo.VdGetFrame(_Video, ref _CurrentVideoTexture, CSound.GetPosition(_CurrentMusicStream), ref vtime);
         if (_FadeTimer.ElapsedMilliseconds <= 3000L)
         {
             _CurrentVideoTexture.color.A = (_FadeTimer.ElapsedMilliseconds / 3000f);
         }
         else
         {
             _CurrentVideoTexture.color.A = 1f;
             _FadeTimer.Stop();
         }
         return(_CurrentVideoTexture);
     }
     return(new STexture(-1));
 }
Example #4
0
        public void Draw()
        {
            if (!_Finished)
            {
                float VideoTime = _VideoTimer.ElapsedMilliseconds / 1000f;
                _Finished = CVideo.VdFinished(_VideoStream);

                STexture tex = new STexture(-1);
                tex.height = 0f;
                CVideo.VdGetFrame(_VideoStream, ref tex, VideoTime, ref VideoTime);

                if (tex.height > 0)
                {
                    CDraw.RemoveTexture(ref _VideoTexture);
                    _VideoTexture = tex;
                }
            }
            RectangleF bounds = new RectangleF(0f, 0f, CSettings.iRenderW, CSettings.iRenderH);
            RectangleF rect   = new RectangleF(0f, 0f, _VideoTexture.width, _VideoTexture.height);

            CHelper.SetRect(bounds, ref rect, rect.Width / rect.Height, EAspect.Crop);

            CDraw.DrawTexture(_VideoTexture, new SRectF(rect.X, rect.Y, rect.Width, rect.Height, CSettings.zFar / 4));
        }