From c179ce1e13ecb0528a3a948b4ff75f6a5c4509d8 Mon Sep 17 00:00:00 2001 From: k-m_schindler Date: Fri, 1 Jan 2016 20:50:41 +0000 Subject: add SetOutlineColor in TextGL.pas git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@3155 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/base/ULyrics.pas | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'src/base/ULyrics.pas') diff --git a/src/base/ULyrics.pas b/src/base/ULyrics.pas index 3f62db9c..4b2bc4ae 100644 --- a/src/base/ULyrics.pas +++ b/src/base/ULyrics.pas @@ -516,7 +516,11 @@ var WordY: real; // word y-position LyricsEffect: TLyricsEffect; Alpha: real; // alphalevel to fade out at end - ClipPlaneEq: array[0..3] of GLdouble; // clipping plane for slide effect + ClipPlaneEq: array[0..3] of GLdouble; // clipping plane for slide effect + + OutlineColor_act: TRGB; // outline color actual line + OutlineColor_dis: TRGB; // outline color next line + OutlineColor_en: TRGB; // outline color sing line {// duet mode IconSize: real; // size of player icons IconAlpha: real; // alpha level of player icons @@ -592,6 +596,9 @@ begin Alpha := 0; end; + // outline color + SetOutlineColor(OutlineColor_act.R, OutlineColor_act.G, OutlineColor_act.B, Alpha); + // draw sentence before current word if (LyricsEffect in [lfxSimple, lfxBall, lfxShift]) then // only highlight current word and not that ones before in this line @@ -604,10 +611,17 @@ begin glColorRGB(LineColor_en, Alpha); if (NextWord <> nil) then begin + + // outline color + SetOutlineColor(OutlineColor_en.R, OutlineColor_en.G, OutlineColor_en.B, Alpha); + DrawLyricsWords(Line, LyricX + NextWord.X, LyricY, Line.CurWord+1, High(Line.Words)); end; + // outline color + SetOutlineColor(OutlineColor_act.R, OutlineColor_act.G, OutlineColor_act.B, Alpha); + // draw current word if (LyricsEffect in [lfxSimple, lfxBall, lfxShift]) then begin @@ -680,12 +694,26 @@ begin // enable the upper, disable the lower line if (Line = UpperLine) then + begin + // outline color + SetOutlineColor(OutlineColor_en.R, OutlineColor_en.G, OutlineColor_en.B, Alpha); + glColorRGB(LineColor_en) + end else + begin + // outline color + SetOutlineColor(OutlineColor_dis.R, OutlineColor_dis.G, OutlineColor_dis.B, Alpha); + glColorRGB(LineColor_dis); + end; DrawLyricsWords(Line, LyricX, LyricY, 0, High(Line.Words)); end; + + // reset + SetOutlineColor(0,0,0,1); + end; {** -- cgit v1.2.3