diff --git a/source/src/tristrip.h b/source/src/tristrip.h index cc5742a3..dfaedae7 100644 --- a/source/src/tristrip.h +++ b/source/src/tristrip.h @@ -52,7 +52,8 @@ struct tristrip vector connectivity[4]; vector nodes; - void addtriangles(const ushort *triidxs, int numtris) + template + void addtriangles(const T *tris, int numtris) { if(dbgts) conoutf("addtriangles: tris = %d, inds = %d", numtris, numtris*3); loopi(numtris) @@ -60,7 +61,7 @@ struct tristrip triangle &tri = triangles.add(); loopj(3) { - tri.v[j] = *triidxs++; + tri.v[j] = tris[i].vert[j]; tri.n[j] = UNUSED; } if(tri.v[0]==tri.v[1] || tri.v[1]==tri.v[2] || tri.v[2]==tri.v[0]) @@ -83,8 +84,7 @@ struct tristrip loopj(3) { edge e = { tri.v[j==2 ? 0 : j+1], tri.v[j] }; - ushort owner = i; - edges.access(e, &owner); + edges.access(e, i); while(nodes.length()<=tri.v[j]) nodes.add(0); nodes[tri.v[j]]++; diff --git a/source/src/vertmodel.h b/source/src/vertmodel.h index 1d89b504..870c1fc7 100644 --- a/source/src/vertmodel.h +++ b/source/src/vertmodel.h @@ -85,7 +85,7 @@ struct vertmodel : model void genstrips() { tristrip ts; - ts.addtriangles(tris->vert, numtris); + ts.addtriangles(tris, numtris); vector idxs; vector draws; ts.buildstrips(idxs, draws);