40 #include "glimports.h"
44 #include "trimvertex.h"
45 #include "trimvertpool.h"
52 TrimVertexPool::TrimVertexPool(
void )
53 : pool( sizeof(
TrimVertex)*3, 32,
"Threevertspool" )
57 vlistsize = INIT_VERTLISTSIZE;
58 vlist =
new TrimVertex_p[vlistsize];
65 TrimVertexPool::~TrimVertexPool(
void )
68 while( nextvlistslot ) {
69 delete [] vlist[--nextvlistslot];
73 if( vlist )
delete[] vlist;
81 TrimVertexPool::clear(
void )
87 while( nextvlistslot ) {
88 delete [] vlist[--nextvlistslot];
89 vlist[nextvlistslot] = 0;
93 if( vlist )
delete[] vlist;
94 vlist =
new TrimVertex_p[vlistsize];
103 TrimVertexPool::get(
int n )
109 if( nextvlistslot == vlistsize ) {
111 TrimVertex_p *nvlist =
new TrimVertex_p[vlistsize];
112 memcpy( nvlist, vlist, nextvlistslot *
sizeof(TrimVertex_p) );
113 if( vlist )
delete[] vlist;
116 v = vlist[nextvlistslot++] =
new TrimVertex[n];