summaryrefslogtreecommitdiff
path: root/common/pieceinf.cpp
diff options
context:
space:
mode:
authorleo2000-11-18 17:12:10 +0000
committerleo2000-11-18 17:12:10 +0000
commitf07679223c031ca8365a53fcc11512c4bfd1a01e (patch)
treedd2a44740241e83714929212bfee301e0c7ca1b4 /common/pieceinf.cpp
parent09746a951bb47ab3813f2fda9cf48444aca372b9 (diff)
Fixed Z buffer bug in the piece preview.
Fixed blending in the piece preview. git-svn-id: http://svn.leocad.org/trunk@164 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/pieceinf.cpp')
-rw-r--r--common/pieceinf.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/common/pieceinf.cpp b/common/pieceinf.cpp
index 92aa1cb..6c4e851 100644
--- a/common/pieceinf.cpp
+++ b/common/pieceinf.cpp
@@ -1636,18 +1636,20 @@ void PieceInfo::RenderPiece(int nColor)
curcolor = (unsigned short)*info;
info++;
- glColor3ubv(FlatColorArray[curcolor]);
if (curcolor > 13 && curcolor < 22)
{
// glEnable (GL_POLYGON_STIPPLE);
- glEnable (GL_BLEND);
- glDepthMask (GL_FALSE);
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable (GL_BLEND);
+ glDepthMask (GL_FALSE);
+ glColor4ubv (ColorArray[curcolor]);
}
else
{
// glDisable (GL_POLYGON_STIPPLE);
- glDepthMask (GL_TRUE);
- glDisable (GL_BLEND);
+ glDepthMask (GL_TRUE);
+ glDisable (GL_BLEND);
+ glColor3ubv (FlatColorArray[curcolor]);
}
if (*info)
@@ -1677,18 +1679,20 @@ void PieceInfo::RenderPiece(int nColor)
curcolor = *info;
info++;
- glColor3ubv(FlatColorArray[curcolor]);
if (curcolor > 13 && curcolor < 22)
{
// glEnable (GL_POLYGON_STIPPLE);
- glEnable (GL_BLEND);
- glDepthMask (GL_FALSE);
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ glEnable (GL_BLEND);
+ glDepthMask (GL_FALSE);
+ glColor4ubv (ColorArray[curcolor]);
}
else
{
// glDisable (GL_POLYGON_STIPPLE);
- glDepthMask (GL_TRUE);
- glDisable (GL_BLEND);
+ glDepthMask (GL_TRUE);
+ glDisable (GL_BLEND);
+ glColor3ubv(FlatColorArray[curcolor]);
}
if (*info)
@@ -1703,6 +1707,8 @@ void PieceInfo::RenderPiece(int nColor)
}
}
}
+ // if glDepthMask is GL_FALSE then glClearBuffer (GL_DEPTH_BUFFER_BIT) doesn't work
+ glDepthMask (GL_TRUE);
}
void PieceInfo::WriteWavefront(FILE* file, unsigned char color, unsigned long* start)