- let FOBJModel::ParseVector actually use its templated size parameter

In this setup the array can be statically updated because the size is always constant per instantiation
This commit is contained in:
Christoph Oelckers 2018-11-30 17:12:36 +01:00
parent 25ad71a113
commit a3df67bdd4

View file

@ -236,7 +236,7 @@ bool FOBJModel::Load(const char* fn, int lumpnum, const char* buffer, int length
*/
template<typename T, size_t L> void FOBJModel::ParseVector(TArray<T> &array)
{
float *coord = new float[L];
float coord[L];
for (size_t axis = 0; axis < L; axis++)
{
sc.MustGetFloat();
@ -244,7 +244,6 @@ template<typename T, size_t L> void FOBJModel::ParseVector(TArray<T> &array)
}
T vec(coord);
array.Push(vec);
delete[] coord;
}
/**