[retro-gtk/to-c: 11/15] core: Move Core.reset() to C
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk/to-c: 11/15] core: Move Core.reset() to C
- Date: Fri, 7 Jul 2017 07:12:08 +0000 (UTC)
commit 977f8971f60515a65c4b968292eb42850c555f15
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu Jul 6 11:44:50 2017 +0200
core: Move Core.reset() to C
This help porting the library to C.
retro-gtk/core.vala | 6 +-----
retro-gtk/retro-core.c | 13 +++++++++++++
2 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/retro-gtk/core.vala b/retro-gtk/core.vala
index 7b801b6..03c657d 100644
--- a/retro-gtk/core.vala
+++ b/retro-gtk/core.vala
@@ -271,11 +271,7 @@ public class Core : Object {
/**
* Resets the current game.
*/
- public void reset () {
- push_cb_data ();
- module.reset ();
- pop_cb_data ();
- }
+ public extern void reset ();
/**
* Runs the game for one video frame.
diff --git a/retro-gtk/retro-core.c b/retro-gtk/retro-core.c
index 3ab131f..df25c4e 100644
--- a/retro-gtk/retro-core.c
+++ b/retro-gtk/retro-core.c
@@ -124,6 +124,19 @@ retro_core_set_controller_port_device (RetroCore *self,
}
void
+retro_core_reset (RetroCore* self)
+{
+ RetroReset reset;
+
+ g_return_if_fail (self != NULL);
+
+ retro_core_push_cb_data (self);
+ reset = retro_module_get_reset (self->module);
+ reset ();
+ retro_core_pop_cb_data ();
+}
+
+void
retro_core_run (RetroCore* self)
{
RetroRun run;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]