diff --git a/Output/x64/acinerella.dll b/Output/x64/acinerella.dll index e851fd01..bd1e8749 100644 Binary files a/Output/x64/acinerella.dll and b/Output/x64/acinerella.dll differ diff --git a/Output/x64/avcodec-54.dll b/Output/x64/avcodec-54.dll index ca074e7c..80d55f54 100644 Binary files a/Output/x64/avcodec-54.dll and b/Output/x64/avcodec-54.dll differ diff --git a/Output/x64/avformat-54.dll b/Output/x64/avformat-54.dll index 40521b17..f90c2245 100644 Binary files a/Output/x64/avformat-54.dll and b/Output/x64/avformat-54.dll differ diff --git a/Output/x64/avutil-51.dll b/Output/x64/avutil-51.dll deleted file mode 100644 index 5f8cdf7d..00000000 Binary files a/Output/x64/avutil-51.dll and /dev/null differ diff --git a/Output/x64/avutil-52.dll b/Output/x64/avutil-52.dll new file mode 100644 index 00000000..f9de4518 Binary files /dev/null and b/Output/x64/avutil-52.dll differ diff --git a/Output/x64/swscale-2.dll b/Output/x64/swscale-2.dll index dcc41fd3..e8b1ff96 100644 Binary files a/Output/x64/swscale-2.dll and b/Output/x64/swscale-2.dll differ diff --git a/Output/x86/acinerella.dll b/Output/x86/acinerella.dll index 77b069fa..7989b0ef 100644 Binary files a/Output/x86/acinerella.dll and b/Output/x86/acinerella.dll differ diff --git a/Output/x86/avcodec-54.dll b/Output/x86/avcodec-54.dll index 80a08d0a..7f53dd68 100644 Binary files a/Output/x86/avcodec-54.dll and b/Output/x86/avcodec-54.dll differ diff --git a/Output/x86/avformat-54.dll b/Output/x86/avformat-54.dll index 2d250708..a05f643e 100644 Binary files a/Output/x86/avformat-54.dll and b/Output/x86/avformat-54.dll differ diff --git a/Output/x86/avutil-51.dll b/Output/x86/avutil-51.dll deleted file mode 100644 index a51a719c..00000000 Binary files a/Output/x86/avutil-51.dll and /dev/null differ diff --git a/Output/x86/avutil-52.dll b/Output/x86/avutil-52.dll new file mode 100644 index 00000000..a476fbe1 Binary files /dev/null and b/Output/x86/avutil-52.dll differ diff --git a/Output/x86/swscale-2.dll b/Output/x86/swscale-2.dll index 3a58f3a0..90f07328 100644 Binary files a/Output/x86/swscale-2.dll and b/Output/x86/swscale-2.dll differ diff --git a/Vocaluxe/Base/CBackgroundMusic.cs b/Vocaluxe/Base/CBackgroundMusic.cs index e475081c..17657e6a 100644 --- a/Vocaluxe/Base/CBackgroundMusic.cs +++ b/Vocaluxe/Base/CBackgroundMusic.cs @@ -217,7 +217,12 @@ namespace Vocaluxe.Base { if (_AllFileNames.Count > 0 && _CurrentMusicStream != -1) { - float timeToPlay = CSound.GetLength(_CurrentMusicStream) - CSound.GetPosition(_CurrentMusicStream); + float timeToPlay; + if(_CurrentPlaylistElement.Finish == 0f) //No End-Tag defined + timeToPlay = CSound.GetLength(_CurrentMusicStream) - CSound.GetPosition(_CurrentMusicStream); + else //End-Tag found + timeToPlay = _CurrentPlaylistElement.Finish - CSound.GetPosition(_CurrentMusicStream); + bool finished = CSound.IsFinished(_CurrentMusicStream); if (_Playing && (timeToPlay <= CSettings.BackgroundMusicFadeTime || finished)) Next(); @@ -248,6 +253,11 @@ namespace Vocaluxe.Base _CurrentPlaylistElement = _PreviousFileNames[_PreviousMusicIndex]; } _CurrentMusicStream = CSound.Load(_CurrentPlaylistElement.MusicFilePath); + + //Seek to #Start-Tag, if found + if (_CurrentPlaylistElement.Start != 0f) + CSound.SetPosition(_CurrentMusicStream, _CurrentPlaylistElement.Start); + if (_VideoEnabled) LoadVideo(); CSound.SetStreamVolume(_CurrentMusicStream, 0f); @@ -524,6 +534,28 @@ class PlaylistElement } } + public float Start + { + get + { + if (_Song != null) + return _Song.Start; + + return 0f; + } + } + + public float Finish + { + get + { + if (_Song != null) + return _Song.Finish; + + return 0f; + } + } + public STexture Cover { get diff --git a/Vocaluxe/Base/CSettings.cs b/Vocaluxe/Base/CSettings.cs index 5fe0fb8b..71b851c2 100644 --- a/Vocaluxe/Base/CSettings.cs +++ b/Vocaluxe/Base/CSettings.cs @@ -47,7 +47,7 @@ namespace Vocaluxe.Base public const int iVersionSub = 0; // patches public const ERevision VersionRevision = ERevision.Alpha; - public const int iBuild = 67; // Increase on every published version! Never Reset! + public const int iBuild = 68; // Increase on every published version! Never Reset! public const int iDatabaseHighscoreVersion = 1; public const int iDatabaseCoverVersion = 1; diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index 492834c9..a5a5e167 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -55,6 +55,8 @@ namespace Vocaluxe.Lib.Draw private Queue _VerticesTextures; private Queue _VerticesRotationMatrices; + private bool _NonPowerOf2TextureSupported; + #endregion private vars /// @@ -182,6 +184,13 @@ namespace Vocaluxe.Lib.Draw flags = CreateFlags.HardwareVertexProcessing; else flags = CreateFlags.SoftwareVertexProcessing; + + //Check if Pow2 textures are needed + _NonPowerOf2TextureSupported = true; + _NonPowerOf2TextureSupported &= (caps.TextureCaps & TextureCaps.Pow2) == 0; + _NonPowerOf2TextureSupported &= (caps.TextureCaps & TextureCaps.NonPow2Conditional) == 0; + _NonPowerOf2TextureSupported &= (caps.TextureCaps & TextureCaps.SquareOnly) == 0; + try { _Device = new Device(_D3D, _D3D.Adapters.DefaultAdapter.Adapter, DeviceType.Hardware, Handle, flags, _PresentParameters); @@ -477,7 +486,7 @@ namespace Vocaluxe.Lib.Draw _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.Discard); stream.WriteRange(indices); _IndexBuffer.Unlock(); _Device.Indices = _IndexBuffer; @@ -731,8 +740,8 @@ namespace Vocaluxe.Lib.Draw texture.rect = new SRectF(0f, 0f, texture.width, texture.height, 0f); texture.width = w; texture.height = h; - texture.w2 = NextPowerOfTwo(texture.width); - texture.h2 = NextPowerOfTwo(texture.height); + texture.w2 = CheckForNextPowerOf2(texture.width); + texture.h2 = CheckForNextPowerOf2(texture.height); texture.index = _IDs.Dequeue(); lock (MutexTexture) @@ -932,8 +941,8 @@ namespace Vocaluxe.Lib.Draw texture.height = h; //Older graphics card can only handle textures with sizes being powers of two - texture.w2 = (float)NextPowerOfTwo(w); - texture.h2 = (float)NextPowerOfTwo(h); + texture.w2 = (float)CheckForNextPowerOf2(w); + texture.h2 = (float)CheckForNextPowerOf2(h); //Create a new Bitmap with the new sizes Bitmap bmp2 = new Bitmap((int)texture.w2, (int)texture.h2); @@ -957,7 +966,7 @@ namespace Vocaluxe.Lib.Draw //because a copy of the texture is hold in the Ram Texture t = new Texture(_Device, (int)texture.w2, (int)texture.h2, 0, Usage.AutoGenerateMipMap, Format.A8R8G8B8, Pool.Managed); //Lock the texture and fill it with the data - DataRectangle rect = t.LockRectangle(0, LockFlags.None); + DataRectangle rect = t.LockRectangle(0, LockFlags.Discard); for (int i = 0; i < Data.Length; ) { rect.Data.Write(Data, i, 4 * bmp2.Width); @@ -1027,13 +1036,13 @@ namespace Vocaluxe.Lib.Draw STexture texture = new STexture(-1); texture.width = W; texture.height = H; - texture.w2 = NextPowerOfTwo(texture.width); - texture.h2 = NextPowerOfTwo(texture.height); + texture.w2 = CheckForNextPowerOf2(texture.width); + texture.h2 = CheckForNextPowerOf2(texture.height); texture.width_ratio = texture.width / texture.w2; texture.height_ratio = texture.height / texture.h2; Texture t = new Texture(_Device, (int)texture.w2, (int)texture.h2, 0, Usage.AutoGenerateMipMap, Format.A8R8G8B8, Pool.Managed); - DataRectangle rect = t.LockRectangle(0, LockFlags.None); + DataRectangle rect = t.LockRectangle(0, LockFlags.Discard); for (int i = 0; i < Data.Length; ) { rect.Data.Write(Data, i, 4 * W); @@ -1082,7 +1091,7 @@ namespace Vocaluxe.Lib.Draw { if ((Texture.index >= 0) && (_Textures.Count > 0) && _TextureExists(ref Texture)) { - DataRectangle rect = _D3DTextures[Texture.index].LockRectangle(0, LockFlags.None); + DataRectangle rect = _D3DTextures[Texture.index].LockRectangle(0, LockFlags.Discard); for (int i = 0; i < Data.Length; ) { rect.Data.Write(Data, i, 4 * (int)Texture.width); @@ -1092,9 +1101,26 @@ namespace Vocaluxe.Lib.Draw } _D3DTextures[Texture.index].UnlockRectangle(0); + Texture.height_ratio = Texture.height / CheckForNextPowerOf2(Texture.height); + Texture.width_ratio = Texture.width / CheckForNextPowerOf2(Texture.width); + return true; + + /*Surface s = _D3DTextures[Texture.index].GetSurfaceLevel(0); + DataRectangle d = s.LockRectangle(LockFlags.Discard); + + for (int i = 0; i < Data.Length; ) + { + d.Data.Write(Data, i, 4 * (int)Texture.width); + i += 4 * (int)Texture.width; + d.Data.Position = d.Data.Position - 4 * (int)Texture.width; + d.Data.Position += d.Pitch; + } + Texture.height_ratio = Texture.height / NextPowerOfTwo(Texture.height); Texture.width_ratio = Texture.width / NextPowerOfTwo(Texture.width); - return true; + + s.UnlockRectangle(); + return true; */ } else return false; @@ -1430,14 +1456,14 @@ namespace Vocaluxe.Lib.Draw texture.width = q.width; texture.height = q.height; - texture.w2 = NextPowerOfTwo(texture.width); - texture.h2 = NextPowerOfTwo(texture.height); + texture.w2 = CheckForNextPowerOf2(texture.width); + texture.h2 = CheckForNextPowerOf2(texture.height); texture.width_ratio = texture.width / texture.w2; texture.height_ratio = texture.height / texture.h2; Texture t = new Texture(_Device, (int)texture.w2, (int)texture.h2, 0, Usage.AutoGenerateMipMap, Format.A8R8G8B8, Pool.Managed); - DataRectangle rect = t.LockRectangle(0, LockFlags.None); + DataRectangle rect = t.LockRectangle(0, LockFlags.Discard); for (int i = 0; i < q.data.Length; ) { rect.Data.Write(q.data, i, 4 * q.width); @@ -1471,14 +1497,18 @@ namespace Vocaluxe.Lib.Draw #region utility /// - /// Calculates the next power of two + /// Calculates the next power of two if the device has the POW2 flag set /// /// The value of which the next power of two will be calculated /// The next power of two - private static float NextPowerOfTwo(float n) + private float CheckForNextPowerOf2(float n) { - if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive."); - return (float)System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2))); + if (!_NonPowerOf2TextureSupported) + { + if (n < 0) throw new ArgumentOutOfRangeException("n", "Must be positive."); + return (float)System.Math.Pow(2, System.Math.Ceiling(System.Math.Log((double)n, 2))); + } + else return n; } private Matrix CalculateRotationMatrix(float rot, float rx1, float rx2, float ry1, float ry2) diff --git a/Vocaluxe/Menu/CGraphics.cs b/Vocaluxe/Menu/CGraphics.cs index d7543aac..8a2dab5c 100644 --- a/Vocaluxe/Menu/CGraphics.cs +++ b/Vocaluxe/Menu/CGraphics.cs @@ -451,7 +451,8 @@ namespace Vocaluxe.Menu KeyEvent KeyEvent = new KeyEvent(); MouseEvent MouseEvent = new MouseEvent(); - bool PopupPlayerControlAllowed = _CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing && _CurrentScreen != EScreens.ScreenSong; + bool PopupPlayerControlAllowed = _CurrentScreen != EScreens.ScreenOptionsRecord && _CurrentScreen != EScreens.ScreenSing && + _CurrentScreen != EScreens.ScreenSong && _CurrentScreen != EScreens.ScreenCredits; bool Resume = true; while (keys.PollEvent(ref KeyEvent)) diff --git a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs index 42c3d9f4..10a86dbb 100644 --- a/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/Vocaluxe/Menu/SongMenu/CSongMenuTileBoard.cs @@ -465,6 +465,7 @@ namespace Vocaluxe.Menu.SongMenu } } + _CoverBig.Draw(1f, true); if (_vidtex.color.A < 1) _CoverBig.Draw(1f, true); _TextBG.Draw(); diff --git a/Vocaluxe/Screens/CScreenCredits.cs b/Vocaluxe/Screens/CScreenCredits.cs index 2fd6e966..0327b38c 100644 --- a/Vocaluxe/Screens/CScreenCredits.cs +++ b/Vocaluxe/Screens/CScreenCredits.cs @@ -323,39 +323,6 @@ namespace Vocaluxe.Screens CreditEntryPinky007.direction = EDirection.Right; _CreditNames.Add(CreditEntryPinky007); - //Prepare Text - int lastY = 280; - for (int i = 0; i < paragraphs.Count; i++) - { - string line = ""; - for (int e = 0; e < paragraphs[i].Length; e++ ) - { - if (paragraphs[i][e] != null) - { - string newline = line + " " + paragraphs[i][e]; - CText text = new CText(75, lastY, -2, 30, -1, EAlignment.Left, EStyle.Bold, "Outline", new SColorF(1, 1, 1, 1), line); - if (CDraw.GetTextBounds(text).Width < (CSettings.iRenderW - 160)) - { - line = line + " " + paragraphs[i][e]; - - //Check if all words are used - if ((e + 1) == paragraphs[i].Length) - { - text.Text = line; - paragraphTexts.Add(text); - line = ""; - lastY += 40; - } - } - else - { - paragraphTexts.Add(text); - line = " "+paragraphs[i][e]; - lastY += 27; - } - } - } - } TextTimer.Reset(); LogoTimer.Reset(); CreditsTimer.Reset();