From c304618403c21aca88ce6bd4d019a78030402ca4 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 24 Sep 2008 16:09:39 +0000 Subject: fixed some bugs in equalizer reflection git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1415 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/menu/UMenuEqualizer.pas | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/menu/UMenuEqualizer.pas') 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 -- cgit v1.2.3