[gnome-games] retro: Make RetroRunner use RetroInputManager
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] retro: Make RetroRunner use RetroInputManager
- Date: Mon, 18 Jul 2016 18:54:11 +0000 (UTC)
commit 74d21695aa23957509ee69e507f3a2bdd92c5045
Author: Megh Parikh <meghprkh gmail com>
Date: Mon Jul 18 22:51:38 2016 +0530
retro: Make RetroRunner use RetroInputManager
Make RetroRunner use RetroInputManager which maps input devices including
gamepad and keyboard to proper ports of the console.
This is the last in a series of commits to add gamepad support.
Fixes #303
src/retro/retro-runner.vala | 14 +++-----------
1 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/src/retro/retro-runner.vala b/src/retro/retro-runner.vala
index 0fb60da..f760594 100644
--- a/src/retro/retro-runner.vala
+++ b/src/retro/retro-runner.vala
@@ -27,9 +27,7 @@ public class Games.RetroRunner : Object, Runner {
private Retro.Core core;
private RetroGtk.CairoDisplay video;
private RetroGtk.PaPlayer audio;
- private RetroGtk.VirtualGamepad gamepad;
- private RetroGtk.Keyboard keyboard;
- private RetroGtk.InputDeviceManager input;
+ private RetroInputManager input_manager;
private Retro.Options options;
private RetroLog log;
private Retro.Loop loop;
@@ -138,9 +136,7 @@ public class Games.RetroRunner : Object, Runner {
widget = new Gtk.EventBox ();
widget.add (video);
video.visible = true;
-
- gamepad = new RetroGtk.VirtualGamepad (widget);
- keyboard = new RetroGtk.Keyboard (widget);
+ input_manager = new RetroInputManager (widget);
prepare_core (module_basename, uri);
core.shutdown.connect (on_shutdown);
@@ -166,19 +162,15 @@ public class Games.RetroRunner : Object, Runner {
core = new Retro.Core (module_path);
audio = new RetroGtk.PaPlayer ();
- input = new RetroGtk.InputDeviceManager ();
options = new Retro.Options ();
log = new RetroLog ();
- input.set_controller_device (0, gamepad);
- input.set_keyboard (keyboard);
-
core.variables_interface = options;
core.log_interface = log;
core.video_interface = video;
core.audio_interface = audio;
- core.input_interface = input;
+ core.input_interface = input_manager.input;
core.init ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]