Add Assertions for color values and fix some wrong ones

This commit is contained in:
Flamefire committed 2014-09-24 16:52:11 +02:00
1 parent cc7d8058e2
commit 538eab9516
3 files changed
+10 -6

No files matched your search

+2 -3
View File
@@ -18,7 +18,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
@@ -1200,8 +1199,8 @@ namespace Vocaluxe.Screens
}
else
{
_Statics[_StaticSongText].Color.A = 10f - t / 3f;
_Texts[_TextSongName].Color.A = 10f - t / 3f;
_Statics[_StaticSongText].Color.A = (10f - t) / 3f;
_Texts[_TextSongName].Color.A = (10f - t) / 3f;
}
}
else
+5 -3
View File
@@ -332,7 +332,7 @@ namespace VocaluxeLib.Menu.SingNotes
);
_DrawNoteBG(rect, color, 1f, _PlayerNotes[n].Timer);
_DrawNote(rect, new SColorF(5f, 5f, 5f, 0.7f * _PlayerNotes[n].Alpha), 0.7f);
_DrawNote(rect, new SColorF(1f, 1f, 1f, 0.7f * _PlayerNotes[n].Alpha), 0.7f);
if (note.Type == ENoteType.Golden)
{
@@ -541,10 +541,12 @@ namespace VocaluxeLib.Menu.SingNotes
protected void _DrawNoteLines(SRectF rect, SColorF color)
{
int x1 = (int)rect.X;
int x2 = (int)(rect.X + rect.W);
for (int i = 0; i < CBase.Settings.GetNumNoteLines() - 1; i++)
{
float y = rect.Y + rect.H / CBase.Settings.GetNumNoteLines() * (i + 1);
CBase.Drawing.DrawColor(color, new SRectF(rect.X, y, rect.W, 1, -1.0f));
int y = (int)(rect.Y + rect.H / CBase.Settings.GetNumNoteLines() * (i + 1));
CBase.Drawing.DrawLine(color, 1, x1, y, x2, y);
}
}
+3
View File
@@ -17,6 +17,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Windows.Forms;
using VocaluxeLib.Songs;
@@ -34,6 +35,8 @@ namespace VocaluxeLib
public SColorF(float r, float g, float b, float a)
{
Debug.Assert(r.IsInRange(0, 1) && g.IsInRange(0, 1) && b.IsInRange(0, 1));
Debug.Assert(a.IsInRange(0, 1));
R = r;
G = g;
B = b;