From 517e6872ed12e6a9144c4fbd0b02063feeab5528 Mon Sep 17 00:00:00 2001 From: tobigun Date: Sat, 19 Jul 2008 12:48:23 +0000 Subject: 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 --- Game/Code/Classes/UDraw.pas | 46 ++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'Game/Code/Classes/UDraw.pas') 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. -- cgit v1.2.3