From 3aacd1c506269926eeff2c7d8f67657903cd5c67 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 28 Jan 2010 13:04:18 +0100 Subject: [PATCH] more winding stuff fixes --- data/qcsrc/client/miscfunctions.qc | 5 +++-- data/qcsrc/client/winding.qc | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/data/qcsrc/client/miscfunctions.qc b/data/qcsrc/client/miscfunctions.qc index 2fd5850a6..e216d1991 100644 --- a/data/qcsrc/client/miscfunctions.qc +++ b/data/qcsrc/client/miscfunctions.qc @@ -524,16 +524,17 @@ void PolyDrawModel_Cut(entity e, entity cutplanes) for(i_t = 0; i_t < n_t; ++i_t) { tri = getsurfacetriangle(e, i_s, i_t); + ClearWinding(w); // do we NEED this? p = AllocPoint(w, getsurfacepoint(e, i_s, tri_x)); p.texcoord = getsurfacepointattribute(e, i_s, tri_x, SPA_TEXCOORDS0); InsertIntoWinding(w, p); p = AllocPoint(w, getsurfacepoint(e, i_s, tri_y)); p.texcoord = getsurfacepointattribute(e, i_s, tri_y, SPA_TEXCOORDS0); InsertIntoWinding(w, p); p = AllocPoint(w, getsurfacepoint(e, i_s, tri_z)); p.texcoord = getsurfacepointattribute(e, i_s, tri_z, SPA_TEXCOORDS0); InsertIntoWinding(w, p); - for(p = cutplanes; p && w.sort_next != w.sort_prev; p = p.sort_next) + for(p = cutplanes; p && w.sort_next != w; p = p.sort_next) { ClipWindingEpsilon(w, p.movedir, p.origin * p.movedir, 0.01, +1); FreeWinding(w); w = clipwinding_front; } - if(w.sort_next == w.sort_prev) + if(w.sort_next == w) continue; // empty winding R_BeginPolygon(tex, 0); for(p = w.sort_next; p != w; p = p.sort_next) diff --git a/data/qcsrc/client/winding.qc b/data/qcsrc/client/winding.qc index a98eeaf93..594842afb 100644 --- a/data/qcsrc/client/winding.qc +++ b/data/qcsrc/client/winding.qc @@ -124,7 +124,7 @@ void ClipWindingEpsilon(entity w, vector norm, float dist, float epsilon, float { p2 = p.sort_next; if(p2 == w) - p2 = p.sort_next; + p2 = p2.sort_next; d = p.origin * norm - dist; d2 = p2.origin * norm - dist; if(d > epsilon) // front -- 2.39.2