diff -uNr a/gl2ps.c b/gl2ps.c --- a/gl2ps.c 2012-11-27 14:41:06.000000000 -0500 +++ b/gl2ps.c 2015-05-01 14:25:24.672813803 -0400 @@ -2198,10 +2198,17 @@ gl2psListAdd(gl2ps->primitives, &prim); } -static GLint gl2psGetVertex(GL2PSvertex *v, GLfloat *p) +static void print_position (const char *label, GL2PSxyz xyz, GL2PSrgba rgba) +{ + fprintf (stderr, " %s: %f %f (%f %f %f)\n", label, xyz[0], xyz[1], rgba[0], rgba[1], rgba[2]); +} + +static GLint gl2psGetVertex(GL2PSvertex *v, GLfloat *p, const char *label) { GLint i; + GLint retval; + v->xyz[0] = p[0]; v->xyz[1] = p[1]; v->xyz[2] = p[2]; @@ -2212,15 +2219,20 @@ v->rgba[1] = gl2ps->colormap[i][1]; v->rgba[2] = gl2ps->colormap[i][2]; v->rgba[3] = gl2ps->colormap[i][3]; - return 4; + retval = 4; } else{ v->rgba[0] = p[3]; v->rgba[1] = p[4]; v->rgba[2] = p[5]; v->rgba[3] = p[6]; - return 7; + retval = 7; } + + if (label) + print_position (label, v->xyz, v->rgba); + + return retval; } static void gl2psParseFeedbackBuffer(GLint used) @@ -2246,7 +2258,7 @@ case GL_POINT_TOKEN : current ++; used --; - i = gl2psGetVertex(&vertices[0], current); + i = gl2psGetVertex(&vertices[0], current, "POINT"); current += i; used -= i; gl2psAddPolyPrimitive(GL2PS_POINT, 1, vertices, 0, @@ -2256,10 +2268,10 @@ case GL_LINE_RESET_TOKEN : current ++; used --; - i = gl2psGetVertex(&vertices[0], current); + i = gl2psGetVertex(&vertices[0], current, "LINE"); current += i; used -= i; - i = gl2psGetVertex(&vertices[1], current); + i = gl2psGetVertex(&vertices[1], current, "LINE"); current += i; used -= i; gl2psAddPolyPrimitive(GL2PS_LINE, 2, vertices, 0, @@ -2271,7 +2283,7 @@ used -= 2; v = vtot = 0; while(count > 0 && used > 0){ - i = gl2psGetVertex(&vertices[v], current); + i = gl2psGetVertex(&vertices[v], current, "POLYGON"); gl2psAdaptVertexForBlending(&vertices[v]); current += i; used -= i; @@ -2299,7 +2311,7 @@ case GL_COPY_PIXEL_TOKEN : current ++; used --; - i = gl2psGetVertex(&vertices[0], current); + i = gl2psGetVertex(&vertices[0], current, "PIXEL"); current += i; used -= i; break; @@ -2368,7 +2380,7 @@ prim->data.image = node->image; current += 2; used -= 2; - i = gl2psGetVertex(&prim->verts[0], ¤t[1]); + i = gl2psGetVertex(&prim->verts[0], ¤t[1], "IMAGEMAP"); current += i; used -= i; node->image->width = (GLint)current[2]; @@ -3016,12 +3028,14 @@ gl2ps->lastlinewidth != prim->width || gl2ps->lastpattern != prim->pattern || gl2ps->lastfactor != prim->factor){ + /* End the current line if the new segment does not start where the last one ended, or if the color, the width or the stippling have changed (multi-stroking lines with changing colors is necessary until we use /shfill for lines; unfortunately this means that at the moment we can screw up line stippling for smooth-shaded lines) */ + print_position ("PRINT LE", gl2ps->lastvertex.xyz, gl2ps->lastrgba); gl2psEndPostScriptLine(); newline = 1; } @@ -3036,6 +3050,8 @@ gl2psPrintPostScriptColor(prim->verts[0].rgba); gl2psPrintf("%g %g %s\n", prim->verts[0].xyz[0], prim->verts[0].xyz[1], newline ? "LS" : "L"); + print_position (newline ? "PRINT LS" : "PRINT L", prim->verts[0].xyz, + prim->verts[0].rgba); gl2ps->lastvertex = prim->verts[1]; break; case GL2PS_TRIANGLE :