aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-24 16:09:39 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-24 16:09:39 +0000
commitc304618403c21aca88ce6bd4d019a78030402ca4 (patch)
tree886a8ec9c9d995f685b8cff10c28405c06ff80dc
parent70f986ccf78fe87240026811c6396b9d7224c6db (diff)
downloadusdx-c304618403c21aca88ce6bd4d019a78030402ca4.tar.gz
usdx-c304618403c21aca88ce6bd4d019a78030402ca4.tar.xz
usdx-c304618403c21aca88ce6bd4d019a78030402ca4.zip
fixed some bugs in equalizer reflection
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1415 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--src/menu/UMenuEqualizer.pas15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/menu/UMenuEqualizer.pas b/src/menu/UMenuEqualizer.pas
index 75a75439..6d77721c 100644
--- a/src/menu/UMenuEqualizer.pas
+++ b/src/menu/UMenuEqualizer.pas
@@ -194,9 +194,12 @@ procedure Tms_Equalizer.Draw;
I, J: Integer;
Diff: Real;
- Function GetAlpha(H: Single): Single;
+ Function GetAlpha(Diff: Single): Single;
begin
- Result := (Alpha * 0.3) *(1 - H/(Bands * (W + Space)));
+ If Direction then
+ Result := (Alpha * 0.6) *(0.5 - Diff/(BandLength * (H + Space)))
+ else
+ Result := (Alpha * 0.6) *(0.5 - Diff/(Bands * (H + Space)));
end;
begin
If (Visible) AND not (AudioPlayback.Finished) then
@@ -241,7 +244,7 @@ begin
glVertex3f(PosX+W, PosY, Z);
glEnd;
- If (Reflection) AND (J < BandLength div 2) then
+ If (Reflection) AND (J <= BandLength div 2) then
begin
Diff := (Y-PosY) + H;
@@ -251,10 +254,14 @@ begin
glBegin(GL_QUADS);
glColorRGB(Color, GetAlpha(Diff));
glVertex3f(PosX, Diff + Y + ReflectionSpacing, Z);
+
+ //bottom v
+ glColorRGB(Color, GetAlpha(Diff + H));
glVertex3f(PosX, Diff + Y+H + ReflectionSpacing, Z);
glVertex3f(PosX+W, Diff + Y+H + ReflectionSpacing, Z);
+
+ glColorRGB(Color, GetAlpha(Diff));
glVertex3f(PosX+W, Diff + Y + ReflectionSpacing, Z);
- glColorRGB(Color, GetAlpha(Diff + H));
glEnd;
end
else