+ {
+ glTranslatef (sp->current.x, sp->current.y, 0);
+ glScalef (sp->current.w, sp->current.h, 1);
+
+ if (wire) /* Draw a grid inside the box */
+ {
+ GLfloat dy = 0.1;
+ GLfloat dx = dy * img->w / img->h;
+ GLfloat x, y;
+
+ if (sp->id & 1)
+ glColor4f (sp->opacity, 0, 0, 1);
+ else
+ glColor4f (0, 0, sp->opacity, 1);
+
+ glBegin(GL_LINES);
+ glVertex3f (0, 0, 0); glVertex3f (1, 1, 0);
+ glVertex3f (1, 0, 0); glVertex3f (0, 1, 0);
+
+ for (y = 0; y < 1+dy; y += dy)
+ {
+ GLfloat yy = (y > 1 ? 1 : y);
+ for (x = 0.5; x < 1+dx; x += dx)
+ {
+ GLfloat xx = (x > 1 ? 1 : x);
+ glVertex3f (0, xx, 0); glVertex3f (1, xx, 0);
+ glVertex3f (yy, 0, 0); glVertex3f (yy, 1, 0);
+ }
+ for (x = 0.5; x > -dx; x -= dx)
+ {
+ GLfloat xx = (x < 0 ? 0 : x);
+ glVertex3f (0, xx, 0); glVertex3f (1, xx, 0);
+ glVertex3f (yy, 0, 0); glVertex3f (yy, 1, 0);
+ }
+ }
+ glEnd();
+ }
+ else /* Draw the texture quad */
+ {
+ GLfloat texw = img->geom.width / (GLfloat) img->tw;
+ GLfloat texh = img->geom.height / (GLfloat) img->th;
+ GLfloat texx1 = img->geom.x / (GLfloat) img->tw;
+ GLfloat texy1 = img->geom.y / (GLfloat) img->th;
+ GLfloat texx2 = texx1 + texw;
+ GLfloat texy2 = texy1 + texh;
+
+ glBindTexture (GL_TEXTURE_2D, img->texid);
+ glColor4f (1, 1, 1, sp->opacity);
+ glNormal3f (0, 0, 1);
+ glBegin (GL_QUADS);
+ glTexCoord2f (texx1, texy2); glVertex3f (0, 0, 0);
+ glTexCoord2f (texx2, texy2); glVertex3f (1, 0, 0);
+ glTexCoord2f (texx2, texy1); glVertex3f (1, 1, 0);
+ glTexCoord2f (texx1, texy1); glVertex3f (0, 1, 0);
+ glEnd();
+
+ if (debug_p) /* Draw a border around the image */
+ {
+ if (!wire) glDisable (GL_TEXTURE_2D);
+
+ if (sp->id & 1)
+ glColor4f (sp->opacity, 0, 0, 1);
+ else
+ glColor4f (0, 0, sp->opacity, 1);
+
+ glBegin (GL_LINE_LOOP);
+ glVertex3f (0, 0, 0);
+ glVertex3f (0, 1, 0);
+ glVertex3f (1, 1, 0);
+ glVertex3f (1, 0, 0);
+ glEnd();
+
+ if (!wire) glEnable (GL_TEXTURE_2D);
+ }
+ }
+
+
+ if (do_titles &&
+ img->title && *img->title)
+ {
+ int x = 10;
+ int y = mi->xgwa.height - 10;
+ glColor4f (0, 0, 0, sp->opacity); /* cheap-assed dropshadow */
+ print_gl_string (mi->dpy, ss->xfont, ss->font_dlist,
+ mi->xgwa.width, mi->xgwa.height, x, y,
+ img->title);
+ x++; y++;
+ glColor4f (1, 1, 1, sp->opacity);
+ print_gl_string (mi->dpy, ss->xfont, ss->font_dlist,
+ mi->xgwa.width, mi->xgwa.height, x, y,
+ img->title);
+ }
+ }
+ glPopMatrix();
+
+ if (debug_p)
+ {
+ if (!wire) glDisable (GL_TEXTURE_2D);
+
+ if (sp->id & 1)
+ glColor4f (1, 0, 0, 1);
+ else
+ glColor4f (0, 0, 1, 1);
+
+ /* Draw the "from" and "to" boxes
+ */
+ glBegin (GL_LINE_LOOP);
+ glVertex3f (sp->from.x, sp->from.y, 0);
+ glVertex3f (sp->from.x + sp->from.w, sp->from.y, 0);
+ glVertex3f (sp->from.x + sp->from.w, sp->from.y + sp->from.h, 0);
+ glVertex3f (sp->from.x, sp->from.y + sp->from.h, 0);
+ glEnd();
+
+ glBegin (GL_LINE_LOOP);
+ glVertex3f (sp->to.x, sp->to.y, 0);
+ glVertex3f (sp->to.x + sp->to.w, sp->to.y, 0);
+ glVertex3f (sp->to.x + sp->to.w, sp->to.y + sp->to.h, 0);
+ glVertex3f (sp->to.x, sp->to.y + sp->to.h, 0);
+ glEnd();
+
+ if (!wire) glEnable (GL_TEXTURE_2D);
+ }
+}
+
+
+static void
+tick_sprites (ModeInfo *mi)
+{
+ slideshow_state *ss = &sss[MI_SCREEN(mi)];
+ int i;
+ for (i = 0; i < ss->nsprites; i++)
+ tick_sprite (mi, ss->sprites[i]);
+}