#define NUM_SCENES 2
/* draw method for ant */
-static Bool draw_ant(antspotlightstruct *mp,
+static Bool draw_ant(ModeInfo *mi, antspotlightstruct *mp,
const GLfloat *Material, int mono, int shadow,
float ant_step, Bool (*sphere)(float), Bool (*cone)(float))
{
glVertex3f(0.00, 0.30, 0.00);
glColor3fv(MaterialGray);
glVertex3f(0.40, 0.70, 0.40);
+ mi->polygon_count++;
glColor3fv(mp->mono ? MaterialGray5 : Material);
glVertex3f(0.00, 0.30, 0.00);
glColor3fv(MaterialGray);
glVertex3f(0.40, 0.70, -0.40);
+ mi->polygon_count++;
glEnd();
if(!shadow) {
glBegin(GL_POINTS);
glColor3fv(mp->mono ? MaterialGray6 : MaterialGray5);
glVertex3f(0.40, 0.70, 0.40);
+ mi->polygon_count++;
glVertex3f(0.40, 0.70, -0.40);
+ mi->polygon_count++;
glEnd();
}
glColor3fv(mp->mono ? MaterialGray5 : Material);
glVertex3f(0.00, 0.05, 0.18);
glVertex3f(0.35 + 0.05 * cos1, 0.15, 0.25);
+ mi->polygon_count++;
glColor3fv(MaterialGray);
glVertex3f(-0.20 + 0.05 * cos1, 0.25 + 0.1 * sin1, 0.45);
+ mi->polygon_count++;
glEnd();
/* LEFT-CENTER ARM */
glColor3fv(mp->mono ? MaterialGray5 : Material);
glVertex3f(0.00, 0.00, 0.18);
glVertex3f(0.35 + 0.05 * cos2, 0.00, 0.25);
+ mi->polygon_count++;
glColor3fv(MaterialGray);
glVertex3f(-0.20 + 0.05 * cos2, 0.00 + 0.1 * sin2, 0.45);
+ mi->polygon_count++;
glEnd();
/* LEFT-BACK ARM */
glColor3fv(mp->mono ? MaterialGray5 : Material);
glVertex3f(0.00, -0.05, 0.18);
glVertex3f(0.35 + 0.05 * cos3, -0.15, 0.25);
+ mi->polygon_count++;
glColor3fv(MaterialGray);
glVertex3f(-0.20 + 0.05 * cos3, -0.25 + 0.1 * sin3, 0.45);
+ mi->polygon_count++;
glEnd();
/* RIGHT-FRONT ARM */
glColor3fv(mp->mono ? MaterialGray5 : Material);
glVertex3f(0.00, 0.05, -0.18);
glVertex3f(0.35 - 0.05 * sin1, 0.15, -0.25);
+ mi->polygon_count++;
glColor3fv(MaterialGray);
glVertex3f(-0.20 - 0.05 * sin1, 0.25 + 0.1 * cos1, -0.45);
+ mi->polygon_count++;
glEnd();
/* RIGHT-CENTER ARM */
glColor3fv(mp->mono ? MaterialGray5 : Material);
glVertex3f(0.00, 0.00, -0.18);
glVertex3f(0.35 - 0.05 * sin2, 0.00, -0.25);
+ mi->polygon_count++;
glColor3fv(MaterialGray);
glVertex3f(-0.20 - 0.05 * sin2, 0.00 + 0.1 * cos2, -0.45);
+ mi->polygon_count++;
glEnd();
/* RIGHT-BACK ARM */
glColor3fv(mp->mono ? MaterialGray5 : Material);
glVertex3f(0.00, -0.05, -0.18);
glVertex3f(0.35 - 0.05 * sin3, -0.15, -0.25);
+ mi->polygon_count++;
glColor3fv(MaterialGray);
glVertex3f(-0.20 - 0.05 * sin3, -0.25 + 0.1 * cos3, -0.45);
+ mi->polygon_count++;
glEnd();
if(!shadow) {
glVertex3f(-0.20 - 0.05 * sin1, 0.25 + 0.1 * cos1, -0.45);
glVertex3f(-0.20 - 0.05 * sin2, 0.00 + 0.1 * cos2, -0.45);
glVertex3f(-0.20 - 0.05 * sin3, -0.25 + 0.1 * cos3, -0.45);
+ mi->polygon_count += 6;
glEnd();
}
/* no cone */
static Bool myCone2(float radius) { return True; }
-static void draw_board(antspotlightstruct *mp)
+static void draw_board(ModeInfo *mi, antspotlightstruct *mp)
{
int i, j;
double cutoff = Pi/3.0;
glTexCoord2f(tex[0], tex[1]);
glVertex3f(point[0], point[1], point[2]);
+ mi->polygon_count++;
}
glEnd();
}
/* draw ant composed of skeleton and glass */
-static void show_ant(antspotlightstruct *mp)
+static void show_ant(ModeInfo *mi, antspotlightstruct *mp)
{
glPushMatrix();
glRotatef(90.0, 0.0, 0.0, 1.0);
/* draw skeleton */
- draw_ant(mp, mp->ant->material, mp->mono, 0, mp->ant->step, mySphere2, myCone2);
+ draw_ant(mi, mp, mp->ant->material, mp->mono, 0, mp->ant->step, mySphere2, myCone2);
/* draw glass */
if(!mp->wire && !mp->mono) {
glEnable(GL_BLEND);
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, MaterialGrayB);
glColor4fv(MaterialGrayB);
- draw_ant(mp, MaterialGrayB, mp->mono, 0, mp->ant->step, mySphere, myCone2);
+ draw_ant(mi, mp, MaterialGrayB, mp->mono, 0, mp->ant->step, mySphere, myCone2);
glDisable(GL_BLEND);
}
if(mp->wire)
;
else
- draw_board(mp);
+ draw_board(mi, mp);
glDisable(GL_LIGHT2);
glEnable(GL_LIGHT0);
glEnable(GL_LIGHT1);
/* now modify ant */
- show_ant(mp);
+ show_ant(mi, mp);
/* near goal, bend path towards next step */
if(distance(mp->ant->position, mp->ant->goal) < 0.2) {
if(!mp->glx_context)
return;
+ mi->polygon_count = 0;
+
/* Just keep running before the texture has come in. */
/* if (mp->waiting_for_image_p) return; */