From 03abb1fddd189e796fde9d8a334a78ee99d9885f Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 28 Apr 2010 15:31:10 +0000 Subject: improved cover flow: only five front covers and 3 covers in the back that show up in the gap between the front cover and its neighbors are drawn. This looks more beauty than the old solution and it should fix the massive performance loss when many songs are in the shown category. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2314 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/screens/UScreenSong.pas | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/screens') diff --git a/src/screens/UScreenSong.pas b/src/screens/UScreenSong.pas index 34589963..a4fde5f6 100644 --- a/src/screens/UScreenSong.pas +++ b/src/screens/UScreenSong.pas @@ -1344,13 +1344,19 @@ begin Button[B].Y := (Theme.Song.Cover.Y + (Theme.Song.Cover.H - Abs(Theme.Song.Cover.H * cos(Angle))) * 0.5); Button[B].Z := 0.95 - Abs(Pos) * 0.01; end - else + { only draw 3 visible covers in the background + (the 3 that are on the opposite of the front covers} + else if (Abs(Pos) > floor(VS/2) - 1.5) then begin - // Transform Pos to range [-1..-1/2, +1/2..+1] + // Transform Pos to range [-1..-3/4, +3/4..+1] + { the 3 covers at the back will show up in the gap between the + front cover and its neighbors + one cover will be hiddenbehind the front cover, + but this will not be a lack of performance ;) } if Pos < 0 then - Pos := Pos/VS - 0.5 + Pos := (Pos - 2 + ceil(VS/2))/8 - 0.75 else - Pos := Pos/VS + 0.5; + Pos := (Pos + 2 - floor(VS/2))/8 + 0.75; // angle in radians [-2Pi..-Pi, +Pi..+2Pi] Angle := 2*Pi * Pos; @@ -1366,7 +1372,10 @@ begin //Button[B].Reflectionspacing := 15 * Button[B].H/Theme.Song.Cover.H; Button[B].DeSelectReflectionspacing := 15 * Button[B].H/Theme.Song.Cover.H; - end; + end + { all other covers are not visible } + else + Button[B].Visible := false; end; end; end; -- cgit v1.2.3