diff --git a/common/piece.cpp b/common/piece.cpp index 25315f9b..cf925e5d 100644 --- a/common/piece.cpp +++ b/common/piece.cpp @@ -536,14 +536,14 @@ void Piece::RenderBox(bool bHilite, float fLineWidth) glLineWidth(2*fLineWidth); glPushAttrib(GL_POLYGON_BIT); glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glCallList(mPieceInfo->GetBoxDisplayList()); + mPieceInfo->RenderBox(); glPopAttrib(); glLineWidth(fLineWidth); } else { lcSetColor(mColorIndex); - glCallList(mPieceInfo->GetBoxDisplayList()); + mPieceInfo->RenderBox(); } glPopMatrix(); } diff --git a/common/pieceinf.cpp b/common/pieceinf.cpp index f8030c48..024b2490 100644 --- a/common/pieceinf.cpp +++ b/common/pieceinf.cpp @@ -14,7 +14,6 @@ PieceInfo::PieceInfo(int ZipFileIndex) mFlags = 0; mMesh = NULL; mRefCount = 0; - m_nBoxList = 0; } PieceInfo::~PieceInfo() @@ -33,14 +32,8 @@ void PieceInfo::CreatePlaceholder(const char* Name) mFlags = LC_PIECE_PLACEHOLDER; } -void PieceInfo::CreateBoxDisplayList() +void PieceInfo::RenderBox() { - if (m_nBoxList) - return; - - // Create a display for the bounding box. - m_nBoxList = glGenLists(1); - glNewList(m_nBoxList, GL_COMPILE); glEnableClientState(GL_VERTEX_ARRAY); float box[24][3] = @@ -73,7 +66,6 @@ void PieceInfo::CreateBoxDisplayList() glVertexPointer(3, GL_FLOAT, 0, box); glDrawArrays(GL_QUADS, 0, 24); - glEndList(); } void PieceInfo::Load() @@ -110,10 +102,6 @@ void PieceInfo::Unload() delete mMesh; mMesh = NULL; - - if (m_nBoxList != 0) - glDeleteLists(m_nBoxList, 1); - m_nBoxList = 0; } // Zoom extents for the preview window and print catalog diff --git a/common/pieceinf.h b/common/pieceinf.h index 267fe51e..aa64f7ae 100644 --- a/common/pieceinf.h +++ b/common/pieceinf.h @@ -76,14 +76,8 @@ public: // Operations void ZoomExtents(float Fov, float Aspect, float* EyePos = NULL) const; void RenderPiece(int nColor); + void RenderBox(); - // Implementation - GLuint GetBoxDisplayList() - { - if (!m_nBoxList) - CreateBoxDisplayList(); - return m_nBoxList; - }; void CreatePlaceholder(const char* Name); public: @@ -98,11 +92,9 @@ public: protected: int mRefCount; - GLuint m_nBoxList; void Load(); void Unload(); - void CreateBoxDisplayList(); }; #endif // _PIECEINF_H_