SDLPP: formatting, make compileable on Linux

This commit is contained in:
2021-03-13 18:36:29 +01:00
parent d2cf54556e
commit 2f20661b5b
16 changed files with 118 additions and 100 deletions
+6 -5
View File
@@ -3,7 +3,7 @@
namespace SDLPP {
CollisionPolygon::CollisionPolygon( double x, double y )
: CollisionPolygon( Vec2D<double>( x, y ) ) {}
: CollisionPolygon( Vec2D< double >( x, y ) ) {}
CollisionPolygon::CollisionPolygon( const Vec2D< double > &input ) {
original = input;
@@ -54,11 +54,12 @@ bool infinityIntersection( const SDLPP::CollisionPolygon &infinite,
bool intersects( const SDLPP::CollisionPolygon &p1,
const SDLPP::CollisionPolygon &p2 ) {
if(p1.rightmost() < p2.leftmost() || p2.rightmost() < p1.leftmost() || p1.bottommost() < p2.topmost() || p2.bottommost() < p1.topmost())
if ( p1.rightmost() < p2.leftmost() || p2.rightmost() < p1.leftmost() ||
p1.bottommost() < p2.topmost() || p2.bottommost() < p1.topmost() )
return false;
for(auto &line : p1.getLines()) {
for(auto &line2 : p2.getLines()) {
if(linesCross(line, line2))
for ( auto &line : p1.getLines() ) {
for ( auto &line2 : p2.getLines() ) {
if ( linesCross( line, line2 ) )
return true;
}
}