Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 330 vs 331 for /trunk/Source Code/Geometry/Shapes/Object3D.cpp

Diff revisions: vs.
  @@ -23,12 +23,13 @@
23 23 Object3D::~Object3D()
24 24 {
25 25 if ( !bitCompare( _geometryFlagMask, OBJECT_FLAG_NO_VB ) ) {
26 - MemoryManager::SAFE_DELETE( _buffer );
26 + MemoryManager::DELETE( _buffer );
27 27 }
28 28 }
29 29
30 30 void Object3D::setGeometryVB(VertexBuffer* const vb) {
31 - DIVIDE_ASSERT(_buffer == nullptr, "Object3D error: Please remove the previous vertex buffer of this Object3D before specifying a new one!");
31 + DIVIDE_ASSERT(_buffer == nullptr,
32 + "Object3D error: Please remove the previous vertex buffer of this Object3D before specifying a new one!");
32 33 _buffer = vb;
33 34 }
34 35
  @@ -36,7 +37,10 @@
36 37 return _buffer;
37 38 }
38 39
39 - void Object3D::getDrawCommands(SceneGraphNode* const sgn, const RenderStage& currentRenderStage, SceneRenderState& sceneRenderState, vectorImpl<GenericDrawCommand>& drawCommandsOut) {
40 + void Object3D::getDrawCommands(SceneGraphNode* const sgn,
41 + const RenderStage& currentRenderStage,
42 + SceneRenderState& sceneRenderState,
43 + vectorImpl<GenericDrawCommand>& drawCommandsOut) {
40 44 RenderingComponent* const renderable = sgn->getComponent<RenderingComponent>();
41 45 assert(renderable != nullptr);
42 46
  @@ -66,7 +70,8 @@
66 70 vec3<F32> v1 , v2, normal;
67 71 //Code from http://devmaster.net/forums/topic/1065-calculating-normals-of-a-mesh/
68 72
69 - vectorImpl<vec3<F32> >* normal_buffer = New vectorImpl<vec3<F32> >[getGeometryVB()->getPosition().size()];
73 + vectorImpl<vec3<F32> >* normal_buffer = nullptr;
74 + normal_buffer = MemoryManager_NEW vectorImpl<vec3<F32> >[getGeometryVB()->getPosition().size()];
70 75
71 76 for( U32 i = 0; i < getGeometryVB()->getIndexCount(); i += 3 ) {
72 77 // get the three vertices that make the faces
  @@ -97,7 +102,7 @@
97 102
98 103 getGeometryVB()->modifyNormalValue(i, currentNormal);
99 104 }
100 - MemoryManager::SAFE_DELETE_ARRAY( normal_buffer );
105 + MemoryManager::DELETE_ARRAY( normal_buffer );
101 106 }
102 107
103 108 void Object3D::computeTangents(){
  @@ -156,7 +161,8 @@
156 161 U32 partitionCount = geometry->getPartitionCount(_geometryPartitionId);
157 162 PrimitiveType type = (_geometryType == MESH || _geometryType == SUBMESH ? TRIANGLES : TRIANGLE_STRIP);
158 163 //We can't have a VB without vertex positions
159 - DIVIDE_ASSERT(!geometry->getPosition().empty(), "Object3D error: computeTriangleList called with no position data available!");
164 + DIVIDE_ASSERT(!geometry->getPosition().empty(),
165 + "Object3D error: computeTriangleList called with no position data available!");
160 166
161 167 if(!_geometryTriangles.empty() && force)
162 168 _geometryTriangles.resize(0);