diff options
Diffstat (limited to 'edit.cpp')
-rw-r--r-- | edit.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
@@ -1,6 +1,5 @@ #include "Level.h" #include "edit.h" -#include "geometry.h" static int editMode = EDIT_MODE_VIEW; @@ -145,6 +144,9 @@ bool isPolygonOk(Polygon *polygon) { if(polygon->size() == 1) return true; + if(!polygon->isSimple()) + return false; + for(Polygon::const_iterator it = polygon->begin(); it != polygon->end(); it++) { Polygon::const_iterator it2 = it+1; if(it2 == polygon->end()) it2 = polygon->begin(); @@ -156,21 +158,6 @@ bool isPolygonOk(Polygon *polygon) { if(room->intersects(l)) return false; } - - if(it2 != polygon->begin()) { - for(Polygon::const_iterator it3 = it2+1; it3 != polygon->end(); it3++) { - Polygon::const_iterator it4 = it3+1; - if(it4 == polygon->end()) it4 = polygon->begin(); - - if(it == polygon->begin() && it4 == polygon->begin()) continue; - - l2.setVertex1(*it3); - l2.setVertex2(*it4); - - if(l.intersects(l2, NULL) == INTERSECTION_SEGMENT_SEGMENT) - return false; - } - } } return true; |