Commit 29c83993 authored by Andrei Lisita's avatar Andrei Lisita 🎮

runner: Replace load_savestate() with load_previewed_savestate()

parent b6f51f6b
......@@ -62,6 +62,13 @@ public class Games.CommandRunner : Object, Runner {
public void preview_savestate (Savestate savestate) {
}
public void load_previewed_savestate () {
}
public Savestate[] get_savestates () {
return {};
}
public void start () throws Error {
string? working_directory = null;
string[]? envp = null;
......@@ -99,13 +106,6 @@ public class Games.CommandRunner : Object, Runner {
return false;
}
public void load_savestate (Savestate savestate) {
}
public Savestate[] get_savestates () {
return {};
}
public InputMode[] get_available_input_modes () {
return { };
}
......
......@@ -24,7 +24,7 @@ public interface Games.Runner : Object {
public abstract void preview_savestate (Savestate savestate);
public abstract bool try_create_savestate (bool is_automatic);
public abstract void load_savestate (Savestate savestate) throws Error;
public abstract void load_previewed_savestate () throws Error;
public abstract Savestate[] get_savestates ();
public abstract InputMode[] get_available_input_modes ();
......
......@@ -49,6 +49,13 @@ private class Games.DummyRunner : Object, Runner {
public void preview_savestate (Savestate savestate) {
}
public void load_previewed_savestate () {
}
public Savestate[] get_savestates () {
return {};
}
public void start () throws Error {
}
......@@ -65,13 +72,6 @@ private class Games.DummyRunner : Object, Runner {
return false;
}
public void load_savestate (Savestate savestate) {
}
public Savestate[] get_savestates () {
return {};
}
public InputMode[] get_available_input_modes () {
return { };
}
......
......@@ -184,22 +184,16 @@ public class Games.RetroRunner : Object, Runner {
view.set_pixbuf (pixbuf);
}
public virtual Gtk.Widget? get_extra_widget () {
return null;
}
public void load_savestate (Savestate savestate) throws Error {
stop ();
tmp_live_savestate = savestate.clone_in_tmp ();
instantiate_core (tmp_live_savestate.get_save_directory_path ());
public void load_previewed_savestate () throws Error {
loop.stop ();
tmp_live_savestate = previewed_savestate.clone_in_tmp ();
core.save_directory = tmp_live_savestate.get_save_directory_path ();
load_save_ram (savestate.get_save_ram_path ());
core.set_state (savestate.get_snapshot_data ());
load_save_ram (previewed_savestate.get_save_ram_path ());
core.set_state (previewed_savestate.get_snapshot_data ());
if (savestate.has_media_data ())
media_set.selected_media_number = savestate.get_media_data ();
if (previewed_savestate.has_media_data ())
media_set.selected_media_number = previewed_savestate.get_media_data ();
loop.start ();
......@@ -207,6 +201,10 @@ public class Games.RetroRunner : Object, Runner {
running = true;
}
public virtual Gtk.Widget? get_extra_widget () {
return null;
}
public Savestate[] get_savestates () {
if (game_savestates == null) {
critical ("RetroRunner hasn't loaded savestates. Call try_init_phase_one()");
......
......@@ -275,7 +275,8 @@ private class Games.DisplayView : Object, UiView {
var savestates = box.runner.get_savestates ();
var latest_savestate = savestates[0];
box.runner.load_savestate (latest_savestate);
box.runner.preview_savestate (latest_savestate);
box.runner.load_previewed_savestate ();
}
else
runner.start ();
......
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