From 6cb896ff0a7d24be3ff500585642ae5d61a5b788 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 28 Feb 2012 16:45:01 +0000 Subject: Cycles: fix msvc compile warning, patch by Jason Wilkins. --- intern/cycles/render/attribute.cpp | 7 ++++--- intern/cycles/render/attribute.h | 2 +- intern/cycles/render/mesh.cpp | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'intern') diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp index aa18ca7d7cb..9e90bf1b625 100644 --- a/intern/cycles/render/attribute.cpp +++ b/intern/cycles/render/attribute.cpp @@ -101,9 +101,9 @@ ustring Attribute::standard_name(Attribute::Standard std) /* Attribute Set */ -AttributeSet::AttributeSet(Mesh *mesh_) +AttributeSet::AttributeSet() { - mesh = mesh_; + mesh = NULL; } AttributeSet::~AttributeSet() @@ -133,7 +133,8 @@ Attribute *AttributeSet::add(ustring name, TypeDesc type, Attribute::Element ele else if(element == Attribute::CORNER) attr->set(name, type, element); - attr->reserve(mesh->verts.size(), mesh->triangles.size()); + if(mesh) + attr->reserve(mesh->verts.size(), mesh->triangles.size()); return attr; } diff --git a/intern/cycles/render/attribute.h b/intern/cycles/render/attribute.h index aef215d6c0c..7af4657daa3 100644 --- a/intern/cycles/render/attribute.h +++ b/intern/cycles/render/attribute.h @@ -94,7 +94,7 @@ public: Mesh *mesh; list attributes; - AttributeSet(Mesh *mesh); + AttributeSet(); ~AttributeSet(); Attribute *add(ustring name, TypeDesc type, Attribute::Element element); diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index cd533f24058..a7eb365f983 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -38,7 +38,6 @@ CCL_NAMESPACE_BEGIN /* Mesh */ Mesh::Mesh() -: attributes(this) { need_update = true; transform_applied = false; @@ -49,6 +48,8 @@ Mesh::Mesh() tri_offset = 0; vert_offset = 0; + + attributes.mesh = this; } Mesh::~Mesh() -- cgit v1.2.3