aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authorwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-13 12:10:49 +0000
committerwhiteshark0 <whiteshark0@b956fd51-792f-4845-bead-9b4dfca2ff2c>2007-04-13 12:10:49 +0000
commitb8722c611ffaabde301f3134c1c8d76e64e3b02f (patch)
tree8e2e3dcb9c5ef2351f99515098c021ab3fe4403e /Game/Code
parente6917faa19aebfa6d089b24c65e4c7fe4bd6b503 (diff)
downloadusdx-b8722c611ffaabde301f3134c1c8d76e64e3b02f.tar.gz
usdx-b8722c611ffaabde301f3134c1c8d76e64e3b02f.tar.xz
usdx-b8722c611ffaabde301f3134c1c8d76e64e3b02f.zip
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
Diffstat (limited to '')
-rw-r--r--Game/Code/Menu/UMenuButton.pas8
-rw-r--r--Game/Code/Menu/UMenuStatic.pas15
2 files changed, 16 insertions, 7 deletions
diff --git a/Game/Code/Menu/UMenuButton.pas b/Game/Code/Menu/UMenuButton.pas
index f4f8e1a8..3a871c5f 100644
--- a/Game/Code/Menu/UMenuButton.pas
+++ b/Game/Code/Menu/UMenuButton.pas
@@ -179,12 +179,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
@@ -209,6 +209,10 @@ 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;
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);