Compare commits
No commits in common. "main" and "v0.7.0" have entirely different histories.
|
@ -1832,7 +1832,7 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lemur"
|
name = "lemur"
|
||||||
version = "0.7.1"
|
version = "0.7.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"atoi",
|
"atoi",
|
||||||
|
|
|
@ -4,7 +4,7 @@ description = "An emulator for the Virtual Boy."
|
||||||
repository = "https://git.virtual-boy.com/PVB/lemur"
|
repository = "https://git.virtual-boy.com/PVB/lemur"
|
||||||
publish = false
|
publish = false
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
version = "0.7.1"
|
version = "0.7.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
@ -311,11 +311,12 @@ impl GameWindow {
|
||||||
self.client
|
self.client
|
||||||
.send_command(EmulatorCommand::Screenshot(self.sim_id, tx));
|
.send_command(EmulatorCommand::Screenshot(self.sim_id, tx));
|
||||||
let bytes = rx.await.context("Could not take screenshot")?;
|
let bytes = rx.await.context("Could not take screenshot")?;
|
||||||
let file = rfd::FileDialog::new()
|
let file = rfd::AsyncFileDialog::new()
|
||||||
.add_filter("PNG images", &["png"])
|
.add_filter("PNG images", &["png"])
|
||||||
.set_file_name("screenshot.png")
|
.set_file_name("screenshot.png")
|
||||||
.save_file();
|
.save_file()
|
||||||
let Some(path) = file else {
|
.await;
|
||||||
|
let Some(file) = file else {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
};
|
};
|
||||||
if bytes.len() != 384 * 224 * 2 {
|
if bytes.len() != 384 * 224 * 2 {
|
||||||
|
@ -327,8 +328,10 @@ impl GameWindow {
|
||||||
let y = (index / 2) / 384;
|
let y = (index / 2) / 384;
|
||||||
screencap.put_pixel(x as u32, y as u32, image::Luma([pixel]));
|
screencap.put_pixel(x as u32, y as u32, image::Luma([pixel]));
|
||||||
}
|
}
|
||||||
screencap.save(&path).context("Could not save screenshot")?;
|
screencap
|
||||||
Ok(Some(path.display().to_string()))
|
.save(&file.path())
|
||||||
|
.context("Could not save screenshot")?;
|
||||||
|
Ok(Some(file.path().display().to_string()))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn show_options_menu(&mut self, ctx: &Context, ui: &mut Ui) {
|
fn show_options_menu(&mut self, ctx: &Context, ui: &mut Ui) {
|
||||||
|
|
Loading…
Reference in New Issue