summaryrefslogtreecommitdiffstats
path: root/src/render/io/assimpparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/io/assimpparser.cpp')
-rw-r--r--src/render/io/assimpparser.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/render/io/assimpparser.cpp b/src/render/io/assimpparser.cpp
index 49a1a79fb..8f8f3b10a 100644
--- a/src/render/io/assimpparser.cpp
+++ b/src/render/io/assimpparser.cpp
@@ -53,6 +53,8 @@
#include <qmaterial.h>
#include <texture.h>
#include "renderlogging.h"
+#include "qbuffer.h"
+#include "qattribute.h"
QT_BEGIN_NAMESPACE
@@ -476,31 +478,31 @@ void AssimpParser::loadMesh(uint meshIndex)
// Add vertex attributes to the mesh with the right array
meshData->addAttribute(VERTICES_ATTRIBUTE_NAME,
- new Attribute(vbuffer,
+ AttributePtr(new Attribute(vbuffer,
GL_FLOAT_VEC3,
mesh->mNumVertices,
0,
- chunkSize * sizeof(float)));
+ chunkSize * sizeof(float))));
meshData->addAttribute(NORMAL_ATTRIBUTE_NAME,
- new Attribute(vbuffer,
+ AttributePtr(new Attribute(vbuffer,
GL_FLOAT_VEC3,
mesh->mNumVertices,
3 * sizeof(float),
- chunkSize * sizeof(float)));
+ chunkSize * sizeof(float))));
if (hasTangent)
meshData->addAttribute(TANGENT_ATTRIBUTE_NAME,
- new Attribute(vbuffer,
+ AttributePtr(new Attribute(vbuffer,
GL_FLOAT_VEC3,
mesh->mNumVertices,
6 * sizeof(float),
- chunkSize * sizeof(float)));
+ chunkSize * sizeof(float))));
if (hasTexture)
meshData->addAttribute(TEXTCOORD_ATTRIBUTE_NAME,
- new Attribute(vbuffer,
+ AttributePtr(new Attribute(vbuffer,
GL_FLOAT_VEC2,
mesh->mNumVertices,
(hasTangent ? 9 : 6) * sizeof(float),
- chunkSize * sizeof(float)));
+ chunkSize * sizeof(float))));
GLuint indiceType;
QByteArray ibufferContent;
uint indices = mesh->mNumFaces * 3;
@@ -532,7 +534,7 @@ void AssimpParser::loadMesh(uint meshIndex)
ibuffer->setData(ibufferContent);
// Add indices attributes
- meshData->setIndexAttr(AttributePtr(new Attribute(ibuffer, indiceType, indices, 0, 0)));
+ meshData->setIndexAttribute(AttributePtr(new Attribute(ibuffer, indiceType, indices, 0, 0)));
meshData->computeBoundsFromAttribute(VERTICES_ATTRIBUTE_NAME);