summaryrefslogtreecommitdiffstats
path: root/edit.cpp
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2007-09-21 23:47:05 +0200
committerneoraider <devnull@localhost>2007-09-21 23:47:05 +0200
commit62e42408485e9e1b7e939925b650a4b2e90ecddb (patch)
tree9305aa0f7b2d79c35250939beca2c268dd61e23d /edit.cpp
parent1bce1d8ad7c32ce7b6723a284842b6890cf5209f (diff)
downloadzoomedit-62e42408485e9e1b7e939925b650a4b2e90ecddb.tar
zoomedit-62e42408485e9e1b7e939925b650a4b2e90ecddb.zip
zoomedit: Big transition Ciaro -> OpenGL, enormous speedup!
Diffstat (limited to 'edit.cpp')
-rw-r--r--edit.cpp19
1 files changed, 3 insertions, 16 deletions
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;