WIP stabilize screenshotting
use crate::runner::{State, GUI};
use abstutil::Timer;
use std::io::Write;
-use std::{fs, process};
+use std::{fs, process, thread, time};
pub(crate) fn screenshot_everything<T, G: GUI<T>>(
mut state: State<T, G>,
@@ -30,6 +30,9 @@ pub(crate) fn screenshot_everything<T, G: GUI<T>>(
state.canvas.cam_y = (tile_y as f64) * state.canvas.window_height;
let naming_hint = state.draw(display, program, true, 0);
+ // TODO Is vsync or something else causing the above redraw to not actually show up in
+ // time for scrot to see it? This is slow (30s total for Montlake), but stable.
+ thread::sleep(time::Duration::from_millis(100));
if let Some(filename) = screencap(tile_x, tile_y, naming_hint) {
filenames.push(filename);
} else {
