- load_quad (mi, &ss->quads[0]);
- ss->quads[0].state = IN;
-
- ss->image_start_time -= pan_seconds; /* fudge needed for first image */
-
- ss->redisplay_needed_p = True;
-
- ss->fork_p = 0; /* #### buggy */
-
-}
-
-
-/* Call this each time we change from one state to another.
- It gathers statistics on the frame rate of the previous state,
- and if it's bad, turn things off (under the assumption that
- we're running on sucky hardware.)
- */
-static void
-ponder_state_change (ModeInfo *mi)
-{
- slideshow_state *ss = &sss[MI_SCREEN(mi)];
- const char *which;
- int frames, secs;
- GLfloat fps;
-
- if (ss->fade_frame_count && ss->pan_frame_count)
- abort(); /* one of these should be zero! */
- else if (ss->fade_frame_count) /* just finished fading */
- {
- which = "faded ";
- secs = fade_seconds;
- frames = ss->fade_frame_count;
- ss->fade_frame_count = 0;
- }
- else if (ss->pan_frame_count) /* just finished panning */
- {
- which = "panned";
- secs = pan_seconds;
- frames = ss->pan_frame_count;
- ss->pan_frame_count = 0;
- }
- else
- return; /* One of those should be non-zero! Maybe we just started,
- and the machine is insanely slow. */
-
- fps = frames / (GLfloat) secs;
-
- if (debug_p)
- fprintf (stderr, "%s: debug: %s %3d frames %2d sec %4.1f fps\n",
- blurb(), which, frames, secs, fps);
-
-
- if (fps < fps_cutoff && !ss->low_fps_p) /* oops, this computer sucks! */
- {
- int i;
-
- fprintf (stderr,
- "%s: only %.1f fps! Turning off pan/fade to compensate...\n",
- blurb(), fps);
- zoom = 100;
- fade_seconds = 0;
- ss->low_fps_p = True;
-
- sanity_check (mi);
-
- /* Reset all quads, and mark only #0 as active. */
- for (i = 0; i < countof(ss->quads); i++)
- {
- gls_quad *q = &ss->quads[i];
- q->state = DEAD;
- reset_quad (mi, q);
- q->texid = ss->current_texid;
- q->state = (i == 0 ? IN : DEAD);
- }
-
- ss->pan_start_time = ss->now;
- ss->redisplay_needed_p = True;