Fix: theme videos are not longer optional
This commit is contained in:
1 parent
15e28c8a8f
commit
1cdf2fa659
4 files changed
+24
-9
No files matched your search
@@ -18,9 +18,7 @@
|
|||||||
Minus
|
Minus
|
||||||
RepeatIcon
|
RepeatIcon
|
||||||
</Textures>
|
</Textures>
|
||||||
<Videos>
|
<Videos></Videos>
|
||||||
BG_Video
|
|
||||||
</Videos>
|
|
||||||
<Colors>
|
<Colors>
|
||||||
Player1
|
Player1
|
||||||
Player2
|
Player2
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ namespace Vocaluxe.Base
|
|||||||
public void Load(string videoName)
|
public void Load(string videoName)
|
||||||
{
|
{
|
||||||
_VideoStream = CThemes.GetSkinVideo(videoName, -1, false);
|
_VideoStream = CThemes.GetSkinVideo(videoName, -1, false);
|
||||||
|
if (_VideoStream == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
_Loaded = true;
|
_Loaded = true;
|
||||||
CVideo.Pause(_VideoStream);
|
CVideo.Pause(_VideoStream);
|
||||||
}
|
}
|
||||||
@@ -68,6 +72,11 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
|
if (!_Loaded)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!_Finished)
|
if (!_Finished)
|
||||||
{
|
{
|
||||||
float videoTime = _VideoTimer.ElapsedMilliseconds / 1000f;
|
float videoTime = _VideoTimer.ElapsedMilliseconds / 1000f;
|
||||||
@@ -83,6 +92,10 @@ namespace Vocaluxe.Base
|
|||||||
|
|
||||||
public void PreLoad()
|
public void PreLoad()
|
||||||
{
|
{
|
||||||
|
if (!_Loaded)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
bool paused = _VideoTimer.IsRunning;
|
bool paused = _VideoTimer.IsRunning;
|
||||||
if (paused)
|
if (paused)
|
||||||
CVideo.Resume(_VideoStream);
|
CVideo.Resume(_VideoStream);
|
||||||
|
|||||||
@@ -178,8 +178,8 @@ namespace Vocaluxe.Base.ThemeSystem
|
|||||||
CVideoSkinElement sk = new CVideoSkinElement {FileName = kvp.Value};
|
CVideoSkinElement sk = new CVideoSkinElement {FileName = kvp.Value};
|
||||||
if (!File.Exists(Path.Combine(_Folder, sk.FileName)))
|
if (!File.Exists(Path.Combine(_Folder, sk.FileName)))
|
||||||
{
|
{
|
||||||
CLog.LogError("Video \"" + kvp.Key + "\": (" + sk.FileName + ") not found!", true);
|
CLog.LogError("Video \"" + kvp.Key + "\": (" + sk.FileName + ") not found!");
|
||||||
return false;
|
continue;
|
||||||
}
|
}
|
||||||
_Videos.Add(kvp.Key, sk);
|
_Videos.Add(kvp.Key, sk);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -318,11 +318,15 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
private bool _DrawVideo()
|
private bool _DrawVideo()
|
||||||
{
|
{
|
||||||
CBase.Video.GetFrame(_VideoStream, _VideoStream.VideoTime);
|
if (_VideoStream != null)
|
||||||
if (_VideoStream.Texture != null)
|
|
||||||
{
|
{
|
||||||
CBase.Drawing.DrawTexture(_VideoStream.Texture, Rect, EAspect.Crop);
|
CBase.Video.GetFrame(_VideoStream, _VideoStream.VideoTime);
|
||||||
return true;
|
if (_VideoStream.Texture != null)
|
||||||
|
{
|
||||||
|
CBase.Drawing.DrawTexture(_VideoStream.Texture, Rect, EAspect.Crop);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user