From 5ed6620bad808381fce94f2cd67ee911b4d45bff Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Wed, 21 Mar 2007 19:19:04 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Menu/UMenuStatic.pas | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Game/Code/Menu/UMenuStatic.pas (limited to 'Game/Code/Menu/UMenuStatic.pas') diff --git a/Game/Code/Menu/UMenuStatic.pas b/Game/Code/Menu/UMenuStatic.pas new file mode 100644 index 00000000..4b10e54c --- /dev/null +++ b/Game/Code/Menu/UMenuStatic.pas @@ -0,0 +1,32 @@ +unit UMenuStatic; + +interface +uses UTexture, OpenGL12; + +type + TStatic = class + public + Texture: TTexture; // Button Screen position and size + Visible: boolean; + procedure Draw; + constructor Create(Textura: TTexture); overload; + end; + +implementation +uses UDrawTexture; + +procedure TStatic.Draw; +var + Pet: integer; +begin + if Visible then + DrawTexture(Texture); +end; + +constructor TStatic.Create(Textura: TTexture); +begin + inherited Create; + Texture := Textura; +end; + +end. -- cgit v1.2.3 From e6917faa19aebfa6d089b24c65e4c7fe4bd6b503 Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Fri, 13 Apr 2007 11:25:13 +0000 Subject: Added Reflection to ThemeStatic Added Attribut ReflectionSpacing git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@83 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Menu/UMenuStatic.pas | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'Game/Code/Menu/UMenuStatic.pas') diff --git a/Game/Code/Menu/UMenuStatic.pas b/Game/Code/Menu/UMenuStatic.pas index 4b10e54c..c19e6abc 100644 --- a/Game/Code/Menu/UMenuStatic.pas +++ b/Game/Code/Menu/UMenuStatic.pas @@ -8,6 +8,11 @@ type public Texture: TTexture; // Button Screen position and size Visible: boolean; + + //Reflection Mod + Reflection: boolean; + Reflectionspacing: Real; + procedure Draw; constructor Create(Textura: TTexture); overload; end; @@ -21,6 +26,48 @@ var begin if Visible then DrawTexture(Texture); + + //Reflection Mod + if (Reflection) then // Draw Reflections + begin + with Texture do + begin + //Bind Tex and GL Attributes + glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glDepthRange(0, 10); + glDepthFunc(GL_LEQUAL); + //glDepthFunc(GL_GEQUAL); + glEnable(GL_DEPTH_TEST); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + //glBlendFunc(GL_SRC_COLOR, GL_ZERO); + glBindTexture(GL_TEXTURE_2D, TexNum); + + //Draw + glBegin(GL_QUADS);//Top Left + glColor4f(ColR * Int, ColG * Int, ColB * Int, Alpha-0.3); + glTexCoord2f(TexX1*TexW, TexY2*TexH); + glVertex3f(x, y+h*scaleH+ Reflectionspacing, z); + + //Bottom Left + glColor4f(ColR * Int, ColG * Int, ColB * Int, 0); + glTexCoord2f(TexX1*TexW, {TexY1*TexH*}0.5); + glVertex3f(x, y+h*scaleH + h*scaleH/2 + Reflectionspacing, z); + + + //Bottom Right + glColor4f(ColR * Int, ColG * Int, ColB * Int, 0); + glTexCoord2f(TexX2*TexW, {TexY1*TexH*}0.5); + glVertex3f(x+w*scaleW, y+h*scaleH + h*scaleH/2 + Reflectionspacing, z); + + //Top Right + glColor4f(ColR * Int, ColG * Int, ColB * Int, Alpha-0.3); + glTexCoord2f(TexX2*TexW, TexY2*TexH); + glVertex3f(x+w*scaleW, y+h*scaleH + Reflectionspacing, z); + glEnd; + end; + end; + end; constructor TStatic.Create(Textura: TTexture); -- cgit v1.2.3 From b8722c611ffaabde301f3134c1c8d76e64e3b02f Mon Sep 17 00:00:00 2001 From: whiteshark0 Date: Fri, 13 Apr 2007 12:10:49 +0000 Subject: Fixed Bug in Reflection Code that Causes wrong Depth Test when drawing Text git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@84 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Menu/UMenuStatic.pas | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'Game/Code/Menu/UMenuStatic.pas') diff --git a/Game/Code/Menu/UMenuStatic.pas b/Game/Code/Menu/UMenuStatic.pas index c19e6abc..2a5e1e93 100644 --- a/Game/Code/Menu/UMenuStatic.pas +++ b/Game/Code/Menu/UMenuStatic.pas @@ -25,6 +25,7 @@ var Pet: integer; begin if Visible then + begin DrawTexture(Texture); //Reflection Mod @@ -35,12 +36,12 @@ begin //Bind Tex and GL Attributes glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); + glDepthRange(0, 10); glDepthFunc(GL_LEQUAL); - //glDepthFunc(GL_GEQUAL); glEnable(GL_DEPTH_TEST); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - //glBlendFunc(GL_SRC_COLOR, GL_ZERO); glBindTexture(GL_TEXTURE_2D, TexNum); //Draw @@ -51,13 +52,13 @@ begin //Bottom Left glColor4f(ColR * Int, ColG * Int, ColB * Int, 0); - glTexCoord2f(TexX1*TexW, {TexY1*TexH*}0.5); + glTexCoord2f(TexX1*TexW, 0.5); glVertex3f(x, y+h*scaleH + h*scaleH/2 + Reflectionspacing, z); //Bottom Right glColor4f(ColR * Int, ColG * Int, ColB * Int, 0); - glTexCoord2f(TexX2*TexW, {TexY1*TexH*}0.5); + glTexCoord2f(TexX2*TexW, 0.5); glVertex3f(x+w*scaleW, y+h*scaleH + h*scaleH/2 + Reflectionspacing, z); //Top Right @@ -65,9 +66,13 @@ begin glTexCoord2f(TexX2*TexW, TexY2*TexH); glVertex3f(x+w*scaleW, y+h*scaleH + Reflectionspacing, z); glEnd; + + glDisable(GL_TEXTURE_2D); + glDisable(GL_DEPTH_TEST); + glDisable(GL_BLEND); end; end; - + end; end; constructor TStatic.Create(Textura: TTexture); -- cgit v1.2.3 From b9f7f03201214e97feebb101e3e2c0fd257353fc Mon Sep 17 00:00:00 2001 From: b1indy Date: Sun, 22 Jul 2007 14:07:29 +0000 Subject: fixed a minor bug in the reflection code that caused some reflections to be incorrectly drawn git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@316 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Menu/UMenuStatic.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Game/Code/Menu/UMenuStatic.pas') diff --git a/Game/Code/Menu/UMenuStatic.pas b/Game/Code/Menu/UMenuStatic.pas index 2a5e1e93..41d5046f 100644 --- a/Game/Code/Menu/UMenuStatic.pas +++ b/Game/Code/Menu/UMenuStatic.pas @@ -52,13 +52,13 @@ begin //Bottom Left glColor4f(ColR * Int, ColG * Int, ColB * Int, 0); - glTexCoord2f(TexX1*TexW, 0.5); + glTexCoord2f(TexX1*TexW, 0.5*TexH); glVertex3f(x, y+h*scaleH + h*scaleH/2 + Reflectionspacing, z); //Bottom Right glColor4f(ColR * Int, ColG * Int, ColB * Int, 0); - glTexCoord2f(TexX2*TexW, 0.5); + glTexCoord2f(TexX2*TexW, 0.5*TexH); glVertex3f(x+w*scaleW, y+h*scaleH + h*scaleH/2 + Reflectionspacing, z); //Top Right @@ -68,7 +68,7 @@ begin glEnd; glDisable(GL_TEXTURE_2D); - glDisable(GL_DEPTH_TEST); + glDisable(GL_DEPTH_TEST); glDisable(GL_BLEND); end; end; -- cgit v1.2.3 From 210eeef171f0842a52e1a27008b4a7be41c50ee8 Mon Sep 17 00:00:00 2001 From: b1indy Date: Sun, 22 Jul 2007 14:40:26 +0000 Subject: again some fixes in reflection code for buttons and statics git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@318 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Menu/UMenuStatic.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Game/Code/Menu/UMenuStatic.pas') diff --git a/Game/Code/Menu/UMenuStatic.pas b/Game/Code/Menu/UMenuStatic.pas index 41d5046f..5f19fbf3 100644 --- a/Game/Code/Menu/UMenuStatic.pas +++ b/Game/Code/Menu/UMenuStatic.pas @@ -52,13 +52,13 @@ begin //Bottom Left glColor4f(ColR * Int, ColG * Int, ColB * Int, 0); - glTexCoord2f(TexX1*TexW, 0.5*TexH); + glTexCoord2f(TexX1*TexW, 0.5*TexH+TexY1); glVertex3f(x, y+h*scaleH + h*scaleH/2 + Reflectionspacing, z); //Bottom Right glColor4f(ColR * Int, ColG * Int, ColB * Int, 0); - glTexCoord2f(TexX2*TexW, 0.5*TexH); + glTexCoord2f(TexX2*TexW, 0.5*TexH+TexY1); glVertex3f(x+w*scaleW, y+h*scaleH + h*scaleH/2 + Reflectionspacing, z); //Top Right -- cgit v1.2.3 From 247cbdca4eb8af228fa1753f1185e85077b5befa Mon Sep 17 00:00:00 2001 From: b1indy Date: Fri, 7 Sep 2007 21:09:02 +0000 Subject: UScreenSing.pas, UScreenSingModi.pas: removed Uffmpeg and USmpeg, added UVideo UGraphic.pas: prepared for possible loading animation UGraphicClasses.pas, ULCD.pas, ULight.pas, UMain.pas, USkins.pas, UDisplay.pas, UMenuButton.pas, UMenuSelect.pas, UMenuSelectSlide.pas, UMenuStatic.pas, UScreenCredits.pas, UScreenEditSub.pas, UScreenOpen.pas, UScreenPopup.pas: some fixes to get rid of some compiler infos/warnings git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@374 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Menu/UMenuStatic.pas | 2 -- 1 file changed, 2 deletions(-) (limited to 'Game/Code/Menu/UMenuStatic.pas') diff --git a/Game/Code/Menu/UMenuStatic.pas b/Game/Code/Menu/UMenuStatic.pas index 5f19fbf3..cfa4a596 100644 --- a/Game/Code/Menu/UMenuStatic.pas +++ b/Game/Code/Menu/UMenuStatic.pas @@ -21,8 +21,6 @@ implementation uses UDrawTexture; procedure TStatic.Draw; -var - Pet: integer; begin if Visible then begin -- cgit v1.2.3 From 391d30716d48dc709f6444b19c008e82311623b9 Mon Sep 17 00:00:00 2001 From: eddie-0815 Date: Thu, 1 Nov 2007 19:34:40 +0000 Subject: Mac OS X version compiles and links. I hope I didn't break too many files on windows/linux. Added switches.inc to all files. Changed many IFDEFs. For Windows-only code please use MSWINDOWS instead of WIN32 now. WIN32 is also used by the Mac port. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@546 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Menu/UMenuStatic.pas | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Game/Code/Menu/UMenuStatic.pas') diff --git a/Game/Code/Menu/UMenuStatic.pas b/Game/Code/Menu/UMenuStatic.pas index cfa4a596..a2c709ad 100644 --- a/Game/Code/Menu/UMenuStatic.pas +++ b/Game/Code/Menu/UMenuStatic.pas @@ -1,6 +1,9 @@ unit UMenuStatic; interface + +{$I switches.inc} + uses UTexture, OpenGL12; type -- cgit v1.2.3