aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UDraw.pas
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-07-19 12:48:23 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-07-19 12:48:23 +0000
commit517e6872ed12e6a9144c4fbd0b02063feeab5528 (patch)
tree5b9feb4722281edc180ecfc42c12cf447f3fb39b /Game/Code/Classes/UDraw.pas
parentdcc64f116267edcf72f5e18105310c68355149f7 (diff)
downloadusdx-517e6872ed12e6a9144c4fbd0b02063feeab5528.tar.gz
usdx-517e6872ed12e6a9144c4fbd0b02063feeab5528.tar.xz
usdx-517e6872ed12e6a9144c4fbd0b02063feeab5528.zip
lyric engine patches, solves
- pixeled/transparent fonts bug - some lines were erroneously marked active or disabled - state was not initialized correctly - negative gap problem (TLyricLine.Start was of type cardinal) - some more lyrics bugs git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1211 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'Game/Code/Classes/UDraw.pas')
-rw-r--r--Game/Code/Classes/UDraw.pas46
1 files changed, 23 insertions, 23 deletions
diff --git a/Game/Code/Classes/UDraw.pas b/Game/Code/Classes/UDraw.pas
index 24a52264..a5bd8afa 100644
--- a/Game/Code/Classes/UDraw.pas
+++ b/Game/Code/Classes/UDraw.pas
@@ -434,7 +434,7 @@ begin
// Perfect note is stored
if Perfect and (Ini.EffectSing=1) then
begin
- A := 1 - 2*(LineState.CurrentTime - GetTimeFromBeat(Start+Length));
+ A := 1 - 2*(LineState.GetCurrentTime() - GetTimeFromBeat(Start+Length));
if not (Start+Length-1 = LineState.CurrentBeatD) then
begin
//Star animation counter
@@ -1336,13 +1336,15 @@ begin
end;
procedure SingDrawTimeBar();
-var x,y: real;
- width, height: real;
- lTmp : real;
+var
+ x,y: real;
+ width, height: real;
+ LyricsProgress: real;
+ CurLyricsTime: real;
begin
x := Theme.Sing.StaticTimeProgress.x;
y := Theme.Sing.StaticTimeProgress.y;
-
+
width := Theme.Sing.StaticTimeProgress.w;
height := Theme.Sing.StaticTimeProgress.h;
@@ -1356,30 +1358,28 @@ begin
glBindTexture(GL_TEXTURE_2D, Tex_TimeProgress.TexNum);
glBegin(GL_QUADS);
- try
glTexCoord2f(0, 0);
- glVertex2f(x,y);
-
- if ( LineState.CurrentTime > 0 ) AND
- ( LineState.TotalTime > 0 ) THEN
- BEGIN
- lTmp := LineState.CurrentTime/LineState.TotalTime;
- glTexCoord2f((width*LineState.CurrentTime/LineState.TotalTime)/8, 0);
- glVertex2f(x+width*LineState.CurrentTime/LineState.TotalTime, y);
-
- glTexCoord2f((width*LineState.CurrentTime/LineState.TotalTime)/8, 1);
- glVertex2f(x+width*LineState.CurrentTime/LineState.TotalTime, y+height);
- END;
+ glVertex2f(x, y);
+
+ CurLyricsTime := LineState.GetCurrentTime();
+ if (CurLyricsTime > 0) and
+ (LineState.TotalTime > 0) then
+ begin
+ LyricsProgress := CurLyricsTime / LineState.TotalTime;
+ glTexCoord2f((width * LyricsProgress) / 8, 0);
+ glVertex2f(x + width * LyricsProgress, y);
+
+ glTexCoord2f((width * LyricsProgress) / 8, 1);
+ glVertex2f(x + width * LyricsProgress, y + height);
+ end;
glTexCoord2f(0, 1);
- glVertex2f(x, y+height);
- finally
- glEnd;
- end;
+ glVertex2f(x, y + height);
+ glEnd;
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
- glcolor4f(1,1,1,1);
+ glcolor4f(1, 1, 1, 1);
end;
end.