Commit a218fb83 authored by Andrei Lisita's avatar Andrei Lisita 🎮

runner: Add capture_current_state_pixbuf()

parent 95ab84b3
......@@ -53,6 +53,9 @@ public class Games.CommandRunner : Object, Runner {
return null;
}
public void capture_current_state_pixbuf () {
}
public void start () throws Error {
string? working_directory = null;
string[]? envp = null;
......
......@@ -17,6 +17,9 @@ public interface Games.Runner : Object {
public abstract void resume () throws Error;
public abstract void pause ();
public abstract void stop ();
public abstract void capture_current_state_pixbuf ();
public abstract bool try_create_savestate (bool is_automatic);
public abstract void load_savestate (Savestate savestate) throws Error;
public abstract Savestate[] get_savestates ();
......
......@@ -40,6 +40,9 @@ private class Games.DummyRunner : Object, Runner {
return null;
}
public void capture_current_state_pixbuf () {
}
public void start () throws Error {
}
......
......@@ -49,6 +49,8 @@ public class Games.RetroRunner : Object, Runner {
private Savestate latest_savestate;
private Savestate tmp_live_savestate;
private Gdk.Pixbuf current_state_pixbuf;
private bool _running;
private bool running {
get { return _running; }
......@@ -148,6 +150,10 @@ public class Games.RetroRunner : Object, Runner {
return view;
}
public void capture_current_state_pixbuf () {
current_state_pixbuf = view.get_pixbuf ();
}
public virtual Gtk.Widget? get_extra_widget () {
return null;
}
......@@ -493,7 +499,7 @@ public class Games.RetroRunner : Object, Runner {
}
private void save_screenshot_in_tmp () throws Error {
var pixbuf = view.get_pixbuf ();
var pixbuf = current_state_pixbuf;
if (pixbuf == null)
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment