Merge branch 'Better_Graphics_Handling' into develop

Conflicts:
	Vocaluxe/Base/CBackgroundMusic.cs
	Vocaluxe/Base/CCover.cs
	Vocaluxe/Base/CDataBase.cs
	Vocaluxe/Base/CDraw.cs
	Vocaluxe/Base/CMain.cs
	Vocaluxe/Base/CProfiles.cs
	Vocaluxe/Base/CTheme.cs
	Vocaluxe/Base/CVideo.cs
	Vocaluxe/Base/CWebcam.cs
	Vocaluxe/Base/Fonts/CFont.cs
	Vocaluxe/Base/Fonts/CGlyph.cs
	Vocaluxe/Lib/Draw/CDirect3D.cs
	Vocaluxe/Lib/Draw/CDrawWinForm.cs
	Vocaluxe/Lib/Draw/COpenGL.cs
	Vocaluxe/Lib/Draw/IDraw.cs
	Vocaluxe/Lib/Video/CVideoDecoder.cs
	Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs
	Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs
	Vocaluxe/Lib/Video/IVideoDecoder.cs
	Vocaluxe/Lib/Webcam/CAForgeNet.cs
	Vocaluxe/Lib/Webcam/IWebcam.cs
	Vocaluxe/Screens/CScreenCredits.cs
	Vocaluxe/Screens/CScreenNames.cs
	Vocaluxe/Screens/CScreenOptionsVideo.cs
	Vocaluxe/Screens/CScreenProfiles.cs
	Vocaluxe/Screens/CScreenSing.cs
	VocaluxeLib/Menu/IMenu.cs
	VocaluxeLib/Songs/CCategory.cs
	VocaluxeLib/Songs/CSong.cs
	VocaluxeLib/Structs.cs
	VocaluxeLib/VocaluxeLib.csproj
This commit is contained in:
Flamefire committed 2013-05-19 17:53:46 +02:00
commit 9d13c32b93
56 files changed
+1579 -1772

No files matched your search

+17 -14
View File
@@ -22,6 +22,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Xml;
using VocaluxeLib.Draw;
using VocaluxeLib.PartyModes;
namespace VocaluxeLib.Menu.SongMenu
@@ -104,7 +105,7 @@ namespace VocaluxeLib.Menu.SongMenu
private readonly List<int> _Streams = new List<int>();
private int _Actsong = -1;
private int _Actsongstream = -1;
protected STexture _Vidtex = new STexture(-1);
protected CTexture _Vidtex;
protected bool _Initialized;
protected int _LastKnownNumSongs;
@@ -351,7 +352,7 @@ namespace VocaluxeLib.Menu.SongMenu
writer.WriteComment("<Color>: Tile color from ColorScheme (high priority)");
writer.WriteComment("or <R>, <G>, <B>, <A> (lower priority)");
if (_Theme.ColorName != "")
if (!String.IsNullOrEmpty(_Theme.ColorName))
writer.WriteElementString("Color", _Theme.ColorName);
else
{
@@ -438,19 +439,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
@@ -464,7 +467,7 @@ namespace VocaluxeLib.Menu.SongMenu
public virtual void OnShow()
{
_Actsongstream = -1;
_Vidtex = new STexture(-1);
_Vidtex = null;
}
public virtual void OnHide()
@@ -546,7 +549,7 @@ namespace VocaluxeLib.Menu.SongMenu
{
Init();
if (_Theme.ColorName != "")
if (!String.IsNullOrEmpty(_Theme.ColorName))
_Color = CBase.Theme.GetColor(_Theme.ColorName, _PartyModeID);
}
+10 -10
View File
@@ -22,6 +22,7 @@ using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using VocaluxeLib.Draw;
using VocaluxeLib.PartyModes;
using VocaluxeLib.Songs;
@@ -38,8 +39,8 @@ namespace VocaluxeLib.Menu.SongMenu
private CStatic _MedleyCalcIcon;
private CStatic _MedleyTagIcon;
private STexture _CoverBigTexture;
private STexture _CoverTexture;
private CTexture _CoverBigTexture;
private CTexture _CoverTexture;
private CText _Artist;
private CText _Title;
@@ -323,7 +324,7 @@ namespace VocaluxeLib.Menu.SongMenu
{
foreach (CStatic tile in _Tiles)
{
if ((tile.Texture.Index != _CoverTexture.Index) && CHelper.IsInBounds(tile.Rect, mouseEvent) && !sel)
if (tile.Texture != _CoverTexture && CHelper.IsInBounds(tile.Rect, mouseEvent) && !sel)
{
if (mouseEvent.LB || !CBase.Songs.IsInCategory())
{
@@ -371,7 +372,7 @@ namespace VocaluxeLib.Menu.SongMenu
{
foreach (CStatic tile in _Tiles)
{
if ((tile.Texture.Index != _CoverTexture.Index) && CHelper.IsInBounds(tile.Rect, mouseEvent))
if (tile.Texture != _CoverTexture && CHelper.IsInBounds(tile.Rect, mouseEvent))
{
_EnterCategory(_PreviewSelected);
mouseEvent.Handled = true;
@@ -394,7 +395,7 @@ namespace VocaluxeLib.Menu.SongMenu
else
{
// ReSharper disable ConvertIfStatementToConditionalTernaryExpression
if (tile.Texture.Index != _CoverTexture.Index)
if (tile.Texture != _CoverTexture)
// ReSharper restore ConvertIfStatementToConditionalTernaryExpression
tile.Draw(1f, tile.Rect.Z, EAspect.Crop);
else
@@ -453,18 +454,17 @@ namespace VocaluxeLib.Menu.SongMenu
_TextBG.Draw();
if (_Vidtex.Index != -1 && _Video != -1)
if (_Vidtex != null && _Video != -1)
{
if (_Vidtex.Color.A < 1)
_CoverBig.Draw(1f, EAspect.Crop);
RectangleF bounds = new RectangleF(_CoverBig.Rect.X, _CoverBig.Rect.Y, _CoverBig.Rect.W, _CoverBig.Rect.H);
RectangleF rect = new RectangleF(0f, 0f, _Vidtex.Width, _Vidtex.Height);
CHelper.SetRect(bounds, out rect, rect.Width / rect.Height, EAspect.Crop);
RectangleF rect;
CHelper.SetRect(bounds, out rect, _Vidtex.OrigAspect, EAspect.Crop);
SRectF vidRect = new SRectF(rect.X, rect.Y, rect.Width, rect.Height, _CoverBig.Rect.Z);
SRectF vidRectBounds = new SRectF(bounds.X, bounds.Y, bounds.Width, bounds.Height, 0f);
CBase.Drawing.DrawTexture(_Vidtex, vidRect, _Vidtex.Color, vidRectBounds, false);
CBase.Drawing.DrawTexture(_Vidtex, vidRect, _Vidtex.Color, vidRectBounds);
CBase.Drawing.DrawTextureReflection(_Vidtex, vidRect, _Vidtex.Color, vidRectBounds, _CoverBig.ReflectionSpace, _CoverBig.ReflectionHeight);
}
else