diff --git a/Vocaluxe/Lib/Draw/CDirect3D.cs b/Vocaluxe/Lib/Draw/CDirect3D.cs index e79e1473..53cca0ac 100644 --- a/Vocaluxe/Lib/Draw/CDirect3D.cs +++ b/Vocaluxe/Lib/Draw/CDirect3D.cs @@ -732,7 +732,7 @@ namespace Vocaluxe.Lib.Draw /// The texture in which the frame is copied to public void CopyScreen(ref STexture texture) { - if (!_TextureExists(ref texture) || (Math.Abs(texture.Width - GetScreenWidth()) > float.Epsilon) || (Math.Abs(texture.Height - GetScreenHeight()) > float.Epsilon)) + if (!_TextureExists(ref texture) || (int)texture.Width != GetScreenWidth() || (int)texture.Height != GetScreenHeight()) { RemoveTexture(ref texture); texture = CopyScreen(); diff --git a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs index 38c57cce..6aae01ae 100644 --- a/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs +++ b/Vocaluxe/Lib/Video/CVideoDecoderFFmpeg.cs @@ -661,7 +661,7 @@ namespace Vocaluxe.Lib.Video if (num >= 0) { - if (frame.Index == -1 || Math.Abs(_Width - frame.Width) > float.Epsilon || Math.Abs(_Height - frame.Height) > float.Epsilon) + if (frame.Index == -1 || _Width != (int) frame.Width || _Height != (int) frame.Height) { CDraw.RemoveTexture(ref frame); frame = CDraw.AddTexture(_Width, _Height, ref _FrameBuffer[num].Data); diff --git a/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs b/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs index e073a74c..2295e8b4 100644 --- a/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs +++ b/Vocaluxe/Lib/Video/CVideoDecoderGstreamer.cs @@ -27,7 +27,7 @@ namespace Vocaluxe.Lib.Video class CVideoDecoderGstreamer : IVideoDecoder { #region log - public CGstreamerVideoWrapper.LogCallback Log; + private CGstreamerVideoWrapper.LogCallback Log; private void _LogHandler(string text) { @@ -121,7 +121,7 @@ namespace Vocaluxe.Lib.Video { if (data != null) { - if (frame.Index == -1 || width != frame.Width || height != frame.Height || data.Length == 0) + if (frame.Index == -1 || width != (int)frame.Width || height != (int)frame.Height || data.Length == 0) { CDraw.RemoveTexture(ref frame); frame = CDraw.AddTexture(width, height, ref data); diff --git a/Vocaluxe/Lib/Webcam/CAForgeNet.cs b/Vocaluxe/Lib/Webcam/CAForgeNet.cs index 35926e50..6ba3577f 100644 --- a/Vocaluxe/Lib/Webcam/CAForgeNet.cs +++ b/Vocaluxe/Lib/Webcam/CAForgeNet.cs @@ -57,7 +57,7 @@ namespace Vocaluxe.Lib.Webcam { lock (_MutexData) { - if (frame.Index == -1 || Math.Abs(_Width - frame.Width) > float.Epsilon || Math.Abs(_Height - frame.Height) > float.Epsilon) + if (frame.Index == -1 || _Width != (int) frame.Width || _Height != (int)frame.Height) { CDraw.RemoveTexture(ref frame); frame = CDraw.AddTexture(_Width, _Height, ref _Data); diff --git a/VocaluxeLib/Menu/CLyric.cs b/VocaluxeLib/Menu/CLyric.cs index a0c9471a..6e928c4a 100644 --- a/VocaluxeLib/Menu/CLyric.cs +++ b/VocaluxeLib/Menu/CLyric.cs @@ -499,17 +499,13 @@ namespace VocaluxeLib.Menu if (_Notes[jumpNote].Type == ENoteType.Freestyle) _Text.Style = EStyle.BoldItalic; - float diff = _Notes[jumpNote].EndBeat - _Notes[jumpNote].StartBeat; - if (diff <= 0f) - diff = 1f; + int diff = _Notes[jumpNote].EndBeat - _Notes[jumpNote].StartBeat; + if (diff <= 0) + diff = 1; - float p = (currentBeat - _Notes[jumpNote].StartBeat) / diff; - if (p > 1f) - p = 1f; + float p = 1f-(currentBeat - _Notes[jumpNote].StartBeat) / diff; - p = 1f - p; - - if (Math.Abs(diff - 1) < float.Epsilon) + if (Math.Abs(p) < float.Epsilon) _Text.Draw(); else {