diff --git a/Output/Graphics/Logo.png b/Output/Graphics/Logo.png index 2ad40d2f..0977ea93 100644 Binary files a/Output/Graphics/Logo.png and b/Output/Graphics/Logo.png differ diff --git a/Vocaluxe/Program.cs b/Vocaluxe/Program.cs index be340960..144db8f6 100644 --- a/Vocaluxe/Program.cs +++ b/Vocaluxe/Program.cs @@ -192,6 +192,8 @@ namespace Vocaluxe class SplashScreen : Form { + Bitmap logo; + public SplashScreen() { string path = Path.Combine(Environment.CurrentDirectory, Path.Combine(CSettings.sFolderGraphics, CSettings.sLogo)); @@ -199,9 +201,8 @@ namespace Vocaluxe { try { - Bitmap logo = new Bitmap(path); + logo = new Bitmap(path); this.ClientSize = new Size(logo.Width, logo.Height); - this.BackgroundImage = logo; } catch (Exception e) { @@ -230,8 +231,20 @@ namespace Vocaluxe this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Text = CSettings.sProgramName; this.CenterToScreen(); - this.TransparencyKey = this.BackColor; //thx to Klafhor :> this.Show(); } + + protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) + { + } + + protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs e) + { + if (logo == null) + return; + + Graphics g = e.Graphics; + g.DrawImage(logo, new Rectangle(0, 0, this.Width, this.Height)); + } } } diff --git a/Vocaluxe/Screens/CScreenSing.cs b/Vocaluxe/Screens/CScreenSing.cs index 48ea1105..8dc101cf 100644 --- a/Vocaluxe/Screens/CScreenSing.cs +++ b/Vocaluxe/Screens/CScreenSing.cs @@ -581,7 +581,8 @@ namespace Vocaluxe.Screens lines[i] = song.Notes.GetLines(i); CLine[] line = lines[i].Line; - + + // find current line (it must be the same as in CalcFadingAlpha) int nr = -1; for (int j = 0; j < line.Length; j++) { @@ -850,12 +851,16 @@ namespace Vocaluxe.Screens lines[i] = Song.Notes.GetLines(i); CLine[] line = lines[i].Line; + // find current line (it must be the same as in UpdateLyrics) int CurrentLine = 0; for (int j = 0; j < line.Length; j++) { - if (line[j].FirstBeat <= _CurrentBeat) + if (line[j].StartBeat <= _CurrentBeat) { - CurrentLine = j; + if (CGame.GetTimeFromBeats(line[j].FirstBeat, Song.BPM) <= _CurrentTime - Song.Gap + 10f) + { + CurrentLine = j; + } } } @@ -863,9 +868,11 @@ namespace Vocaluxe.Screens Alpha[i * 2] = 1f; Alpha[i * 2 + 1] = 1f; - // main + // main line alpha if (CurrentLine == 0 && CurrentTime < CGame.GetTimeFromBeats(line[CurrentLine].FirstBeat, Song.BPM)) { + // first main line and fist note is not reached + // => fade in float diff = CGame.GetTimeFromBeats(line[CurrentLine].FirstBeat, Song.BPM) - CurrentTime; if (diff > dt) { @@ -875,20 +882,29 @@ namespace Vocaluxe.Screens else if (CurrentLine < line.Length - 1 && CGame.GetTimeFromBeats(line[CurrentLine].LastBeat, Song.BPM) < CurrentTime && CGame.GetTimeFromBeats(line[CurrentLine + 1].FirstBeat, Song.BPM) > CurrentTime) { + // current position is between two lines + + // time between the to lines float diff = CGame.GetTimeFromBeats(line[CurrentLine + 1].FirstBeat, Song.BPM) - CGame.GetTimeFromBeats(line[CurrentLine].LastBeat, Song.BPM); + // fade only if there is enough time for fading if (diff > 3.3f * dt) { + // time elapsed since last line float last = CurrentTime - CGame.GetTimeFromBeats(line[CurrentLine].LastBeat, Song.BPM); + + // time to next line float next = CGame.GetTimeFromBeats(line[CurrentLine + 1].FirstBeat, Song.BPM) - CurrentTime; if (last < next) { + // fade out Alpha[i * 2] = 1f - last / rt; } else { + // fade in if it is time for if (next > dt) Alpha[i * 2] = 1f - (next - dt) / rt; } @@ -896,6 +912,8 @@ namespace Vocaluxe.Screens } else if (CurrentLine == line.Length - 1 && CGame.GetTimeFromBeats(line[CurrentLine].LastBeat, Song.BPM) < CurrentTime) { + // last main line and last note was reached + // => fade out float diff = CurrentTime - CGame.GetTimeFromBeats(line[CurrentLine].LastBeat, Song.BPM); Alpha[i * 2] = 1f - diff / rt; } @@ -903,7 +921,9 @@ namespace Vocaluxe.Screens // sub if (CurrentLine < line.Length - 2) { - float diff = CGame.GetTimeFromBeats(line[CurrentLine + 1].FirstBeat, Song.BPM) - CurrentTime; + float diff = 0f; + diff = CGame.GetTimeFromBeats(line[CurrentLine + 1].FirstBeat, Song.BPM) - CurrentTime; + if (diff > dt) { Alpha[i * 2 + 1] = 1f - (diff - dt) / rt;