mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-26 16:02:23 +03:00
WIP stabilize screenshotting
This commit is contained in:
parent
72b39b0401
commit
e1155a1d9c
@ -1,7 +1,7 @@
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user