aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code/Classes/UMain.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/UMain.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/UMain.pas')
-rw-r--r--Game/Code/Classes/UMain.pas77
1 files changed, 10 insertions, 67 deletions
diff --git a/Game/Code/Classes/UMain.pas b/Game/Code/Classes/UMain.pas
index 95c1914a..a9add539 100644
--- a/Game/Code/Classes/UMain.pas
+++ b/Game/Code/Classes/UMain.pas
@@ -671,29 +671,13 @@ var
CP: integer;
Done: real;
N: integer;
+ CurLine: PLine;
+ CurNote: PLineFragment;
begin
- LineState.OldBeat := LineState.CurrentBeat;
- // new system with variable BPM in function
- LineState.MidBeat := GetMidBeat(LineState.CurrentTime -
- (CurrentSong.Gap {+ 90 I've forgotten for what it is}) / 1000);
- LineState.CurrentBeat := Floor(LineState.MidBeat);
-
- //LineState.OldHalf := LineState.AktHalf;
- //LineState.MidHalf := LineState.MidBeat + 0.5;
- //LineState.AktHalf := Floor(LineState.MidHalf);
-
- LineState.OldBeatC := LineState.CurrentBeatC;
- LineState.MidBeatC := GetMidBeat(LineState.CurrentTime - (CurrentSong.Gap) / 1000);
- LineState.CurrentBeatC := Floor(LineState.MidBeatC);
-
- LineState.OldBeatD := LineState.CurrentBeatD;
- // MidBeat with additional GAP
- LineState.MidBeatD := -0.5+GetMidBeat(LineState.CurrentTime - (CurrentSong.Gap + 120 + 20) / 1000);
- LineState.CurrentBeatD := Floor(LineState.MidBeatD);
- LineState.FracBeatD := Frac(LineState.MidBeatD);
+ LineState.UpdateBeats();
// sentences routines
- for CountGr := 0 to 0 do //High(Gracz)
+ for CountGr := 0 to 0 do //High(Lines)
begin;
CP := CountGr;
// old parts
@@ -713,10 +697,6 @@ begin
end; // for CountGr
- // execute operations on beat
- if (LineState.CurrentBeat >= 0) and (LineState.OldBeat <> LineState.CurrentBeat) then
- NewBeat(Screen);
-
// make some operations on clicks
if {(LineState.CurrentBeatC >= 0) and }(LineState.OldBeatC <> LineState.CurrentBeatC) then
NewBeatClick(Screen);
@@ -725,42 +705,19 @@ begin
if (LineState.CurrentBeatD >= 0) and (LineState.OldBeatD <> LineState.CurrentBeatD) then
NewBeatDetect(Screen);
- // execute operations on beat field
-// if (LineState.AktHalf >= 1) and (LineState.OldHalf <> LineState.AktHalf) then
-// NewHalf;
+ CurLine := @Lines[0].Line[Lines[0].Current];
// remove moving text
Done := 1;
- for N := 0 to Lines[0].Line[Lines[0].Current].HighNote do
+ for N := 0 to CurLine.HighNote do
begin
- if (Lines[0].Line[Lines[0].Current].Note[N].Start <= LineState.MidBeat) and
- (Lines[0].Line[Lines[0].Current].Note[N].Start + Lines[0].Line[Lines[0].Current].Note[N].Length >= LineState.MidBeat) then
+ CurNote := @CurLine.Note[N];
+ if (CurNote.Start <= LineState.MidBeat) and
+ (CurNote.Start + CurNote.Length >= LineState.MidBeat) then
begin
- Done := (LineState.MidBeat - Lines[0].Line[Lines[0].Current].Note[N].Start) / (Lines[0].Line[Lines[0].Current].Note[N].Length);
- end;
- end;
-
- N := Lines[0].Line[Lines[0].Current].HighNote;
-
- // if last note is used
- {// todo: Lyrics
- if (Ini.LyricsEffect = 1) and (Done = 1) and
- (LineState.MidBeat > Lines[0].Line[Lines[0].Current].Note[N].Start + Lines[0].Line[Lines[0].Current].Note[N].Length)
- then Screen.LyricMain.Selected := -1;
-
- if Done > 1 then Done := 1;
- Screen.LyricMain.Done := Done;
- }
-
- // use Done with LCD
- {
- with ScreenSing do begin
- if LyricMain.Selected >= 0 then begin
- LCD.MoveCursor(1, LyricMain.SelectedLetter + Round((LyricMain.SelectedLength-1) * Done));
- LCD.ShowCursor;
+ Done := (LineState.MidBeat - CurNote.Start) / CurNote.Length;
end;
end;
- }
end;
procedure NewSentence(Screen: TScreenSing);
@@ -775,20 +732,6 @@ begin
SetLength(Player[i].Note, 0);
end;
- // add words to lyrics
- with Screen do
- begin
- {LyricMain.AddCzesc(Lines[0].Current);
- if Lines[0].Current < Lines[0].High then
- LyricSub.AddCzesc(Lines[0].Current+1)
- else
- LyricSub.Clear;}
- while (not Lyrics.LineinQueue) and (Lyrics.LineCounter <= High(Lines[0].Line)) do
- Lyrics.AddLine(@Lines[0].Line[Lyrics.LineCounter]);
- end;
-
- //Screen.UpdateLCD;
-
// on sentence change...
Screen.onSentenceChange(Lines[0].Current);
end;