Showing the changes to libraries/script-engine/src/ModelScriptingInterface.cpp (1 of 2 files). Show all
Unified · Split
| @@ -60,19 +60,19 @@ QScriptValue ModelScriptingInterface::appendMeshes(MeshProxyList in) { · 59 unmodified lines | |||
| 60 | 60 | ||
| 61 | // alloc the resulting mesh | 61 | // alloc the resulting mesh |
| 62 | gpu::Resource::Size combinedVertexSize = totalVertexCount * sizeof(glm::vec3); | 62 | gpu::Resource::Size combinedVertexSize = totalVertexCount * sizeof(glm::vec3); |
| 63 | std::unique_ptr<unsigned char> combinedVertexData{ new unsigned char[combinedVertexSize] }; | 63 | std::unique_ptr<unsigned char[]> combinedVertexData{ new unsigned char[combinedVertexSize] }; |
| 64 | unsigned char* combinedVertexDataCursor = combinedVertexData.get(); | 64 | unsigned char* combinedVertexDataCursor = combinedVertexData.get(); |
| 65 | 65 | ||
| 66 | gpu::Resource::Size combinedColorSize = totalColorCount * sizeof(glm::vec3); | 66 | gpu::Resource::Size combinedColorSize = totalColorCount * sizeof(glm::vec3); |
| 67 | std::unique_ptr<unsigned char> combinedColorData{ new unsigned char[combinedColorSize] }; | 67 | std::unique_ptr<unsigned char[]> combinedColorData{ new unsigned char[combinedColorSize] }; |
| 68 | unsigned char* combinedColorDataCursor = combinedColorData.get(); | 68 | unsigned char* combinedColorDataCursor = combinedColorData.get(); |
| 69 | 69 | ||
| 70 | gpu::Resource::Size combinedNormalSize = totalNormalCount * sizeof(glm::vec3); | 70 | gpu::Resource::Size combinedNormalSize = totalNormalCount * sizeof(glm::vec3); |
| 71 | std::unique_ptr<unsigned char> combinedNormalData{ new unsigned char[combinedNormalSize] }; | 71 | std::unique_ptr<unsigned char[]> combinedNormalData{ new unsigned char[combinedNormalSize] }; |
| 72 | unsigned char* combinedNormalDataCursor = combinedNormalData.get(); | 72 | unsigned char* combinedNormalDataCursor = combinedNormalData.get(); |
| 73 | 73 | ||
| 74 | gpu::Resource::Size combinedIndexSize = totalIndexCount * sizeof(uint32_t); | 74 | gpu::Resource::Size combinedIndexSize = totalIndexCount * sizeof(uint32_t); |
| 75 | std::unique_ptr<unsigned char> combinedIndexData{ new unsigned char[combinedIndexSize] }; | 75 | std::unique_ptr<unsigned char[]> combinedIndexData{ new unsigned char[combinedIndexSize] }; |
| 76 | unsigned char* combinedIndexDataCursor = combinedIndexData.get(); | 76 | unsigned char* combinedIndexDataCursor = combinedIndexData.get(); |
| 77 | 77 | ||
| 78 | uint32_t indexStartOffset { 0 }; | 78 | uint32_t indexStartOffset { 0 }; |