Merge remote-tracking branch 'remotes/origin/develop' into medley

This commit is contained in:
Alexander Eckart committed 2012-03-24 17:19:04 +01:00
commit 4172f85bc8
26 files changed
+305 -76

No files matched your search

+2 -2
View File
@@ -107,8 +107,8 @@ Vocaluxe.exe -ConfigFile MyConfig.xml -ScoreFile C:\Vocaluxe\Highscores\MyHighsc
[TAB] to open the background music controls (not on all screens). [TAB] to open the background music controls (not on all screens).
Songscreen Songscreen
[R] to select a random song [CTRL] + [R] to select a random song
[F3] or [CTRL]+[F] to open/close the song search menu [F3] to open/close the song search menu
[A] to sing all songs from a category [A] to sing all songs from a category
+12 -12
View File
@@ -386,13 +386,13 @@
<ArrowRightH>40</ArrowRightH> <ArrowRightH>40</ArrowRightH>
<!--<Color>: SelectSlide color from ColorScheme (high priority)--> <!--<Color>: SelectSlide color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)--> <!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>SelectSlideColor</Color> <Color>Player1Dim</Color>
<!--<SColor>: Selected SelectSlide color from ColorScheme (high priority)--> <!--<SColor>: Selected SelectSlide color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)--> <!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>SelectSlideSColor</SColor> <SColor>Player1Dim</SColor>
<!--<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)--> <!--<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)-->
<!--or <HR>, <HG>, <HB>, <HA> (lower priority)--> <!--or <HR>, <HG>, <HB>, <HA> (lower priority)-->
<HColor>SelectSlideHColor</HColor> <HColor>Player1</HColor>
<!--<ArrowColor>: Arrow color from ColorScheme (high priority)--> <!--<ArrowColor>: Arrow color from ColorScheme (high priority)-->
<!--or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)--> <!--or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)-->
<ArrowColor>ArrowColor</ArrowColor> <ArrowColor>ArrowColor</ArrowColor>
@@ -404,7 +404,7 @@
<TextColor>TextColor</TextColor> <TextColor>TextColor</TextColor>
<!--<TextSColor>: Selected text color from ColorScheme (high priority)--> <!--<TextSColor>: Selected text color from ColorScheme (high priority)-->
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)--> <!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
<TextSColor>TextSColor</TextSColor> <TextSColor>Player1</TextSColor>
<!--<TextH>: Text height--> <!--<TextH>: Text height-->
<TextH>32,00</TextH> <TextH>32,00</TextH>
<!--<TextMaxW>: Maximum text width (if exists)--> <!--<TextMaxW>: Maximum text width (if exists)-->
@@ -451,13 +451,13 @@
<ArrowRightH>40</ArrowRightH> <ArrowRightH>40</ArrowRightH>
<!--<Color>: SelectSlide color from ColorScheme (high priority)--> <!--<Color>: SelectSlide color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)--> <!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>SelectSlideColor</Color> <Color>Player2Dim</Color>
<!--<SColor>: Selected SelectSlide color from ColorScheme (high priority)--> <!--<SColor>: Selected SelectSlide color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)--> <!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>SelectSlideSColor</SColor> <SColor>Player2Dim</SColor>
<!--<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)--> <!--<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)-->
<!--or <HR>, <HG>, <HB>, <HA> (lower priority)--> <!--or <HR>, <HG>, <HB>, <HA> (lower priority)-->
<HColor>SelectSlideHColor</HColor> <HColor>Player2</HColor>
<!--<ArrowColor>: Arrow color from ColorScheme (high priority)--> <!--<ArrowColor>: Arrow color from ColorScheme (high priority)-->
<!--or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)--> <!--or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)-->
<ArrowColor>ArrowColor</ArrowColor> <ArrowColor>ArrowColor</ArrowColor>
@@ -469,7 +469,7 @@
<TextColor>TextColor</TextColor> <TextColor>TextColor</TextColor>
<!--<TextSColor>: Selected text color from ColorScheme (high priority)--> <!--<TextSColor>: Selected text color from ColorScheme (high priority)-->
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)--> <!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
<TextSColor>TextSColor</TextSColor> <TextSColor>Player2</TextSColor>
<!--<TextH>: Text height--> <!--<TextH>: Text height-->
<TextH>32,00</TextH> <TextH>32,00</TextH>
<!--<TextMaxW>: Maximum text width (if exists)--> <!--<TextMaxW>: Maximum text width (if exists)-->
@@ -516,13 +516,13 @@
<ArrowRightH>40</ArrowRightH> <ArrowRightH>40</ArrowRightH>
<!--<Color>: SelectSlide color from ColorScheme (high priority)--> <!--<Color>: SelectSlide color from ColorScheme (high priority)-->
<!--or <R>, <G>, <B>, <A> (lower priority)--> <!--or <R>, <G>, <B>, <A> (lower priority)-->
<Color>SelectSlideColor</Color> <Color>Player3Dim</Color>
<!--<SColor>: Selected SelectSlide color from ColorScheme (high priority)--> <!--<SColor>: Selected SelectSlide color from ColorScheme (high priority)-->
<!--or <SR>, <SG>, <SB>, <SA> (lower priority)--> <!--or <SR>, <SG>, <SB>, <SA> (lower priority)-->
<SColor>SelectSlideSColor</SColor> <SColor>Player3Dim</SColor>
<!--<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)--> <!--<HColor>: Highlighted SelectSlide color from ColorScheme (high priority)-->
<!--or <HR>, <HG>, <HB>, <HA> (lower priority)--> <!--or <HR>, <HG>, <HB>, <HA> (lower priority)-->
<HColor>SelectSlideHColor</HColor> <HColor>Player3</HColor>
<!--<ArrowColor>: Arrow color from ColorScheme (high priority)--> <!--<ArrowColor>: Arrow color from ColorScheme (high priority)-->
<!--or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)--> <!--or <ArrowR>, <ArrowG>, <ArrowB>, <ArrowA> (lower priority)-->
<ArrowColor>ArrowColor</ArrowColor> <ArrowColor>ArrowColor</ArrowColor>
@@ -534,7 +534,7 @@
<TextColor>TextColor</TextColor> <TextColor>TextColor</TextColor>
<!--<TextSColor>: Selected text color from ColorScheme (high priority)--> <!--<TextSColor>: Selected text color from ColorScheme (high priority)-->
<!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)--> <!--or <TextSR>, <TextSG>, <TextSB>, <TextSA> (lower priority)-->
<TextSColor>TextSColor</TextSColor> <TextSColor>Player3</TextSColor>
<!--<TextH>: Text height--> <!--<TextH>: Text height-->
<TextH>32,00</TextH> <TextH>32,00</TextH>
<!--<TextMaxW>: Maximum text width (if exists)--> <!--<TextMaxW>: Maximum text width (if exists)-->
+36
View File
@@ -46,6 +46,42 @@
</Player6> </Player6>
</Colors> </Colors>
<ColorSchemes> <ColorSchemes>
<Player1Dim>
<R>0,000</R>
<G>0,000</G>
<B>1,000</B>
<A>0,500</A>
</Player1Dim>
<Player2Dim>
<R>1,000</R>
<G>0,000</G>
<B>0,000</B>
<A>0,500</A>
</Player2Dim>
<Player3Dim>
<R>0,000</R>
<G>1,000</G>
<B>0,000</B>
<A>0,500</A>
</Player3Dim>
<Player4Dim>
<R>0,500</R>
<G>0,000</G>
<B>1,000</B>
<A>0,500</A>
</Player4Dim>
<Player5Dim>
<R>0,000</R>
<G>0,500</G>
<B>1,000</B>
<A>0,500</A>
</Player5Dim>
<Player6Dim>
<R>1,000</R>
<G>0,000</G>
<B>0,500</B>
<A>0,500</A>
</Player6Dim>
<BackgroundColor> <BackgroundColor>
<R>0,000</R> <R>0,000</R>
<G>0,000</G> <G>0,000</G>
+36
View File
@@ -46,6 +46,42 @@
</Player6> </Player6>
</Colors> </Colors>
<ColorSchemes> <ColorSchemes>
<Player1Dim>
<R>0,000</R>
<G>0,000</G>
<B>1,000</B>
<A>0,500</A>
</Player1Dim>
<Player2Dim>
<R>1,000</R>
<G>0,000</G>
<B>0,000</B>
<A>0,500</A>
</Player2Dim>
<Player3Dim>
<R>0,000</R>
<G>1,000</G>
<B>0,000</B>
<A>0,500</A>
</Player3Dim>
<Player4Dim>
<R>0,500</R>
<G>0,000</G>
<B>1,000</B>
<A>0,500</A>
</Player4Dim>
<Player5Dim>
<R>0,000</R>
<G>0,500</G>
<B>1,000</B>
<A>0,500</A>
</Player5Dim>
<Player6Dim>
<R>1,000</R>
<G>0,000</G>
<B>0,500</B>
<A>0,500</A>
</Player6Dim>
<BackgroundColor> <BackgroundColor>
<R>0,000</R> <R>0,000</R>
<G>0,000</G> <G>0,000</G>
+36
View File
@@ -46,6 +46,42 @@
</Player6> </Player6>
</Colors> </Colors>
<ColorSchemes> <ColorSchemes>
<Player1Dim>
<R>0,000</R>
<G>0,000</G>
<B>1,000</B>
<A>0,500</A>
</Player1Dim>
<Player2Dim>
<R>1,000</R>
<G>0,000</G>
<B>0,000</B>
<A>0,500</A>
</Player2Dim>
<Player3Dim>
<R>0,000</R>
<G>1,000</G>
<B>0,000</B>
<A>0,500</A>
</Player3Dim>
<Player4Dim>
<R>0,500</R>
<G>0,000</G>
<B>1,000</B>
<A>0,500</A>
</Player4Dim>
<Player5Dim>
<R>0,000</R>
<G>0,500</G>
<B>1,000</B>
<A>0,500</A>
</Player5Dim>
<Player6Dim>
<R>1,000</R>
<G>0,000</G>
<B>0,500</B>
<A>0,500</A>
</Player6Dim>
<BackgroundColor> <BackgroundColor>
<R>0,000</R> <R>0,000</R>
<G>0,000</G> <G>0,000</G>
+36
View File
@@ -46,6 +46,42 @@
</Player6> </Player6>
</Colors> </Colors>
<ColorSchemes> <ColorSchemes>
<Player1Dim>
<R>0,000</R>
<G>0,000</G>
<B>1,000</B>
<A>0,500</A>
</Player1Dim>
<Player2Dim>
<R>1,000</R>
<G>0,000</G>
<B>0,000</B>
<A>0,500</A>
</Player2Dim>
<Player3Dim>
<R>0,000</R>
<G>1,000</G>
<B>0,000</B>
<A>0,500</A>
</Player3Dim>
<Player4Dim>
<R>0,500</R>
<G>0,000</G>
<B>1,000</B>
<A>0,500</A>
</Player4Dim>
<Player5Dim>
<R>0,000</R>
<G>0,500</G>
<B>1,000</B>
<A>0,500</A>
</Player5Dim>
<Player6Dim>
<R>1,000</R>
<G>0,000</G>
<B>0,500</B>
<A>0,500</A>
</Player6Dim>
<BackgroundColor> <BackgroundColor>
<R>0,000</R> <R>0,000</R>
<G>0,000</G> <G>0,000</G>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+10 -1
View File
@@ -277,6 +277,12 @@ namespace Vocaluxe.Base
#region Graphics #region Graphics
CHelper.TryGetEnumValueFromXML<ERenderer>("//root/Graphics/Renderer", navigator, ref Renderer); CHelper.TryGetEnumValueFromXML<ERenderer>("//root/Graphics/Renderer", navigator, ref Renderer);
CHelper.TryGetEnumValueFromXML<ETextureQuality>("//root/Graphics/TextureQuality", navigator, ref TextureQuality); CHelper.TryGetEnumValueFromXML<ETextureQuality>("//root/Graphics/TextureQuality", navigator, ref TextureQuality);
CHelper.TryGetIntValueFromXML("//root/Graphics/CoverSize", navigator, ref CoverSize);
if (CoverSize > 1024)
CoverSize = 1024;
if (CoverSize < 32)
CoverSize = 32;
CHelper.TryGetIntValueFromXML("//root/Graphics/ScreenW", navigator, ref ScreenW); CHelper.TryGetIntValueFromXML("//root/Graphics/ScreenW", navigator, ref ScreenW);
CHelper.TryGetIntValueFromXML("//root/Graphics/ScreenH", navigator, ref ScreenH); CHelper.TryGetIntValueFromXML("//root/Graphics/ScreenH", navigator, ref ScreenH);
CHelper.TryGetEnumValueFromXML<EAntiAliasingModes>("//root/Graphics/AAMode", navigator, ref AAMode); CHelper.TryGetEnumValueFromXML<EAntiAliasingModes>("//root/Graphics/AAMode", navigator, ref AAMode);
@@ -440,7 +446,10 @@ namespace Vocaluxe.Base
writer.WriteComment("TextureQuality: " + ListStrings(Enum.GetNames(typeof(ETextureQuality)))); writer.WriteComment("TextureQuality: " + ListStrings(Enum.GetNames(typeof(ETextureQuality))));
writer.WriteElementString("TextureQuality", Enum.GetName(typeof(ETextureQuality), TextureQuality)); writer.WriteElementString("TextureQuality", Enum.GetName(typeof(ETextureQuality), TextureQuality));
writer.WriteComment("CoverSize (pixels): 32, 64, 128, 256, 512, 1024 (default: 128)");
writer.WriteElementString("CoverSize", CoverSize.ToString());
writer.WriteComment("Screen width and height (pixels)"); writer.WriteComment("Screen width and height (pixels)");
writer.WriteElementString("ScreenW", ScreenW.ToString()); writer.WriteElementString("ScreenW", ScreenW.ToString());
writer.WriteElementString("ScreenH", ScreenH.ToString()); writer.WriteElementString("ScreenH", ScreenH.ToString());
+30 -2
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Text; using System.Text;
using System.Windows.Forms;
using Vocaluxe.Base; using Vocaluxe.Base;
using Vocaluxe.Lib.Draw; using Vocaluxe.Lib.Draw;
@@ -21,11 +22,38 @@ namespace Vocaluxe.Base
case ERenderer.TR_CONFIG_SOFTWARE: case ERenderer.TR_CONFIG_SOFTWARE:
_Draw = new CDrawWinForm(); _Draw = new CDrawWinForm();
break; break;
case ERenderer.TR_CONFIG_OPENGL: case ERenderer.TR_CONFIG_OPENGL:
_Draw = new COpenGL(); try
{
_Draw = new COpenGL();
}
catch (Exception e)
{
MessageBox.Show(e.Message + " - Error in initializing of OpenGL. Please check whether" +
" your graphic card drivers are up to date.");
CLog.LogError(e.Message + " - Error in initializing of OpenGL. Please check whether" +
" your graphic card drivers are up to date.");
Environment.Exit(Environment.ExitCode);
}
break; break;
case ERenderer.TR_CONFIG_DIRECT3D: case ERenderer.TR_CONFIG_DIRECT3D:
_Draw = new CDirect3D(); try
{
_Draw = new CDirect3D();
}
catch (Exception e)
{
MessageBox.Show(e.Message + " - Error in initializing of Direct3D. Please check if " +
"your DirectX redistributables and graphic card drivers are up to date. You can " +
"download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109",
CSettings.sProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
CLog.LogError(e.Message + " - Error in initializing of Direct3D. Please check if " +
"your DirectX redistributables and graphic card drivers are up to date. You can " +
"download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109");
Environment.Exit(Environment.ExitCode);
}
break; break;
default: default:
+3 -3
View File
@@ -56,7 +56,7 @@ namespace Vocaluxe.Base
private static int _NumErrors; private static int _NumErrors;
private static Stopwatch[] _BenchmarkTimer; private static Stopwatch[] _BenchmarkTimer;
private static long nanosecPerTick = (1000L * 1000L * 1000L) / Stopwatch.Frequency; private static double nanosecPerTick = (1000.0 * 1000.0 * 1000.0) / Stopwatch.Frequency;
public static void Init() public static void Init()
{ {
@@ -129,8 +129,8 @@ namespace Vocaluxe.Base
} }
float ms; float ms;
if (Stopwatch.IsHighResolution) if (Stopwatch.IsHighResolution && nanosecPerTick != 0.0)
ms = (float)(((double)nanosecPerTick * (double)_BenchmarkTimer[BenchmarkNr].ElapsedTicks) / (1000.0 * 1000.0)); ms = (float)((nanosecPerTick * _BenchmarkTimer[BenchmarkNr].ElapsedTicks) / (1000.0 * 1000.0));
else else
ms = (float)_BenchmarkTimer[BenchmarkNr].ElapsedMilliseconds; ms = (float)_BenchmarkTimer[BenchmarkNr].ElapsedMilliseconds;
+2 -2
View File
@@ -237,7 +237,7 @@ namespace Vocaluxe.Base
public static bool IsGuestProfile(int ProfileNr) public static bool IsGuestProfile(int ProfileNr)
{ {
if (ProfileNr < 0 || ProfileNr >= _Profiles.Count) if (ProfileNr < 0 || ProfileNr >= _Profiles.Count)
return false; return true; // this will prevent from saving dummy profiles to highscore db
return _Profiles[ProfileNr].GuestProfile == EOffOn.TR_CONFIG_ON; return _Profiles[ProfileNr].GuestProfile == EOffOn.TR_CONFIG_ON;
} }
@@ -246,7 +246,7 @@ namespace Vocaluxe.Base
{ {
if (ProfileNr < 0 || ProfileNr >= _Profiles.Count) if (ProfileNr < 0 || ProfileNr >= _Profiles.Count)
return false; return false;
return _Profiles[ProfileNr].GuestProfile == EOffOn.TR_CONFIG_ON; return _Profiles[ProfileNr].Active == EOffOn.TR_CONFIG_ON;
} }
public static void SetAvatar(int ProfileNr, int AvatarNr) public static void SetAvatar(int ProfileNr, int AvatarNr)
+2 -2
View File
@@ -45,9 +45,9 @@ namespace Vocaluxe.Base
public const int iVersionMajor = 0; public const int iVersionMajor = 0;
public const int iVersionMinor = 1; // milestones public const int iVersionMinor = 1; // milestones
public const int iVersionSub = 0; // steps public const int iVersionSub = 0; // steps
public const ERevision VersionRevision = ERevision.Beta; public const ERevision VersionRevision = ERevision.RC;
public const int iBuild = 57; // Increase on every published version! Never Reset! public const int iBuild = 59; // Increase on every published version! Never Reset!
public const int iDatabaseHighscoreVersion = 1; public const int iDatabaseHighscoreVersion = 1;
public const int iDatabaseCoverVersion = 1; public const int iDatabaseCoverVersion = 1;
+81 -35
View File
@@ -71,12 +71,16 @@ namespace Vocaluxe.Lib.Draw
_VerticesRotationMatrices = new Queue<Matrix>(); _VerticesRotationMatrices = new Queue<Matrix>();
_Keys = new CKeys(); _Keys = new CKeys();
_D3D = new Direct3D(); try
if (_D3D == null)
{ {
MessageBox.Show("No DirectX runtimes were found, please download and install them from http://www.microsoft.com/download/en/details.aspx?id=8109"); _D3D = new Direct3D();
CLog.LogError("No DirectX runtimes were found, please download and install them from http://www.microsoft.com/download/en/details.aspx?id=8109"); }
catch (Direct3D9NotFoundException e)
{
MessageBox.Show("No DirectX runtimes were found, please download and install them " +
"from http://www.microsoft.com/download/en/details.aspx?id=8109",
CSettings.sProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
CLog.LogError(e.Message + " - No DirectX runtimes were found, please download and install them from http://www.microsoft.com/download/en/details.aspx?id=8109");
Environment.Exit(Environment.ExitCode); Environment.Exit(Environment.ExitCode);
} }
@@ -172,14 +176,29 @@ namespace Vocaluxe.Lib.Draw
flags = CreateFlags.HardwareVertexProcessing; flags = CreateFlags.HardwareVertexProcessing;
else else
flags = CreateFlags.SoftwareVertexProcessing; flags = CreateFlags.SoftwareVertexProcessing;
_Device = new Device(_D3D, _D3D.Adapters.DefaultAdapter.Adapter, DeviceType.Hardware, Handle, flags, _PresentParameters); try
if (_Device.Disposed || _D3D.Disposed || _Device == null || _D3D == null)
{ {
MessageBox.Show("Something went wrong with device creating, please check if your DirectX redistributables and grafic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109"); _Device = new Device(_D3D, _D3D.Adapters.DefaultAdapter.Adapter, DeviceType.Hardware, Handle, flags, _PresentParameters);
CLog.LogError("Something went wrong with device creating, please check if your DirectX redistributables and grafic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109"); }
catch (Exception e)
{
MessageBox.Show("Something went wrong during device creating, please check if your DirectX redistributables " +
"and graphic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109",
CSettings.sProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
CLog.LogError(e.Message + " - Something went wrong during device creating, please check if your DirectX redistributables and grafic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109");
Environment.Exit(Environment.ExitCode); Environment.Exit(Environment.ExitCode);
} }
finally
{
if (_Device == null || _Device.Disposed)
{
MessageBox.Show("Something went wrong during device creating, please check if your DirectX redistributables " +
"and graphic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109",
CSettings.sProgramName, MessageBoxButtons.OK, MessageBoxIcon.Error);
CLog.LogError("Something went wrong during device creating, please check if your DirectX redistributables and grafic card drivers are up to date. You can download the DirectX runtimes at http://www.microsoft.com/download/en/details.aspx?id=8109");
Environment.Exit(Environment.ExitCode);
}
}
this.CenterToScreen(); this.CenterToScreen();
} }
@@ -402,25 +421,45 @@ namespace Vocaluxe.Lib.Draw
Matrix translate = Matrix.Translation(new Vector3(-CSettings.iRenderW / 2, CSettings.iRenderH / 2, 0)); Matrix translate = Matrix.Translation(new Vector3(-CSettings.iRenderW / 2, CSettings.iRenderH / 2, 0));
Matrix projection = Matrix.OrthoOffCenterLH(-CSettings.iRenderW / 2, CSettings.iRenderW / 2, -CSettings.iRenderH / 2, CSettings.iRenderH / 2, CSettings.zNear, CSettings.zFar); Matrix projection = Matrix.OrthoOffCenterLH(-CSettings.iRenderW / 2, CSettings.iRenderW / 2, -CSettings.iRenderH / 2, CSettings.iRenderH / 2, CSettings.zNear, CSettings.zFar);
_VertexBuffer = new VertexBuffer(_Device, CSettings.iVertexBufferElements * (4 * Marshal.SizeOf(typeof(TexturedColoredVertex))), Usage.WriteOnly | Usage.Dynamic, VertexFormat.Position | VertexFormat.Texture1 | VertexFormat.Diffuse, Pool.Default); _VertexBuffer = new VertexBuffer(_Device, CSettings.iVertexBufferElements * (4 * Marshal.SizeOf(typeof(TexturedColoredVertex))), Usage.WriteOnly | Usage.Dynamic, VertexFormat.Position | VertexFormat.Texture1 | VertexFormat.Diffuse, Pool.Default);
_Device.SetStreamSource(0, _VertexBuffer, 0, Marshal.SizeOf(typeof(TexturedColoredVertex)));
if (_Device.SetStreamSource(0, _VertexBuffer, 0, Marshal.SizeOf(typeof(TexturedColoredVertex))).IsFailure)
CLog.LogError("Failed to set stream source");
_Device.VertexDeclaration = TexturedColoredVertex.GetDeclaration(_Device); _Device.VertexDeclaration = TexturedColoredVertex.GetDeclaration(_Device);
_Device.SetTransform(TransformState.Projection, projection); if(_Device.SetTransform(TransformState.Projection, projection).IsFailure)
_Device.SetTransform(TransformState.World, translate); CLog.LogError("Failed to set orthogonal matrix");
_Device.SetRenderState(RenderState.CullMode, Cull.None); if(_Device.SetTransform(TransformState.World, translate).IsFailure)
_Device.SetRenderState(RenderState.AlphaBlendEnable, true); CLog.LogError("Failed to set translation matrix");
_Device.SetRenderState(RenderState.Lighting, false); if(_Device.SetRenderState(RenderState.CullMode, Cull.None).IsFailure)
_Device.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha); CLog.LogError("Failed to set cull mode");
_Device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha); if(_Device.SetRenderState(RenderState.AlphaBlendEnable, true).IsFailure)
CLog.LogError("Failed to enable alpha blending");
if(_Device.SetRenderState(RenderState.Lighting, false).IsFailure)
CLog.LogError("Failed to disable lighting");
if(_Device.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha).IsFailure)
CLog.LogError("Failed to set destination blend");
if(_Device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha).IsFailure)
CLog.LogError("Failed to set source blend");
if (_PresentParameters.Multisample != MultisampleType.None) if (_PresentParameters.Multisample != MultisampleType.None)
_Device.SetRenderState(RenderState.MultisampleAntialias, true); {
_Device.SetSamplerState(0, SamplerState.MinFilter, TextureFilter.Linear); if(_Device.SetRenderState(RenderState.MultisampleAntialias, true).IsFailure)
_Device.SetSamplerState(0, SamplerState.MagFilter, TextureFilter.Linear); CLog.LogError("Failed to set antialiasing");
_Device.SetSamplerState(0, SamplerState.MipFilter, TextureFilter.Linear); }
_Device.SetSamplerState(0, SamplerState.AddressU, TextureAddress.Clamp); if(_Device.SetSamplerState(0, SamplerState.MinFilter, TextureFilter.Linear).IsFailure)
_Device.SetSamplerState(0, SamplerState.AddressV, TextureAddress.Clamp); CLog.LogError("Failed to set min filter");
_Device.SetTextureStageState(0, TextureStage.AlphaArg1, TextureArgument.Texture); if(_Device.SetSamplerState(0, SamplerState.MagFilter, TextureFilter.Linear).IsFailure)
_Device.SetTextureStageState(0, TextureStage.AlphaArg2, TextureArgument.Diffuse); CLog.LogError("Failed to set mag filter");
_Device.SetTextureStageState(0, TextureStage.AlphaOperation, TextureOperation.Modulate); if(_Device.SetSamplerState(0, SamplerState.MipFilter, TextureFilter.Linear).IsFailure)
CLog.LogError("Failed to set mip filter");
if(_Device.SetSamplerState(0, SamplerState.AddressU, TextureAddress.Clamp).IsFailure)
CLog.LogError("Failed to set clamping on u");
if(_Device.SetSamplerState(0, SamplerState.AddressV, TextureAddress.Clamp).IsFailure)
CLog.LogError("Failed to set claming on v");
if(_Device.SetTextureStageState(0, TextureStage.AlphaArg1, TextureArgument.Texture).IsFailure)
CLog.LogError("Failed to set alpha argument 1");
if(_Device.SetTextureStageState(0, TextureStage.AlphaArg2, TextureArgument.Diffuse).IsFailure)
CLog.LogError("Failed to set alpha argument 2");
if(_Device.SetTextureStageState(0, TextureStage.AlphaOperation, TextureOperation.Modulate).IsFailure)
CLog.LogError("Failed to set alpha operation");
Int16[] indices = new Int16[6]; Int16[] indices = new Int16[6];
indices[0] = 0; indices[0] = 0;
@@ -430,7 +469,7 @@ namespace Vocaluxe.Lib.Draw
indices[4] = 2; indices[4] = 2;
indices[5] = 3; indices[5] = 3;
_IndexBuffer = new IndexBuffer(_Device, 6 * sizeof(int), Usage.WriteOnly, Pool.Managed, true); _IndexBuffer = new IndexBuffer(_Device, 6 * sizeof(Int16), Usage.WriteOnly, Pool.Managed, true);
DataStream stream = _IndexBuffer.Lock(0, 0, LockFlags.None); DataStream stream = _IndexBuffer.Lock(0, 0, LockFlags.None);
stream.WriteRange(indices); stream.WriteRange(indices);
@@ -475,12 +514,14 @@ namespace Vocaluxe.Lib.Draw
//Clear the previous Frame //Clear the previous Frame
ClearScreen(); ClearScreen();
//We want to begin drawing //We want to begin drawing
_Device.BeginScene(); if (_Device.BeginScene().IsFailure)
CLog.LogError("Failed to begin scene");
CheckQueque(); CheckQueque();
_Run = _Run && CGraphics.Draw(); _Run = _Run && CGraphics.Draw();
RenderVertexBuffer(); RenderVertexBuffer();
//We finished drawing the frame //We finished drawing the frame
_Device.EndScene(); if (_Device.EndScene().IsFailure)
CLog.LogError("Failed to end scene");
_Run = CGraphics.UpdateGameLogic(_Keys, _Mouse); _Run = CGraphics.UpdateGameLogic(_Keys, _Mouse);
try try
{ {
@@ -530,7 +571,8 @@ namespace Vocaluxe.Lib.Draw
TexturedColoredVertex.GetDeclaration(_Device).Dispose(); TexturedColoredVertex.GetDeclaration(_Device).Dispose();
_VertexBuffer.Dispose(); _VertexBuffer.Dispose();
_IndexBuffer.Dispose(); _IndexBuffer.Dispose();
_Device.Reset(_PresentParameters); if (_Device.Reset(_PresentParameters).IsFailure)
CLog.LogError("Failed to reset the device");
} }
/// <summary> /// <summary>
@@ -630,11 +672,14 @@ namespace Vocaluxe.Lib.Draw
for (int i = 0; i < _Vertices.Count; i += 4) for (int i = 0; i < _Vertices.Count; i += 4)
{ {
//Apply rotation //Apply rotation
_Device.SetTransform(TransformState.World, _VerticesRotationMatrices.Dequeue()); if (_Device.SetTransform(TransformState.World, _VerticesRotationMatrices.Dequeue()).IsFailure)
CLog.LogError("Failed to set world transformation");
//Apply texture //Apply texture
_Device.SetTexture(0, _VerticesTextures.Dequeue()); if (_Device.SetTexture(0, _VerticesTextures.Dequeue()).IsFailure)
CLog.LogError("Failed to set texture");
//Draw 2 triangles from vertexbuffer //Draw 2 triangles from vertexbuffer
_Device.DrawIndexedPrimitives(PrimitiveType.TriangleList, i, 0, 4, 0, 2); if (_Device.DrawIndexedPrimitives(PrimitiveType.TriangleList, i, 0, 4, 0, 2).IsFailure)
CLog.LogError("Failed to draw quad");
} }
//Clear the queues for the next frame //Clear the queues for the next frame
_Vertices.Clear(); _Vertices.Clear();
@@ -651,7 +696,8 @@ namespace Vocaluxe.Lib.Draw
/// </summary> /// </summary>
public void ClearScreen() public void ClearScreen()
{ {
_Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black, 1.0f, 0); if (_Device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.Black, 1.0f, 0).IsFailure)
CLog.LogError("Failed to clear the backbuffer");
} }
/// <summary> /// <summary>
+3 -6
View File
@@ -394,14 +394,12 @@ namespace Vocaluxe.Lib.Video
#region Threading #region Threading
private void DoSkip() private void DoSkip()
{ {
string extension = Path.GetExtension(_FileName); //just a workaround for the mkv-search-bug in ffmpeg
_VideoSkipTime = _Gap; _VideoSkipTime = _Gap;
_SkipTime = _Start + _Gap; _SkipTime = _Start + _Gap;
_BeforeLoop = false; _BeforeLoop = false;
if (_SkipTime > 0 && extension != ".mkv") if (_SkipTime > 0)
{ {
_VideoDecoderTime = _SkipTime; _VideoDecoderTime = _SkipTime;
try try
@@ -419,8 +417,7 @@ namespace Vocaluxe.Lib.Video
_VideoDecoderTime = 0f; _VideoDecoderTime = 0f;
try try
{ {
if (extension != ".mkv") CAcinerella.ac_seek(_videodecoder, -1, (Int64)0);
CAcinerella.ac_seek(_videodecoder, -1, (Int64)0);
} }
catch (Exception e) catch (Exception e)
{ {
+13
View File
@@ -525,6 +525,19 @@ namespace Vocaluxe.Menu
_Textures[selection] = NewTexture; _Textures[selection] = NewTexture;
} }
public bool SetSelectionByValueIndex(int ValueIndex)
{
for (int i = 0; i < _ValueIndexes.Count; i++)
{
if (_ValueIndexes[i] == ValueIndex)
{
Selection = i;
return true;
}
}
return false;
}
public bool NextValue() public bool NextValue()
{ {
if (Selection < _ValueNames.Count - 1) if (Selection < _ValueNames.Count - 1)
+1 -9
View File
@@ -223,15 +223,7 @@ namespace Vocaluxe.Screens
for (int p = 0; p < player.Length; p++) for (int p = 0; p < player.Length; p++)
{ {
bool guest = true; if (player[p].Points > CSettings.MinScoreForDB && player[p].SongFinished && !CProfiles.IsGuestProfile(player[p].ProfileID))
if (player[p].ProfileID >= 0 && player[p].ProfileID < CProfiles.NumProfiles)
{
if (CProfiles.Profiles[player[p].ProfileID].GuestProfile == EOffOn.TR_CONFIG_OFF)
guest = false;
}
if (player[p].Points > CSettings.MinScoreForDB && player[p].SongFinished && !guest)
_NewEntryIDs.Add(CDataBase.AddScore(player[p])); _NewEntryIDs.Add(CDataBase.AddScore(player[p]));
} }
} }
+2 -2
View File
@@ -183,12 +183,12 @@ namespace Vocaluxe.Screens
Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName(); Texts[htTexts(TextCategory)].Text = CSongs.GetActualCategoryName();
int song = SongMenus[htSongMenus(SongMenu)].GetActualSelection(); int song = SongMenus[htSongMenus(SongMenu)].GetActualSelection();
if ((CSongs.Category >= 0) && (song >= 0) && song < CSongs.VisibleSongs.Length) if ((CSongs.Category >= 0 || CConfig.Tabs == EOffOn.TR_CONFIG_OFF) && song >= 0 && song < CSongs.VisibleSongs.Length)
{ {
Texts[htTexts(TextSelection)].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title; Texts[htTexts(TextSelection)].Text = CSongs.VisibleSongs[song].Artist + " - " + CSongs.VisibleSongs[song].Title;
CBackgroundMusic.Pause(); CBackgroundMusic.Pause();
} }
else if ((CSongs.Category == -1) && (song >= 0) && song < CSongs.Categories.Length) else if (CSongs.Category == -1 && song >= 0 && song < CSongs.Categories.Length)
{ {
Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name; Texts[htTexts(TextSelection)].Text = CSongs.Categories[song].Name;
CBackgroundMusic.Play(); CBackgroundMusic.Play();