diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-04-28 15:31:10 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-04-28 15:31:10 +0000 |
commit | 03abb1fddd189e796fde9d8a334a78ee99d9885f (patch) | |
tree | f3f3e1e5d7625fe4bfefaab1fd2ad3c5b5c59e1d /src/screens | |
parent | 27b3e332076162b37a7a53f059004d23ad69f9d2 (diff) | |
download | usdx-03abb1fddd189e796fde9d8a334a78ee99d9885f.tar.gz usdx-03abb1fddd189e796fde9d8a334a78ee99d9885f.tar.xz usdx-03abb1fddd189e796fde9d8a334a78ee99d9885f.zip |
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
Diffstat (limited to 'src/screens')
-rw-r--r-- | src/screens/UScreenSong.pas | 19 |
1 files changed, 14 insertions, 5 deletions
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; |