|
|
@ -114,7 +114,7 @@ plGBufferGroup::plGBufferGroup( uint8_t format, bool vertsVolatile, bool idxVola |
|
|
|
{ |
|
|
|
{ |
|
|
|
fVertBuffStorage.Reset(); |
|
|
|
fVertBuffStorage.Reset(); |
|
|
|
fIdxBuffStorage.Reset(); |
|
|
|
fIdxBuffStorage.Reset(); |
|
|
|
fColorBuffStorage.Reset(); |
|
|
|
fColorBuffStorage.clear(); |
|
|
|
fVertexBufferRefs.Reset(); |
|
|
|
fVertexBufferRefs.Reset(); |
|
|
|
fIndexBufferRefs.Reset(); |
|
|
|
fIndexBufferRefs.Reset(); |
|
|
|
fCells.clear(); |
|
|
|
fCells.clear(); |
|
|
@ -216,7 +216,7 @@ void plGBufferGroup::CleanUp( void ) |
|
|
|
plProfile_DelMem(MemBufGrpIndex, fIdxBuffCounts[i] * sizeof(uint16_t)); |
|
|
|
plProfile_DelMem(MemBufGrpIndex, fIdxBuffCounts[i] * sizeof(uint16_t)); |
|
|
|
delete [] fIdxBuffStorage[ i ]; |
|
|
|
delete [] fIdxBuffStorage[ i ]; |
|
|
|
} |
|
|
|
} |
|
|
|
for( i = 0; i < fColorBuffStorage.GetCount(); i++ ) |
|
|
|
for (size_t i = 0; i < fColorBuffStorage.size(); ++i) |
|
|
|
{ |
|
|
|
{ |
|
|
|
plProfile_DelMem(MemBufGrpVertex, fColorBuffCounts[i] * sizeof(plGBufferColor)); |
|
|
|
plProfile_DelMem(MemBufGrpVertex, fColorBuffCounts[i] * sizeof(plGBufferColor)); |
|
|
|
delete [] fColorBuffStorage[ i ]; |
|
|
|
delete [] fColorBuffStorage[ i ]; |
|
|
@ -233,8 +233,8 @@ void plGBufferGroup::CleanUp( void ) |
|
|
|
fIdxBuffCounts.Reset(); |
|
|
|
fIdxBuffCounts.Reset(); |
|
|
|
fIdxBuffStarts.Reset(); |
|
|
|
fIdxBuffStarts.Reset(); |
|
|
|
fIdxBuffEnds.Reset(); |
|
|
|
fIdxBuffEnds.Reset(); |
|
|
|
fColorBuffStorage.Reset(); |
|
|
|
fColorBuffStorage.clear(); |
|
|
|
fColorBuffCounts.Reset(); |
|
|
|
fColorBuffCounts.clear(); |
|
|
|
|
|
|
|
|
|
|
|
fCells.clear(); |
|
|
|
fCells.clear(); |
|
|
|
} |
|
|
|
} |
|
|
@ -374,7 +374,7 @@ void plGBufferGroup::Read( hsStream *s ) |
|
|
|
fVertBuffSizes.Reset(); |
|
|
|
fVertBuffSizes.Reset(); |
|
|
|
fVertBuffStarts.Reset(); |
|
|
|
fVertBuffStarts.Reset(); |
|
|
|
fVertBuffEnds.Reset(); |
|
|
|
fVertBuffEnds.Reset(); |
|
|
|
fColorBuffCounts.Reset(); |
|
|
|
fColorBuffCounts.clear(); |
|
|
|
fIdxBuffCounts.Reset(); |
|
|
|
fIdxBuffCounts.Reset(); |
|
|
|
fIdxBuffStarts.Reset(); |
|
|
|
fIdxBuffStarts.Reset(); |
|
|
|
fIdxBuffEnds.Reset(); |
|
|
|
fIdxBuffEnds.Reset(); |
|
|
@ -401,8 +401,8 @@ void plGBufferGroup::Read( hsStream *s ) |
|
|
|
|
|
|
|
|
|
|
|
coder.Read(s, vData, fFormat, fStride, numVerts); |
|
|
|
coder.Read(s, vData, fFormat, fStride, numVerts); |
|
|
|
|
|
|
|
|
|
|
|
fColorBuffCounts.Append(0);
|
|
|
|
fColorBuffCounts.push_back(0); |
|
|
|
fColorBuffStorage.Append(nil); |
|
|
|
fColorBuffStorage.push_back(nullptr); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
@ -420,7 +420,7 @@ void plGBufferGroup::Read( hsStream *s ) |
|
|
|
plProfile_NewMem(MemBufGrpVertex, temp); |
|
|
|
plProfile_NewMem(MemBufGrpVertex, temp); |
|
|
|
|
|
|
|
|
|
|
|
temp = s->ReadLE32(); |
|
|
|
temp = s->ReadLE32(); |
|
|
|
fColorBuffCounts.Append( temp ); |
|
|
|
fColorBuffCounts.push_back( temp ); |
|
|
|
|
|
|
|
|
|
|
|
if( temp > 0 ) |
|
|
|
if( temp > 0 ) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -431,7 +431,7 @@ void plGBufferGroup::Read( hsStream *s ) |
|
|
|
else |
|
|
|
else |
|
|
|
cData = nil; |
|
|
|
cData = nil; |
|
|
|
|
|
|
|
|
|
|
|
fColorBuffStorage.Append( cData ); |
|
|
|
fColorBuffStorage.push_back( cData ); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -753,8 +753,8 @@ bool plGBufferGroup::ReserveVertStorage( uint32_t numVerts, uint32_t *vbIndex |
|
|
|
fVertBuffStarts.Append(0); |
|
|
|
fVertBuffStarts.Append(0); |
|
|
|
fVertBuffEnds.Append(-1); |
|
|
|
fVertBuffEnds.Append(-1); |
|
|
|
|
|
|
|
|
|
|
|
fColorBuffStorage.Append( nil ); |
|
|
|
fColorBuffStorage.push_back(nullptr); |
|
|
|
fColorBuffCounts.Append( 0 ); |
|
|
|
fColorBuffCounts.push_back(0); |
|
|
|
|
|
|
|
|
|
|
|
fCells.push_back( new std::vector<plGBufferCell> ); |
|
|
|
fCells.push_back( new std::vector<plGBufferCell> ); |
|
|
|
} |
|
|
|
} |
|
|
@ -795,15 +795,15 @@ bool plGBufferGroup::ReserveVertStorage( uint32_t numVerts, uint32_t *vbIndex |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// Switch over
|
|
|
|
/// Switch over
|
|
|
|
if( storagePtr != nil ) |
|
|
|
if (storagePtr) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( fVertBuffStorage[ i ] != nil ) |
|
|
|
if( fVertBuffStorage[ i ] != nil ) |
|
|
|
delete [] fVertBuffStorage[ i ]; |
|
|
|
delete [] fVertBuffStorage[ i ]; |
|
|
|
fVertBuffStorage[ i ] = storagePtr; |
|
|
|
fVertBuffStorage[ i ] = storagePtr; |
|
|
|
} |
|
|
|
} |
|
|
|
if( cStoragePtr != nil ) |
|
|
|
if (cStoragePtr) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( fColorBuffStorage[ i ] != nil ) |
|
|
|
if (fColorBuffStorage[ i ]) |
|
|
|
delete [] fColorBuffStorage[ i ]; |
|
|
|
delete [] fColorBuffStorage[ i ]; |
|
|
|
fColorBuffStorage[ i ] = cStoragePtr; |
|
|
|
fColorBuffStorage[ i ] = cStoragePtr; |
|
|
|
fColorBuffCounts[ i ] += numVerts; |
|
|
|
fColorBuffCounts[ i ] += numVerts; |
|
|
|