Killed the last of the memory leaks, and included a change to Entity.h, which should have been with PREVIOUS memory-leak plugs.

This commit is contained in:
Shamus Young 2009-05-08 13:25:42 +00:00
parent 94871004c0
commit 2436ad8d61
3 changed files with 8 additions and 6 deletions

View File

@ -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; }
};

View File

@ -43,8 +43,12 @@ CMesh::CMesh ()
CMesh::~CMesh ()
{
if (_list)
glDeleteLists (_list, 1);
_vertex.clear ();
_fan.clear ();
_quad_strip.clear ();
_cube.clear ();
}

3
Mesh.h
View File

@ -24,14 +24,11 @@ public:
unsigned _list;
int _polycount;
std::vector<GLvertex> _vertex;
std::vector<GLvector> _normal;
std::vector<GLtriangle> _triangle;
std::vector<cube> _cube;
std::vector<quad_strip> _quad_strip;
std::vector<fan> _fan;
bool _compiled;
void NormalAdd (const GLvector& n);
void VertexAdd (const GLvertex& v);
int VertexCount () { return _vertex.size(); }
int PolyCount () { return _polycount; }