mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-27 22:42:29 +00:00
- fixed parsing of 2D vectors in OBJ model loader
There is no `TVector2<>` constructor that accepts a pointer to float. However, there is such constructor in `TVector3<>`, so `TVector2<>` can be constructed from `float*` implicitly via temporary `TVector3<>` object.
This commit is contained in:
parent
e8f007c6ce
commit
ff784fc905
1 changed files with 3 additions and 4 deletions
|
@ -240,13 +240,12 @@ 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)
|
template<typename T, size_t L> void FOBJModel::ParseVector(TArray<T> &array)
|
||||||
{
|
{
|
||||||
float coord[L];
|
T vec;
|
||||||
for (size_t axis = 0; axis < L; axis++)
|
for (unsigned axis = 0; axis < L; axis++)
|
||||||
{
|
{
|
||||||
sc.MustGetFloat();
|
sc.MustGetFloat();
|
||||||
coord[axis] = (float)sc.Float;
|
vec[axis] = (float)sc.Float;
|
||||||
}
|
}
|
||||||
T vec(coord);
|
|
||||||
array.Push(vec);
|
array.Push(vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue