Browse files

[!] fixed compilation issues in 64-bit

  • Loading branch information...
1 parent 9a778b5 commit ffc3ba1a059338033192ce0d7b0170d2ad900747 @joesfer committed Feb 14, 2012
View
8 source/dataStructs/bvh/bvh.cpp
@@ -46,7 +46,7 @@ BVH::BVH(const std::vector<RenderLib::Math::Vector3f> &vertices, const std::vect
} else {
vector<int> primitives;
primitives.reserve(numPrimitives);
- for( size_t i = 0; i < numPrimitives; i++ ) primitives.push_back(i);
+ for( size_t i = 0; i < numPrimitives; i++ ) primitives.push_back((int)i);
split(0, vertices, indices, centroids, primitives, bounds);
}
}
@@ -120,16 +120,16 @@ void BVH::split( size_t nodeIndex,
// create left child
BVHNode leftChild;
Sphere leftSphere( leftBounds.center(), (leftBounds.center() - leftBounds.min()).length() );
- leftChild.volumeIndex = volumes.size();
+ leftChild.volumeIndex = (int)volumes.size();
volumes.push_back(leftSphere);
// create right child
BVHNode rightChild;
Sphere rightSphere( rightBounds.center(), (rightBounds.center() - rightBounds.min()).length() );
- rightChild.volumeIndex = volumes.size();
+ rightChild.volumeIndex = (int)volumes.size();
volumes.push_back(rightSphere);
- node.leftChildIndex = nodes.size();
+ node.leftChildIndex = (int)nodes.size();
leftChildIndex = node.leftChildIndex;
rightChildIndex = leftChildIndex + 1;
nodes.push_back(leftChild);
View
12 source/dataStructs/kdtree/kdTree.cpp
@@ -118,8 +118,8 @@ namespace DataStructures {
BoundingBox rightBounds = bounds;
rightBounds.min()[ bestPlaneType ] = bestSplitter;
- for ( size_t i = 0; i < node->triangles.size(); i++ ) {
- int tri = node->triangles[ i ];
+ for ( int i = 0; i < (int)node->triangles.size(); i++ ) {
+ int tri = (int)node->triangles[ i ];
const BoundingBox& triBounds = triangleBounds[ tri ].bounds;
if ( triBounds.overlaps( leftBounds ) ) {
@@ -175,7 +175,7 @@ namespace DataStructures {
CoreLib::List< float > sorter;
sorter.resize( triangleIndices.size() * 2, true );
- for ( size_t i = 0; i < triangleIndices.size(); i ++ ) {
+ for ( int i = 0; i < (int)triangleIndices.size(); i ++ ) {
sorter[ 2 * i ] = triangleBounds[ triangleIndices[ i ] ].bounds.min()[ axis ];
sorter[ 2 * i + 1 ] = triangleBounds[ triangleIndices[ i ] ].bounds.max()[ axis ];
}
@@ -199,7 +199,7 @@ namespace DataStructures {
split = *splitIt;
size_t leftCount = triangleIndices.size() - right.size();
- for ( size_t j = 0; j < right.size(); j++ ) {
+ for ( int j = 0; j < (int)right.size(); j++ ) {
float minBound = triangleBounds[ right[ j ] ].bounds.min()[ axis ];
float maxBound = triangleBounds[ right[ j ] ].bounds.max()[ axis ];
@@ -252,14 +252,14 @@ namespace DataStructures {
CoreLib::List< float > sorter;
sorter.resize( triangleIndices.size(), true );
- for ( size_t i = 0; i < triangleIndices.size(); i++ ) {
+ for ( int i = 0; i < (int)triangleIndices.size(); i++ ) {
sorter[ i ] = triangleBounds[ triangleIndices[ i ] ].centroid[ axis ];
}
sorter.sort( splitterSort );
if ( ( sorter.size() % 2 ) == 0 ) {
int low = ( (int)sorter.size() - 1 ) / 2;
- int high = ( sorter.size() ) / 2;
+ int high = ( (int)sorter.size() ) / 2;
return ( sorter[ low ] + sorter[ high ] ) * 0.5f;
}
View
28 source/geometry/tesellation/delaunay/delaunay2D.cpp
@@ -43,7 +43,7 @@ namespace internal {
LIST(int)* outTriangles,
const LIST( RenderLib::Math::Vector2f )& vertices ) {
// remove triangles containing vertices from the supertriangle
- for( size_t i = 0; i < adjacency->triangles.size(); i++ ) {
+ for( int i = 0; i < (int)adjacency->triangles.size(); i++ ) {
const AdjacencyInfo::Triangle_t& triangle = adjacency->triangles[ i ];
if ( !triangle.valid ) {
continue;
@@ -69,7 +69,7 @@ namespace internal {
}
}
- for( size_t i = 0; i < adjacency->triangles.size(); i++ ) {
+ for( int i = 0; i < (int)adjacency->triangles.size(); i++ ) {
if ( !adjacency->triangles[ i ].valid ) {
const int remappedTriangle = (int)adjacency->triangles.size() - 1;
adjacency->triangles.removeIndexFast( i );
@@ -131,9 +131,9 @@ namespace internal {
st3.x = center.x + 2.0f * radius * cosf( (float)DEG2RAD(240.0) );
st3.y = center.y + 2.0f * radius * sinf( (float)DEG2RAD(240.0) );
- stIdx1 = adjacency->vertices.size() - 3;
- stIdx2 = adjacency->vertices.size() - 2;
- stIdx3 = adjacency->vertices.size() - 1;
+ stIdx1 = (int)adjacency->vertices.size() - 3;
+ stIdx2 = (int)adjacency->vertices.size() - 2;
+ stIdx3 = (int)adjacency->vertices.size() - 1;
adjacency->createTriangle( stIdx1, stIdx2, stIdx3 );
}
@@ -339,7 +339,7 @@ namespace internal {
#endif
int triangleIndex;
if ( invalidTriangles.empty() ) {
- triangleIndex = triangles.size();
+ triangleIndex = (int)triangles.size();
triangles.append();
} else {
triangleIndex = invalidTriangles[ 0 ];
@@ -351,9 +351,9 @@ namespace internal {
triangle.vertices[ 2 ] = c;
if ( !vertexTriangleAdjacencyInfo.empty() ) {
- vertexTriangleAdjacencyInfo[ a ].append( triangleIndex );
- vertexTriangleAdjacencyInfo[ b ].append( triangleIndex );
- vertexTriangleAdjacencyInfo[ c ].append( triangleIndex );
+ vertexTriangleAdjacencyInfo[ (int)a ].append( triangleIndex );
+ vertexTriangleAdjacencyInfo[ (int)b ].append( triangleIndex );
+ vertexTriangleAdjacencyInfo[ (int)c ].append( triangleIndex );
}
@@ -379,7 +379,7 @@ namespace internal {
void AdjacencyInfo::removeTriangle( unsigned int t )
{
- Triangle_t& triangle = triangles[ t ];
+ Triangle_t& triangle = triangles[ (size_t)t ];
assert( triangle.valid );
for( int i = 0; i < 3; i++ ) {
@@ -439,7 +439,7 @@ namespace internal {
}
if ( hit ) {
- return i;
+ return (int)i;
}
}
return -1;
@@ -743,7 +743,7 @@ namespace internal {
for( size_t t = 0; t < triangles.size(); t++ ) {
Triangle_t& tri = triangles[ t ];
for( int v = 0; v < 3; v++ ) {
- vertexTriangleAdjacencyInfo[ tri.vertices[ v ] ].append( t );
+ vertexTriangleAdjacencyInfo[ tri.vertices[ v ] ].append( (int)t );
}
}
@@ -985,7 +985,7 @@ namespace internal {
}
}
}
- return toDelete.size();
+ return (int)toDelete.size();
}
bool AdjacencyInfo::triangulateSubPolygon_r( const LIST( int )& indices )
@@ -1089,7 +1089,7 @@ namespace internal {
e.vertices[ 1 ] = v2;
e.triangles[ 0 ] = -1;
e.triangles[ 1 ] = -1;
- return edges.size() - 1;
+ return (int)edges.size() - 1;
}
int AdjacencyInfo::commonEdge( const Triangle_t& tri1, const Triangle_t& tri2 ) const
View
14 source/geometry/tesellation/delaunay/delaunay3D.cpp
@@ -579,7 +579,7 @@ namespace internal {
const CoreLib::List< Point >& vertices,
unsigned int resultingTetrahedra[4] ) {
- tetrahedron_t srcT = tetrahedra[ tetrahedron ];
+ tetrahedron_t srcT = tetrahedra[ (int)tetrahedron ];
assert( Tetrahedron::checkFaceOrientations( srcT, vertices ) );
assert( Tetrahedron::checkNeighbors( srcT, tetrahedron, tetrahedra, vertices ) );
@@ -597,11 +597,11 @@ namespace internal {
const unsigned int iResT1 = tetrahedron; // reuse the source tetrahedron slot
tetrahedron_t& resT1 = tetrahedra[ iResT1 ];
Tetrahedron::destroy( resT1, tetrahedra );
- const unsigned int iResT2 = tetrahedra.size();
+ const unsigned int iResT2 = (unsigned int)tetrahedra.size();
tetrahedron_t& resT2 = tetrahedra.append();
- const unsigned int iResT3 = tetrahedra.size();
+ const unsigned int iResT3 = (unsigned int)tetrahedra.size();
tetrahedron_t& resT3 = tetrahedra.append();
- const unsigned int iResT4 = tetrahedra.size();
+ const unsigned int iResT4 = (unsigned int)tetrahedra.size();
tetrahedron_t& resT4 = tetrahedra.append();
assert( !resT1.isValid() );
@@ -748,7 +748,7 @@ namespace internal {
const unsigned int iResT2 = tetrahedron2; // reuse the source tetrahedron2 slot
tetrahedron_t& resT2 = tetrahedra[ iResT2 ];
Tetrahedron::destroy( resT2, tetrahedra );
- const unsigned int iResT3 = tetrahedra.size();
+ const unsigned int iResT3 = (unsigned int)tetrahedra.size();
tetrahedron_t& resT3 = tetrahedra.append();
assert( !resT1.isValid() );
@@ -1456,7 +1456,7 @@ namespace internal {
bool found = false;
for( size_t i = 0; i < visited.size(); i++ ) {
if ( !visited[ i ] ) {
- t = i;
+ t = (int)i;
found = true;
break;
}
@@ -1981,7 +1981,7 @@ bool Delaunay3D::tetrahedralize( const CoreLib::List< Point >& srcPoints,
tetrahedra.setGranularity( 4 * numSrcPoints );
for( size_t i = 0; i < numSrcPoints; i++ ) {
- internal::insertOnePoint( pointSet, i, tetrahedra );
+ internal::insertOnePoint( pointSet, (int)i, tetrahedra );
}
#if _DEBUG
// verify Delaunay condition (empty spheres) for all tetrahedra

0 comments on commit ffc3ba1

Please sign in to comment.