Improved Texture update handling

This commit is contained in:
Flamefire committed 2013-05-10 13:37:55 +02:00
1 parent dd96b61cae
commit a2c1ee67ad
14 files changed
+157 -116

No files matched your search

+3 -3
View File
@@ -204,7 +204,7 @@ namespace VocaluxeLib.Menu
private bool _DrawTexture()
{
CTexture texture = CBase.Theme.GetSkinTexture(_Theme.TextureName, _PartyModeID);
if (texture.OrigSize.Height > 1)
if (texture != null)
{
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
RectangleF rect;
@@ -219,7 +219,7 @@ namespace VocaluxeLib.Menu
private bool _DrawVideo()
{
CTexture videoTexture = CBase.Theme.GetSkinVideoTexture(_Theme.VideoName, _PartyModeID);
if (videoTexture.OrigSize.Height > 1)
if (videoTexture != null)
{
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
RectangleF rect;
@@ -234,7 +234,7 @@ namespace VocaluxeLib.Menu
private bool _DrawBackgroundMusicVideo()
{
CTexture videoTexture = CBase.BackgroundMusic.GetVideoTexture();
if (videoTexture.OrigSize.Height > 1)
if (videoTexture != null)
{
RectangleF bounds = new RectangleF(0f, 0f, CBase.Settings.GetRenderW(), CBase.Settings.GetRenderH());
RectangleF rect;
+12 -10
View File
@@ -438,19 +438,21 @@ namespace VocaluxeLib.Menu.SongMenu
if (_Actsong != _PreviewSelected)
_SelectSong(_PreviewSelected);
if (_Streams.Count > 0 && _Video != -1)
if (_Streams.Count <= 0 || _Video == -1)
return;
if (CBase.Video.IsFinished(_Video) || CBase.Sound.IsFinished(_Actsongstream))
{
if (CBase.Video.IsFinished(_Video) || CBase.Sound.IsFinished(_Actsongstream))
{
CBase.Video.Close(_Video);
_Video = -1;
return;
}
CBase.Video.Close(_Video);
_Video = -1;
return;
}
float time = CBase.Sound.GetPosition(_Actsongstream);
float time = CBase.Sound.GetPosition(_Actsongstream);
float vtime;
CBase.Video.GetFrame(_Video, ref _Vidtex, time, out vtime);
float vtime;
if (CBase.Video.GetFrame(_Video, ref _Vidtex, time, out vtime))
{
if (_VideoFadeTimer.ElapsedMilliseconds <= 3000L)
_Vidtex.Color.A = _VideoFadeTimer.ElapsedMilliseconds / 3000f;
else