- for (z = 0; z <= 1; z++)
- {
- glFrontFace(z == 0 ? GL_CCW : GL_CW);
- glNormal3f(0, (z == 0 ? -1 : 1), 0);
- glBegin(wire ? GL_LINE_LOOP : GL_TRIANGLE_FAN);
- if (! wire) glVertex3f(0, z, 0);
- for (i = 0, th = 0; i <= faces; i++)
- {
- GLfloat x = cos (th);
- GLfloat y = sin (th);
- glVertex3f(x, z, y);
- th += step;
- }
- glEnd();
- }
+ if (caps_p)
+ for (z = 0; z <= 1; z++)
+ {
+ glFrontFace(z == 0 ? GL_CCW : GL_CW);
+ glNormal3f(0, (z == 0 ? -1 : 1), 0);
+ glBegin(wire_p ? GL_LINE_LOOP : GL_TRIANGLE_FAN);
+ if (! wire_p) glVertex3f(0, z, 0);
+ for (i = 0, th = 0; i <= faces; i++)
+ {
+ GLfloat x = cos (th);
+ GLfloat y = sin (th);
+ glVertex3f(x, z, y);
+ th += step;
+ polys++;
+ }
+ glEnd();
+ }
+ return polys;