From f07679223c031ca8365a53fcc11512c4bfd1a01e Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 18 Nov 2000 17:12:10 +0000 Subject: 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 --- common/pieceinf.cpp | 26 ++++++++++++++++---------- docs/CHANGES.txt | 17 +++++++++++++++++ 2 files changed, 33 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) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index baa4f88..1a3ec35 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -1,5 +1,22 @@ This is a changelog for developers only, not for ordinary users. +18/11/2000 + - Fixed Z buffer bug in the piece preview. + - Fixed blending in piece preview. + +12/11/2000 + - Added the PtrArray class. + - Started adding the internal messaging system. + - Link with g++ instead of gcc. + - Moved all keyframer functions to the Object class. + +09/11/2000 + - First implementation of the light classes. + - Added a const float* operator to the Vector class. + - Added functions to create transformation matrixes. + - Faster rendering of the camera objects. + - Added new minifig pieces. + 01/10/2000 - Added an option to save custom minifigs to the Minifig Wizard. -- cgit v1.2.3