aboutsummaryrefslogtreecommitdiffstats
path: root/src/base/UDraw.pas
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2013-02-22 21:25:08 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2013-02-22 21:25:08 +0000
commit16ecad36bd1fd998167d79f5b07221305cf64f4c (patch)
treea5456d8d5fdfb5a99bd5e0d6fd87f5b327438788 /src/base/UDraw.pas
parent8efd5bd615a587b4697726894c55ebc07ba24abf (diff)
downloadusdx-16ecad36bd1fd998167d79f5b07221305cf64f4c.tar.gz
usdx-16ecad36bd1fd998167d79f5b07221305cf64f4c.tar.xz
usdx-16ecad36bd1fd998167d79f5b07221305cf64f4c.zip
merge the first part of the medley_new branch. This part has the functionality and most GUI changes.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2943 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/base/UDraw.pas')
-rw-r--r--src/base/UDraw.pas18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/base/UDraw.pas b/src/base/UDraw.pas
index 5bec3eab..374f9cbe 100644
--- a/src/base/UDraw.pas
+++ b/src/base/UDraw.pas
@@ -93,6 +93,7 @@ uses
UMusic,
URecord,
UScreenSing,
+ USong,
UTexture;
procedure SingDrawBackground;
@@ -1115,6 +1116,8 @@ var
width, height: real;
LyricsProgress: real;
CurLyricsTime: real;
+ TotalTime: real;
+
begin
x := Theme.Sing.StaticTimeProgress.x;
y := Theme.Sing.StaticTimeProgress.y;
@@ -1135,13 +1138,22 @@ begin
glTexCoord2f(0, 0);
glVertex2f(x, y);
- CurLyricsTime := LyricsState.GetCurrentTime();
+ if ScreenSong.Mode = smMedley then
+ begin
+ CurLyricsTime := LyricsState.GetCurrentTime() - ScreenSing.MedleyStart;
+ TotalTime := ScreenSing.MedleyEnd - ScreenSing.MedleyStart;
+ end
+ else
+ begin
+ CurLyricsTime := LyricsState.GetCurrentTime();
+ TotalTime := LyricsState.TotalTime;
+ end;
if (CurLyricsTime > 0) and
(LyricsState.TotalTime > 0) then
begin
- LyricsProgress := CurLyricsTime / LyricsState.TotalTime;
+ LyricsProgress := CurLyricsTime / TotalTime;
// avoid that the bar "overflows" for inaccurate song lengths
- if (LyricsProgress > 1.0) then
+ if LyricsProgress > 1.0 then
LyricsProgress := 1.0;
glTexCoord2f((width * LyricsProgress) / 8, 0);
glVertex2f(x + width * LyricsProgress, y);