[retro-gtk] core: Move Core.run() to C



commit 59bc4fd7bdaf01d923463ed4864ca3e014cd9a9c
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Jul 6 11:44:40 2017 +0200

    core: Move Core.run() to C
    
    This help porting the library to C.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777489

 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 366ef91..7b801b6 100644
--- a/retro-gtk/core.vala
+++ b/retro-gtk/core.vala
@@ -291,11 +291,7 @@ public class Core : Object {
         * frame if the can_dupe property of {@link video_interface} is set to true.
         * In this case, the video callback can take a null argument for data.
         */
-       public void run () {
-               push_cb_data ();
-               module.run ();
-               pop_cb_data ();
-       }
+       public extern void run ();
 
        public extern bool supports_serialization ();
 
diff --git a/retro-gtk/retro-core.c b/retro-gtk/retro-core.c
index 2dc6a32..3ab131f 100644
--- a/retro-gtk/retro-core.c
+++ b/retro-gtk/retro-core.c
@@ -123,6 +123,19 @@ retro_core_set_controller_port_device (RetroCore       *self,
   retro_core_pop_cb_data ();
 }
 
+void
+retro_core_run (RetroCore* self)
+{
+  RetroRun run;
+
+  g_return_if_fail (self != NULL);
+
+  retro_core_push_cb_data (self);
+  run = retro_module_get_run (self->module);
+  run ();
+  retro_core_pop_cb_data ();
+}
+
 gboolean
 retro_core_supports_serialization (RetroCore *self)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]