X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=curves.c;h=f0b8b293a80857233bd024b1a340d89cfd15a855;hb=2b7759404ad6679d201d96c7a67ea48294e3c0b0;hp=66b72734d72c2605bf01b98757d68b6b4a5177e0;hpb=a6260629d2dbe98351a8c55f197c721894046857;p=xonotic%2Fdarkplaces.git diff --git a/curves.c b/curves.c index 66b72734..f0b8b293 100644 --- a/curves.c +++ b/curves.c @@ -47,7 +47,7 @@ double bsplinesample(int dimensions, double t, double *param) void Q3PatchTesselateFloat(int numcomponents, int outputstride, float *outputvertices, int patchwidth, int patchheight, int inputstride, float *patchvertices, int tesselationwidth, int tesselationheight) { int k, l, x, y, component, outputwidth = (patchwidth-1)*tesselationwidth+1; - float px, py, *v0, *v1, a, b, c, *cp[3][3], temp[3][64]; + float px, py, *v, a, b, c, *cp[3][3], temp[3][64]; // iterate over the individual 3x3 quadratic spline surfaces one at a time // expanding them to fill the output array (with some overlap to ensure // the edges are filled) @@ -167,13 +167,13 @@ int Q3PatchTesselationOnY(int patchwidth, int patchheight, int components, const // (such as those produced by Q3PatchTesselate) // (note: width and height are the actual vertex size, this produces // (width-1)*(height-1)*2 triangles, 3 elements each) -void Q3PatchTriangleElements(int *elements, int width, int height) +void Q3PatchTriangleElements(int *elements, int width, int height, int firstvertex) { int x, y, row0, row1; for (y = 0;y < height - 1;y++) { - row0 = (y + 0) * width; - row1 = (y + 1) * width; + row0 = firstvertex + (y + 0) * width; + row1 = firstvertex + (y + 1) * width; for (x = 0;x < width - 1;x++) { *elements++ = row0;