From 8cc30e0a1603053ea7f4830187a47f958d6c5a4b Mon Sep 17 00:00:00 2001 From: b1indy Date: Wed, 12 Dec 2007 16:56:17 +0000 Subject: some "progress" with the lyrics don't understand, why my debug display and what's shown in thy lyric-bar doesn't match (as i see it in the code, it should be the same) git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@700 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/ULyrics.pas | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'Game') diff --git a/Game/Code/Classes/ULyrics.pas b/Game/Code/Classes/ULyrics.pas index 8eaa2a5f..70031ef0 100644 --- a/Game/Code/Classes/ULyrics.pas +++ b/Game/Code/Classes/ULyrics.pas @@ -342,7 +342,7 @@ begin //Create LyricTexture //Prepare Ogl glGetIntegerv(GL_VIEWPORT, @ViewPort); - glClearColor(0.0,0.0,0.0,0); + glClearColor(0.0,0.0,0.0,0.0); glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); {glMatrixMode(GL_PROJECTION); glLoadIdentity; @@ -356,9 +356,10 @@ begin Display.ScreenShot; //Copy to Texture + glEnable(GL_ALPHA); glBindTexture(GL_TEXTURE_2D, LyricLine.Tex); glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 448, 512, 64, 0); - + glDisable(GL_ALPHA); //Clear Buffer glClearColor(0,0,0,0); glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT); @@ -383,10 +384,10 @@ Procedure TLyricEngine.Draw (Beat: Real); begin DrawLyrics(Beat); - +/////// start of debug draw glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); - glBlendFunc(GL_SRC_Alpha {GL_ONE_MINUS_SRC_COLOR}, GL_ONE_MINUS_SRC_Alpha); + glBlendFunc(GL_SRC_Alpha, GL_ONE_MINUS_SRC_Alpha); glBindTexture(GL_TEXTURE_2D, PUpperLine^.Tex); glColor4f(1,1,0,1); @@ -409,7 +410,7 @@ begin glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); - +/////// end of debug draw end; //--------------- @@ -500,7 +501,7 @@ begin //Draw complete Sentence glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); - glBlendFunc(GL_SRC_COLOR {GL_ONE_MINUS_SRC_COLOR}, GL_ONE_MINUS_SRC_COLOR); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBindTexture(GL_TEXTURE_2D, Line.Tex); glColorRGB(LineColor_en); @@ -517,6 +518,29 @@ begin end else begin + //Get Start Position: + { Start of Line - Width of all Icons + LineWidth/2 (Center} + LyricX := X + {(W - ((IconSize + 1) * 6))/2 +} ((IconSize + 1) * 3); + + LyricX2 := LyricX +500{ Line.Width}; + + //Draw complete Sentence + glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBindTexture(GL_TEXTURE_2D, Line.Tex); + + glColorRGB(LineColor_akt); + glBegin(GL_QUADS); + glTexCoord2f(0, 1); glVertex2f(LyricX, Y); + glTexCoord2f(0, 0); glVertex2f(LyricX, Y + 64 * W / 512); + glTexCoord2f(1, 0); glVertex2f(LyricX2, Y + 64 * W / 512); + glTexCoord2f(1, 1); glVertex2f(LyricX2, Y); + glEnd; + + + glDisable(GL_BLEND); + glDisable(GL_TEXTURE_2D); end; -- cgit v1.2.3