From b6d20f842e5c889a85ddd45fc2cd55f8fc4ddf4c Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 4 Jun 2007 00:05:58 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1116 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/tristrip.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/src/tristrip.h b/source/src/tristrip.h index ea6134d6..c3d54b48 100644 --- a/source/src/tristrip.h +++ b/source/src/tristrip.h @@ -177,6 +177,7 @@ struct tristrip swap = true; score += nodes[v2] > nodes[v1] ? 1 : -1; } + else if(nexttri.hasvert(v2)) continue; else score += nodes[v1] > nodes[v2] ? 1 : -1; if(!tsswap && swap) continue; score += swap ? 1 : -1; @@ -192,7 +193,7 @@ struct tristrip return next; } - void buildstrip(vector &strip, bool reverse = false) + void buildstrip(vector &strip, bool reverse = false, bool prims = false) { ushort prev = leastconnected(); if(prev==UNUSED) return; @@ -201,7 +202,7 @@ struct tristrip ushort cur = nexttriangle(first, doswap); if(cur==UNUSED) { - loopi(3) strip.add(first.v[reverse && i>=1 ? 3-i : i]); + loopi(3) strip.add(first.v[!prims && reverse && i>=1 ? 3-i : i]); return; } int from = findedge(first, triangles[cur]), @@ -223,6 +224,7 @@ struct tristrip if(!doswap) v2 = v1; v1 = v; } + } void buildstrips(vector &strips, bool prims = true, bool degen = false) @@ -234,7 +236,7 @@ struct tristrip { vector strip; bool reverse = degen && !strips.empty() && (strips.length()&1); - buildstrip(strip, reverse); + buildstrip(strip, reverse, prims); numstrips++; numtris += strip.length()-2; if(strip.length()==3 && prims)