From 62e42408485e9e1b7e939925b650a4b2e90ecddb Mon Sep 17 00:00:00 2001 From: neoraider Date: Fri, 21 Sep 2007 21:47:05 +0000 Subject: zoomedit: Big transition Ciaro -> OpenGL, enormous speedup! --- edit.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'edit.cpp') diff --git a/edit.cpp b/edit.cpp index ab19969..3023dc5 100644 --- a/edit.cpp +++ b/edit.cpp @@ -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; -- cgit v1.2.3