Merge branch 'compiler_error_fix' into 'master'

Compiler error fix

Closes #18 

See merge request !42
This commit is contained in:
Jan Möbius
2015-12-16 13:15:47 +01:00
2 changed files with 19 additions and 10 deletions

View File

@@ -135,7 +135,8 @@ PolyConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size
edgeData_.resize(n); edgeData_.resize(n);
next_cache_.resize(6*n); next_cache_.resize(6*n);
} }
int next_cache_count = 0;
size_t next_cache_count = 0;
// don't allow degenerated faces // don't allow degenerated faces
assert (n > 2); assert (n > 2);

View File

@@ -86,7 +86,16 @@ update_viewing_configurations()
float invdet; float invdet;
float a11, a12, a13, a21, a22, a23, a31, a32, a33; float a11, a12, a13, a21, a22, a23, a31, a32, a33;
Vec3f inv_rot[3], trans; Vec3f trans;
// Workaround for internal compiler error on Visual Studio 2015 Update 1
#if (_MSC_VER >= 1900 )
Vec3f inv_rot[3]{ {},{},{} };
Vec3f normal[4]{ {},{},{},{} };
#else
Vec3f inv_rot[3];
Vec3f normal[4];
#endif
a11 = (float) modelview_matrix_[0]; a11 = (float) modelview_matrix_[0];
a12 = (float) modelview_matrix_[4]; a12 = (float) modelview_matrix_[4];
@@ -123,15 +132,14 @@ update_viewing_configurations()
up_dir_ = Vec3f(a21, a22, a23); up_dir_ = Vec3f(a21, a22, a23);
view_dir_ = - Vec3f(a31, a32, a33); view_dir_ = - Vec3f(a31, a32, a33);
Vec3f normal[4];
//float aspect = width() / height(); //float aspect = width() / height();
float half_theta = fovy() * 0.5f; const float half_theta = fovy() * 0.5f;
float half_phi = atanf(aspect() * tanf(half_theta)); const float half_phi = atanf(aspect() * tanf(half_theta));
float sin1 = sinf(half_theta); const float sin1 = sinf(half_theta);
float cos1 = cosf(half_theta); const float cos1 = cosf(half_theta);
float sin2 = sinf(half_phi); const float sin2 = sinf(half_phi);
float cos2 = cosf(half_phi); const float cos2 = cosf(half_phi);
normal[0] = cos2 * right_dir_ + sin2 * view_dir_; normal[0] = cos2 * right_dir_ + sin2 * view_dir_;
normal[1] = -cos1 * up_dir_ - sin1 * view_dir_; normal[1] = -cos1 * up_dir_ - sin1 * view_dir_;