diff --git a/common/geometry/shape_collisions.cpp b/common/geometry/shape_collisions.cpp index abd13caccf..604335b43e 100644 --- a/common/geometry/shape_collisions.cpp +++ b/common/geometry/shape_collisions.cpp @@ -160,69 +160,67 @@ bool CollideShapes( const SHAPE* aA, const SHAPE* aB, int aClearance, { switch( aA->Type() ) { - case SH_RECT: - switch( aB->Type() ) - { - case SH_CIRCLE: - return Collide( *static_cast( aA ), - *static_cast( aB ), aClearance, aNeedMTV, aMTV ); - - case SH_LINE_CHAIN: - return Collide( *static_cast( aA ), - *static_cast( aB ), aClearance, aNeedMTV, aMTV ); - - default: - break; - } - break; - + case SH_RECT: + switch( aB->Type() ) + { case SH_CIRCLE: - switch( aB->Type() ) - { - case SH_RECT: - return Collide( *static_cast( aB ), - *static_cast( aA ), aClearance, aNeedMTV, aMTV ); - - case SH_CIRCLE: - return Collide( *static_cast( aA ), - *static_cast( aB ), aClearance, aNeedMTV, aMTV ); - - case SH_LINE_CHAIN: - return Collide( *static_cast( aA ), - *static_cast( aB ), aClearance, aNeedMTV, aMTV ); - - default: - break; - } - break; + return Collide( *static_cast( aA ), + *static_cast( aB ), aClearance, aNeedMTV, aMTV ); case SH_LINE_CHAIN: - switch( aB->Type() ) - { - case SH_RECT: - return Collide( *static_cast( aB ), - *static_cast( aA ), aClearance, aNeedMTV, aMTV ); - - case SH_CIRCLE: - return Collide( *static_cast( aB ), - *static_cast( aA ), aClearance, aNeedMTV, aMTV ); - - case SH_LINE_CHAIN: - return Collide( *static_cast( aA ), - *static_cast( aB ), aClearance, aNeedMTV, aMTV ); - - default: - break; - } - break; + return Collide( *static_cast( aA ), + *static_cast( aB ), aClearance, aNeedMTV, aMTV ); default: break; + } + break; + + case SH_CIRCLE: + switch( aB->Type() ) + { + case SH_RECT: + return Collide( *static_cast( aB ), + *static_cast( aA ), aClearance, aNeedMTV, aMTV ); + + case SH_CIRCLE: + return Collide( *static_cast( aA ), + *static_cast( aB ), aClearance, aNeedMTV, aMTV ); + + case SH_LINE_CHAIN: + return Collide( *static_cast( aA ), + *static_cast( aB ), aClearance, aNeedMTV, aMTV ); + + default: + break; + } + break; + + case SH_LINE_CHAIN: + switch( aB->Type() ) + { + case SH_RECT: + return Collide( *static_cast( aB ), + *static_cast( aA ), aClearance, aNeedMTV, aMTV ); + + case SH_CIRCLE: + return Collide( *static_cast( aB ), + *static_cast( aA ), aClearance, aNeedMTV, aMTV ); + + case SH_LINE_CHAIN: + return Collide( *static_cast( aA ), + *static_cast( aB ), aClearance, aNeedMTV, aMTV ); + + default: + break; + } + break; + + default: + break; } - bool unsupported_collision = true; - - assert( unsupported_collision == false ); + assert( 0 ); // unsupported_collision return false; } diff --git a/polygon/poly2tri/common/shapes.cc b/polygon/poly2tri/common/shapes.cc index b7a087f96e..06eb1f80c5 100644 --- a/polygon/poly2tri/common/shapes.cc +++ b/polygon/poly2tri/common/shapes.cc @@ -133,11 +133,15 @@ void Triangle::ClearDelunayEdges() Point* Triangle::OppositePoint( Triangle& t, Point& p ) { Point* cw = t.PointCW( p ); + + /* double x = cw->x; double y = cw->y; x = p.x; y = p.y; + */ + return PointCW( *cw ); } @@ -195,6 +199,7 @@ int Triangle::Index( const Point* p ) } assert( 0 ); + return 0; // you better hope its a Debug build. } @@ -285,6 +290,7 @@ Point* Triangle::PointCW( Point& point ) } assert( 0 ); + return NULL; // you better hope its a Debug build. } @@ -305,6 +311,7 @@ Point* Triangle::PointCCW( Point& point ) } assert( 0 ); + return NULL; // you better hope its a Debug build. }