diff options
author | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-05-07 15:50:51 +0000 |
---|---|---|
committer | whiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-05-07 15:50:51 +0000 |
commit | 71083e94848dc0516d164a36453617231c912e77 (patch) | |
tree | 71cdda2549e817b29084135d64b03a40bb3bcd71 | |
parent | 0b4921154485953384c026918d6615ed79a7da9d (diff) | |
download | usdx-71083e94848dc0516d164a36453617231c912e77.tar.gz usdx-71083e94848dc0516d164a36453617231c912e77.tar.xz usdx-71083e94848dc0516d164a36453617231c912e77.zip |
fix coverflow "SetScroll5" for less than 8 songs
remove workaround (use SetScroll4 instead of 5) for less than 5 songs
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2340 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r-- | src/screens/UScreenSong.pas | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/screens/UScreenSong.pas b/src/screens/UScreenSong.pas index a9aed0f1..6b83d522 100644 --- a/src/screens/UScreenSong.pas +++ b/src/screens/UScreenSong.pas @@ -986,12 +986,7 @@ begin // Set Positions case Theme.Song.Cover.Style of 3: SetScroll3; - 5:begin - if VS > 5 then - SetScroll5 - else - SetScroll4; - end; + 5: SetScroll5; 6: SetScroll6; else SetScroll4; end; @@ -1336,7 +1331,7 @@ begin // Use an alternate position for the five front covers. if (Abs(Pos) < 2.5) then begin - Angle := Pi * (Pos / 5); // Range: (-1/4*Pi .. +1/4*Pi) + Angle := Pi * (Pos / Min(VS, 5)); // Range: (-1/4*Pi .. +1/4*Pi) Button[B].H := Abs(Theme.Song.Cover.H * cos(Angle*0.8)); Button[B].W := Button[B].H; @@ -1350,10 +1345,15 @@ begin Button[B].X := Theme.Song.Cover.X + Theme.Song.Cover.W * X - Padding; 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; + + if VS < 5 then + Button[B].Texture.Alpha := 1 - Abs(Pos) / VS * 2 + else + Button[B].Texture.Alpha := 1; end { 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 + else if (VS > 7) and (Abs(Pos) > floor(VS/2) - 1.5) then begin // Transform Pos to range [-1..-3/4, +3/4..+1] { the 3 covers at the back will show up in the gap between the @@ -1377,6 +1377,8 @@ begin Button[B].Y := Theme.Song.Cover.Y - (Button[B].H - Theme.Song.Cover.H)*0.75; Button[B].Z := (0.4 - Abs(Pos/4)) -0.00001; //z < 0.49999 is behind the cover 1 is in front of the covers + Button[B].Texture.Alpha := 1; + //Button[B].Reflectionspacing := 15 * Button[B].H/Theme.Song.Cover.H; Button[B].DeSelectReflectionspacing := 15 * Button[B].H/Theme.Song.Cover.H; end @@ -1705,7 +1707,7 @@ var begin VS := CatSongs.VisibleSongs; - if VS > 1 then + if VS > 0 then begin if (not isScrolling) and (VS > 0) then begin |