Abandon line strips that are of size 0/1
parent
da5f621a19
commit
2cf37d3e70
|
@ -310,13 +310,18 @@ public:
|
|||
inline void end(bool flushIfNeeded = true)
|
||||
{
|
||||
#if USE_VERTEX_BUFFER
|
||||
if (currentPosition > 1)
|
||||
if (currentStripLength > 1)
|
||||
{
|
||||
int index = currentPosition * 2;
|
||||
memcpy(&data[index], &data[index - 4], 2 * sizeof(Vertex));
|
||||
currentPosition += 1;
|
||||
stripLengths.push_back(currentStripLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Abandon line strips that only contains zero/one point
|
||||
currentPosition -= currentStripLength;
|
||||
}
|
||||
stripLengths.push_back(currentStripLength);
|
||||
currentStripLength = 0;
|
||||
if (flushIfNeeded && currentPosition == capacity)
|
||||
flush(false);
|
||||
|
|
Loading…
Reference in New Issue