diff --git a/Entity.h b/Entity.h index 9c58a93..c9d1fae 100644 --- a/Entity.h +++ b/Entity.h @@ -15,13 +15,14 @@ protected: public: CEntity (void); - GLvector Center () { return _center; } + virtual ~CEntity () {}; virtual void Render (void); virtual void RenderFlat (bool wirefame); virtual unsigned Texture () { return 0; } virtual void Update (void); virtual bool Alpha () { return false; } virtual int PolyCount () { return 0; } + GLvector Center () { return _center; } }; diff --git a/Mesh.cpp b/Mesh.cpp index 2530e35..80749bc 100644 --- a/Mesh.cpp +++ b/Mesh.cpp @@ -43,8 +43,12 @@ CMesh::CMesh () CMesh::~CMesh () { - if (_list) - glDeleteLists (_list, 1); + glDeleteLists (_list, 1); + _vertex.clear (); + _fan.clear (); + _quad_strip.clear (); + _cube.clear (); + } diff --git a/Mesh.h b/Mesh.h index 2d0639b..4513a62 100644 --- a/Mesh.h +++ b/Mesh.h @@ -24,14 +24,11 @@ public: unsigned _list; int _polycount; std::vector _vertex; - std::vector _normal; - std::vector _triangle; std::vector _cube; std::vector _quad_strip; std::vector _fan; bool _compiled; - void NormalAdd (const GLvector& n); void VertexAdd (const GLvertex& v); int VertexCount () { return _vertex.size(); } int PolyCount () { return _polycount; }