diff options
author | davidus01 <davidus01@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-19 20:42:20 +0000 |
---|---|---|
committer | davidus01 <davidus01@b956fd51-792f-4845-bead-9b4dfca2ff2c> | 2010-06-19 20:42:20 +0000 |
commit | 073b864caf24c3baf799773f15d7090be5ddf32b (patch) | |
tree | 2f23e4720d09887c50c1fb38c322f565f4c90ec2 | |
parent | a8f35da777534a54881a8a93c5b2729bb1054bde (diff) | |
download | usdx-073b864caf24c3baf799773f15d7090be5ddf32b.tar.gz usdx-073b864caf24c3baf799773f15d7090be5ddf32b.tar.xz usdx-073b864caf24c3baf799773f15d7090be5ddf32b.zip |
editor: lyric on note
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/experimental@2551 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r-- | us_maker_edition/src/screens/UScreenEditSub.pas | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/us_maker_edition/src/screens/UScreenEditSub.pas b/us_maker_edition/src/screens/UScreenEditSub.pas index 7e14cd8c..0d47117d 100644 --- a/us_maker_edition/src/screens/UScreenEditSub.pas +++ b/us_maker_edition/src/screens/UScreenEditSub.pas @@ -226,6 +226,7 @@ type procedure DrawPlayerTrack(X, Y, W: real; Space: integer; CurrentTone: integer; Count: integer; CurrentNote: integer); procedure DrawStatics; procedure DrawInfoBar(x, y, w, h: integer); + procedure DrawText(Left, Top, Right: real; NrLines: integer; Space: integer); //video view procedure StartVideoPreview(); procedure StopVideoPreview(); @@ -252,11 +253,11 @@ uses UNote, USkins, ULanguage, + TextGL, UTextEncoding, UUnicodeUtils; - procedure OnSaveEncodingError(Value: boolean; Data: Pointer); var SResult: TSaveSongResult; @@ -2119,6 +2120,65 @@ begin glLineWidth(1); end; +procedure TScreenEditSub.DrawText(Left, Top, Right: real; NrLines: integer; Space: integer); +var + Rec: TRecR; + Count: integer; + TempR: real; + + PlayerNumber: integer; + + GoldenStarPos: real; + + lTmpA, lTmpB : real; +begin + if (ScreenSing.settings.NotesVisible and (1 shl NrLines) <> 0) then + begin + + PlayerNumber := NrLines + 1; // Player 1 is 0 + glColor3f(1, 1, 1); + glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + lTmpA := (Right-Left); + lTmpB := (Lines[NrLines].Line[Lines[NrLines].Current].End_ - Lines[NrLines].Line[Lines[NrLines].Current].Note[0].Start); + + if ( lTmpA > 0 ) and ( lTmpB > 0 ) then + TempR := lTmpA / lTmpB + else + TempR := 0; + + with Lines[NrLines].Line[Lines[NrLines].Current] do + begin + for Count := 0 to HighNote do + begin + with Note[Count] do + begin + // left part + Rec.Left := 0; + Rec.Right := 0; + BaseNote := Lines[0].Line[Lines[NrLines].Current].BaseNote; + Rec.Top := Top - (Tone-BaseNote)*Space/2 - NotesH; + Rec.Bottom := Rec.Top + 2 * NotesH; + // middle part + Rec.Left := (Start-Lines[NrLines].Line[Lines[NrLines].Current].Note[0].Start) * TempR + Left + 0.5 + 10*ScreenX + NotesW; + Rec.Right := (Start+Length-Lines[NrLines].Line[Lines[NrLines].Current].Note[0].Start) * TempR + Left - NotesW - 0.5 + 10*ScreenX; + glColor4f(0, 0, 0, 1); + SetFontStyle (1); + SetFontItalic(False); + SetFontSize(14); + SetFontPos (Rec.Left, Rec.Top); + glPrint(Text); + end; // with + end; // for + end; // with + + glDisable(GL_BLEND); + glDisable(GL_TEXTURE_2D); + end; +end; + // from revision 2475 procedure TScreenEditSub.StartVideoPreview; var @@ -2672,6 +2732,7 @@ begin begin SingDrawBeatDelimeters(40, 305, 760, 0); EditDrawLine(40, 410, 760, 0, 15); + DrawText(40, 410, 760, 0, 15); end; CurrentSound := AudioInputProcessor.Sound[0]; |