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