mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 13:09:42 +00:00
Preallocate lines in NiLinesData
This commit is contained in:
parent
145ce8f924
commit
b9f552b7f4
1 changed files with 3 additions and 0 deletions
|
@ -126,6 +126,8 @@ namespace Nif
|
|||
// Can't construct a line from a single vertex.
|
||||
if (mNumVertices < 2)
|
||||
return;
|
||||
// There can't be more than 2 indices for each vertex
|
||||
mLines.reserve(mNumVertices * 2);
|
||||
// Convert connectivity flags into usable geometry. The last element needs special handling.
|
||||
for (uint16_t i = 0; i < mNumVertices - 1; ++i)
|
||||
{
|
||||
|
@ -141,6 +143,7 @@ namespace Nif
|
|||
mLines.emplace_back(mNumVertices - 1);
|
||||
mLines.emplace_back(0);
|
||||
}
|
||||
mLines.shrink_to_fit();
|
||||
}
|
||||
|
||||
void NiParticlesData::read(NIFStream* nif)
|
||||
|
|
Loading…
Reference in a new issue